12#ifndef RTCKT_TELSUB_OPERATIONALLOGIC_HPP
13#define RTCKT_TELSUB_OPERATIONALLOGIC_HPP
18#include <system_error>
99 std::unique_ptr<std::pmr::monotonic_buffer_resource>&&
resource = {},
100 std::unique_ptr<std::byte[]>&&
memory = {});
127 enum class State :
uint8_t { Idle = 0, Run, Exit };
132 void ProcessingLoop();
136 void MonitoringLoop();
138 log4cplus::Logger& m_logger;
141 std::unique_ptr<std::byte[]> m_mem;
142 std::unique_ptr<std::pmr::monotonic_buffer_resource> m_resource;
161 std::mutex
mutable m_error_mutex;
162 std::optional<CorrelationError> m_last_corr_error;
174 std::atomic<State> m_requested_state;
175 std::unique_ptr<CorrelatorIf> m_correlator;
176 std::unique_ptr<ShmPublisherIf> m_shm_publisher;
177 std::thread m_processing_thread;
182 std::thread m_monitoring_thread;
Alert Service interface.
Definition alertServiceIf.hpp:128
Models a single alert source that can be set or cleared.
Definition alertServiceIf.hpp:47
Component metrics interface.
Definition componentMetricsIf.hpp:85
Interface to the operational logic implementation.
Definition operationalLogicIf.hpp:74
Implements the behaviour for Operational state.
Definition operationalLogic.hpp:78
uint64_t GetErrorCount() const RTCTK_NOEXCEPT override
Get current error count.
Definition operationalLogic.cpp:117
void IdleAsync() RTCTK_NOEXCEPT override
Stop publishing.
Definition operationalLogic.cpp:107
~OperationalLogic() noexcept
Requests threads to exit and joins with it.
Definition operationalLogic.cpp:87
LastError GetLastError() const RTCTK_NOEXCEPT override
Return last recorded error.
Definition operationalLogic.cpp:112
void RunAsync() RTCTK_NOEXCEPT override
Start publishing.
Definition operationalLogic.cpp:99
OperationalLogic(OperationalParams params, std::unique_ptr< CorrelatorIf > &&correlator, std::unique_ptr< ShmPublisherIf > &&shm_publisher, componentFramework::ComponentMetricsIf &metrics, componentFramework::AlertServiceIf &alerts, std::unique_ptr< std::pmr::monotonic_buffer_resource > &&resource={}, std::unique_ptr< std::byte[]> &&memory={})
Spawns reader thread and starts subscribing to DDS data, but does not publish until StartAsync() is i...
Definition operationalLogic.cpp:37
std::variant< std::monostate, BlenderError, ShmError > PublisherError
Definition shmPublisherIf.hpp:45
#define RTCTK_NOEXCEPT
Definition config.hpp:63
Header file for ComponentMetricsIf.
elt::mal::future< std::string > InjectReqRepEvent(StateMachineEngine &engine)
Definition malEventInjector.hpp:23
Declares OperationalLogicIf.
Describes last errors.
Definition operationalLogicIf.hpp:82
Configuration parameters needed for operational logic.
Definition operationalLogicIf.hpp:55