MotorControlModuleSDFM_TMS3.../Projects/EFC_Communication/UMLibrary/systemic/ResourceLogger.hh
2024-06-07 11:12:56 +03:00

44 lines
1.2 KiB
C++
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*
* 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_ */