5 #ifndef HERALD_LOGGING_ANALYSIS_DELEGATE_H
6 #define HERALD_LOGGING_ANALYSIS_DELEGATE_H
9 #include "../data/sensor_logger.h"
10 #include "../context.h"
19 using namespace sampling;
21 template <
typename ContextT>
25 HLOGGERINIT(m_context,
"herald",
"LoggingAnalysisDelegate")
31 : m_context(other.m_context)
32 HLOGGERINIT(m_context,
"herald",
"LoggingAnalysisDelegate")
38 : m_context(other.m_context)
39 HLOGGERINIT(m_context,
"herald",
"LoggingAnalysisDelegate")
46 m_context = other.m_context;
47 #ifdef HERALD_LOG_LEVEL
48 #if HERALD_LOG_LEVEL != 0
49 logger = other.logger;
57 m_context = other.m_context;
58 #ifdef HERALD_LOG_LEVEL
59 #if HERALD_LOG_LEVEL != 0
60 logger = other.logger;
66 void debug(std::string toLog,
SampledID sampled,
double value)
73 void debug(std::string toLog)
84 template <
typename ContextT,
typename ValT>
86 using value_type = ValT;
120 logger = other.logger;
124 void assignContext(ContextT& newContext) noexcept {
132 if (!logger.has_value()) {
135 logger.value().debug(
"New Sample Recorded.");
140 std::optional<std::reference_wrapper<ContextT>> ctx;
141 std::optional<OptionalSensorLogger<ContextT>> logger;
std::size_t SampledID
Definition: sampling.h:24
Acts as a non-global memory arena for arbitrary classes.
Definition: aggregates.h:15
Logs any given type of sample to the Herald logging subsystem as a Debug message.
Definition: logging_analysis_delegate.h:85
Definition: logging_analysis_delegate.h:22
The Sample taken from an object with ID of type SampledID.
Definition: sampling.h:28