44 lines
1.1 KiB
C++
44 lines
1.1 KiB
C++
/*
|
|
* ResourceLogger.hh
|
|
*
|
|
* Created on: 31 ìàð. 2021 ã.
|
|
* Author: titov
|
|
*/
|
|
|
|
#ifndef UMLIBRARY_SYSTEMIC_RESOURCELOGGER_HH_
|
|
#define UMLIBRARY_SYSTEMIC_RESOURCELOGGER_HH_
|
|
|
|
#include "ResourceHolder.hpp"
|
|
#include "../logging/ILoggable.hh"
|
|
|
|
#include <stdint.h>
|
|
|
|
namespace systemic {
|
|
|
|
//!Ëîãèðóåò îøèáêè äîñòóïà ê ðåñóðñàì - îáúåêòàì.
|
|
class ResourceLogger : public ResourceHolder, public logging::ILoggable {
|
|
|
|
typedef uint32_t Address;
|
|
|
|
//!Îøèáêà äîñòóïà.
|
|
struct ErrorMessage {
|
|
Id object; //!<Èäåíòèôèêàòîð çàïðîñà.
|
|
Tag tag; //!<Ìåòêà îáúåêòà (äëÿ ñòàíäàðòíûõ îáúåêòîâ - 0).
|
|
Address type; //!<Èäåíòèôèêàòîð òèïà îáúåêòà - àäðåñ åãî typeid.
|
|
};
|
|
|
|
void * getRecord( const std::type_info & obj_type, Id id, Tag tag );
|
|
|
|
public:
|
|
ResourceLogger( std::size_t max_size,
|
|
std::pmr::memory_resource* record_allocator,
|
|
std::pmr::memory_resource* record_guard_allocator = nullptr,
|
|
NotificationInterface & herald = getDefault() );
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
#endif /* UMLIBRARY_SYSTEMIC_RESOURCELOGGER_HH_ */
|