12#ifndef RTCKT_TELSUB_OPERATIONALLOGIC_HPP
13#define RTCKT_TELSUB_OPERATIONALLOGIC_HPP
93 std::unique_ptr<CorrelatorIf>&& correlator,
94 std::unique_ptr<ShmPublisherIf>&& shm_publisher,
97 std::unique_ptr<std::pmr::monotonic_buffer_resource>&& resource = {},
98 std::unique_ptr<std::byte[]>&& memory = {});
125 enum class State : uint8_t { Idle = 0, Run, Exit };
130 void ProcessingLoop();
134 void MonitoringLoop();
136 log4cplus::Logger& m_logger;
139 std::unique_ptr<std::byte[]> m_mem;
140 std::unique_ptr<std::pmr::monotonic_buffer_resource> m_resource;
159 std::mutex
mutable m_error_mutex;
160 std::optional<CorrelationError> m_last_corr_error;
162 uint64_t m_error_count{0};
172 std::atomic<State> m_requested_state;
173 std::unique_ptr<CorrelatorIf> m_correlator;
174 std::unique_ptr<ShmPublisherIf> m_shm_publisher;
175 std::thread m_processing_thread;
180 std::thread m_monitoring_thread;
Alert Service interface.
Definition alertServiceIf.hpp:138
Models a single alert source that can be set or cleared.
Definition alertServiceIf.hpp:47
Component metrics interface.
Definition componentMetricsIf.hpp:164
Interface to the operational logic implementation.
Definition operationalLogicIf.hpp:73
void RunAsync() noexcept override
Start publishing.
Definition operationalLogic.cpp:98
~OperationalLogic() noexcept override
Requests threads to exit and joins with it.
Definition operationalLogic.cpp:86
uint64_t GetErrorCount() const noexcept override
Get current error count.
Definition operationalLogic.cpp:116
LastError GetLastError() const noexcept override
Return last recorded error.
Definition operationalLogic.cpp:111
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
void IdleAsync() noexcept override
Stop publishing.
Definition operationalLogic.cpp:106
std::variant< std::monostate, BlenderError, ShmError > PublisherError
Definition shmPublisherIf.hpp:45
Header file for ComponentMetricsIf.
Declares OperationalLogicIf.
Describes last errors.
Definition operationalLogicIf.hpp:80
Configuration parameters needed for operational logic.
Definition operationalLogicIf.hpp:54