MotorControlModuleSDFM_TMS3.../Projects/EFC_Communication/UMLibrary/systemic/ResourceLogger.hh

44 lines
1.2 KiB
C++
Raw Normal View History

2024-06-07 11:12:56 +03:00
/*
* 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_ */