Go to the documentation of this file.
11 #ifndef RTCKT_TELSUB_OPERATIONALLOGIC_HPP
12 #define RTCKT_TELSUB_OPERATIONALLOGIC_HPP
91 std::unique_ptr<CorrelatorIf>&& correlator,
92 std::unique_ptr<ShmPublisherIf>&& shm_publisher,
95 std::unique_ptr<std::pmr::monotonic_buffer_resource>&& resource = {},
96 std::unique_ptr<std::byte[]>&& memory = {});
123 enum class State : int { Idle = 0, Run, Exit };
128 void ProcessingLoop();
132 void MonitoringLoop();
135 std::unique_ptr<std::byte[]> m_mem;
136 std::unique_ptr<std::pmr::monotonic_buffer_resource> m_resource;
155 std::mutex
mutable m_error_mutex;
156 std::error_code m_last_corr_error;
157 std::error_code m_last_pub_error;
158 uint64_t m_error_count;
166 std::atomic<State> m_requested_state;
167 std::unique_ptr<CorrelatorIf> m_correlator;
168 std::unique_ptr<ShmPublisherIf> m_shm_publisher;
169 std::thread m_processing_thread;
174 std::thread m_monitoring_thread;
178 #endif // #ifndef RTCKT_TELSUB_OPERATIONALLOGIC_HPP
Models a single alert source that can be set or cleared.
Definition: alertServiceIf.hpp:42
Header file for ComponentMetricsIf.
Interface to the operational logic implementation.
Definition: operationalLogicIf.hpp:64
Interface to create AlertSource.
Definition: alertServiceIf.hpp:179
Header file for AlertServiceIf and related classes.
Component metrics interface.
Definition: componentMetricsIf.hpp:177
Declares OperationalLogicIf.
Describes last errors.
Definition: operationalLogicIf.hpp:72
Configuration parameters needed for operational logic.
Definition: operationalLogicIf.hpp:45
OperationalLogic(OperationalParams params, std::unique_ptr< CorrelatorIf > &&correlator, std::unique_ptr< ShmPublisherIf > &&shm_publisher, componentFramework::ComponentMetricsIf &metrics, componentFramework::AlertSourceFactoryIf &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:24
~OperationalLogic() noexcept
Requests threads to exit and joins with it.
Definition: operationalLogic.cpp:67
LastError GetLastError() const RTCTK_NOEXCEPT override
Return last recorded error.
Definition: operationalLogic.cpp:101
#define RTCTK_NOEXCEPT
Definition: config.hpp:15
uint64_t GetErrorCount() const RTCTK_NOEXCEPT override
Get current error count.
Definition: operationalLogic.cpp:106
void IdleAsync() RTCTK_NOEXCEPT override
Stop publishing.
Definition: operationalLogic.cpp:93
void RunAsync() RTCTK_NOEXCEPT override
Start publishing.
Definition: operationalLogic.cpp:79
Implements the behaviour for Operational state.
Definition: operationalLogic.hpp:75