11#ifndef RTCKT_TELSUB_OPERATIONALLOGIC_HPP
12#define RTCKT_TELSUB_OPERATIONALLOGIC_HPP
92 std::unique_ptr<CorrelatorIf>&& correlator,
93 std::unique_ptr<ShmPublisherIf>&& shm_publisher,
96 std::unique_ptr<std::pmr::monotonic_buffer_resource>&& resource = {},
97 std::unique_ptr<std::byte[]>&& memory = {});
124 enum class State : uint8_t { Idle = 0, Run, Exit };
129 void ProcessingLoop();
133 void MonitoringLoop();
135 log4cplus::Logger& m_logger;
138 std::unique_ptr<std::byte[]> m_mem;
139 std::unique_ptr<std::pmr::monotonic_buffer_resource> m_resource;
158 std::mutex
mutable m_error_mutex;
159 std::optional<CorrelationError> m_last_corr_error;
161 uint64_t m_error_count{0};
171 std::atomic<State> m_requested_state;
172 std::unique_ptr<CorrelatorIf> m_correlator;
173 std::unique_ptr<ShmPublisherIf> m_shm_publisher;
174 std::thread m_processing_thread;
179 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:163
Interface to the operational logic implementation.
Definition operationalLogicIf.hpp:72
void RunAsync() noexcept override
Start publishing.
Definition operationalLogic.cpp:97
~OperationalLogic() noexcept override
Requests threads to exit and joins with it.
Definition operationalLogic.cpp:85
uint64_t GetErrorCount() const noexcept override
Get current error count.
Definition operationalLogic.cpp:115
LastError GetLastError() const noexcept override
Return last recorded error.
Definition operationalLogic.cpp:110
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:36
void IdleAsync() noexcept override
Stop publishing.
Definition operationalLogic.cpp:105
std::variant< std::monostate, BlenderError, ShmError > PublisherError
Definition shmPublisherIf.hpp:44
Header file for ComponentMetricsIf.
Declares OperationalLogicIf.
Describes last errors.
Definition operationalLogicIf.hpp:79
Configuration parameters needed for operational logic.
Definition operationalLogicIf.hpp:53