Go to the documentation of this file.
11 #ifndef RTCKT_TELSUB_OPERATIONALLOGIC_HPP
12 #define RTCKT_TELSUB_OPERATIONALLOGIC_HPP
88 std::unique_ptr<CorrelatorIf>&& correlator,
89 std::unique_ptr<ShmPublisherIf>&& shm_publisher,
90 std::unique_ptr<std::pmr::monotonic_buffer_resource>&& resource = {},
91 std::unique_ptr<std::byte[]>&& memory = {});
118 enum class State : int { Idle = 0, Run, Exit };
123 void ProcessingLoop();
127 void MonitoringLoop();
130 std::unique_ptr<std::byte[]> m_mem;
131 std::unique_ptr<std::pmr::monotonic_buffer_resource> m_resource;
149 std::mutex
mutable m_error_mutex;
150 std::error_code m_last_error;
151 uint64_t m_error_count;
157 std::atomic<State> m_requested_state;
158 std::unique_ptr<CorrelatorIf> m_correlator;
159 std::unique_ptr<ShmPublisherIf> m_shm_publisher;
160 std::thread m_processing_thread;
165 std::thread m_monitoring_thread;
169 #endif // #ifndef RTCKT_TELSUB_OPERATIONALLOGIC_HPP
std::error_code GetLastError() const RTCTK_NOEXCEPT override
Return last recorded error.
Definition: operationalLogic.cpp:79
Interface to the operational logic implementation.
Definition: operationalLogicIf.hpp:64
Declares OperationalLogicIf.
Configuration parameters needed for operational logic.
Definition: operationalLogicIf.hpp:45
OperationalLogic(OperationalParams params, std::unique_ptr< CorrelatorIf > &&correlator, std::unique_ptr< ShmPublisherIf > &&shm_publisher, 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:22
~OperationalLogic() noexcept
Requests threads to exit and joins with it.
Definition: operationalLogic.cpp:50
#define RTCTK_NOEXCEPT
Definition: config.hpp:15
uint64_t GetErrorCount() const RTCTK_NOEXCEPT override
Get current error count.
Definition: operationalLogic.cpp:84
void IdleAsync() RTCTK_NOEXCEPT override
Stop publishing.
Definition: operationalLogic.cpp:74
void RunAsync() RTCTK_NOEXCEPT override
Start publishing.
Definition: operationalLogic.cpp:62
Implements the behaviour for Operational state.
Definition: operationalLogic.hpp:73