RTC Toolkit 6.0.0-pre2
Loading...
Searching...
No Matches
operationalLogicIf.hpp
Go to the documentation of this file.
1
12#ifndef RTCKT_TELSUB_OPERATIONALLOGICIF_HPP
13#define RTCKT_TELSUB_OPERATIONALLOGICIF_HPP
16#include <rtctk/config.hpp>
17
18#include <chrono>
19#include <optional>
20#include <string>
21
22#include <numapp/numapolicies.hpp>
23
25
26namespace rtctk::telSub {
27
36struct ShmParams {
37 // cppcheck-suppress-begin unusedStructMember
38
39 std::string topic_name;
40 size_t capacity;
41 std::optional<numapp::MemPolicy> mem_policy;
42
43 // cppcheck-suppress-end unusedStructMember
44};
45
60 std::chrono::milliseconds close_detach_delay = std::chrono::milliseconds(0);
61 std::chrono::milliseconds correlator_poll_timeout = std::chrono::milliseconds(100);
62 std::chrono::milliseconds monitor_report_interval = std::chrono::milliseconds(500);
63 std::optional<numapp::NumaPolicies> processing_thread_policies = std::nullopt;
64 std::optional<numapp::NumaPolicies> monitoring_thread_policies = std::nullopt;
65};
66
74public:
75 virtual ~OperationalLogicIf() = default;
76
80 struct LastError {
84 std::optional<CorrelationError> correlation;
89 };
90
98 virtual void RunAsync() noexcept = 0;
99
105 virtual void IdleAsync() noexcept = 0;
106
112 virtual LastError GetLastError() const noexcept = 0;
113
121 virtual uint64_t GetErrorCount() const noexcept = 0;
122};
123
124} // namespace rtctk::telSub
125
126#endif // RTCKT_TELSUB_OPERATIONALLOGICIF_HPP
Interface to the operational logic implementation.
Definition operationalLogicIf.hpp:73
virtual LastError GetLastError() const noexcept=0
Return last recorded error.
virtual void IdleAsync() noexcept=0
Stop publishing.
virtual uint64_t GetErrorCount() const noexcept=0
Get current error count.
virtual void RunAsync() noexcept=0
Start publishing.
virtual ~OperationalLogicIf()=default
std::variant< std::monostate, BlenderError, ShmError > PublisherError
Definition shmPublisherIf.hpp:45
Project-wide configuration header.
Declares CorrelatorIf.
Declares DdsWaitSetIf.
Definition main.cpp:24
Declares ShmPublisher.
Describes last errors.
Definition operationalLogicIf.hpp:80
std::optional< CorrelationError > correlation
Error reading and correlating samples from DDS.
Definition operationalLogicIf.hpp:84
ShmPublisherIf::PublisherError publish
Error from user blending function and publishing to SHM.
Definition operationalLogicIf.hpp:88
Configuration parameters needed for operational logic.
Definition operationalLogicIf.hpp:54
std::chrono::milliseconds monitor_report_interval
Definition operationalLogicIf.hpp:62
std::chrono::milliseconds correlator_poll_timeout
Definition operationalLogicIf.hpp:61
std::optional< numapp::NumaPolicies > processing_thread_policies
Definition operationalLogicIf.hpp:63
std::chrono::milliseconds close_detach_delay
Amount of time to delay detaching the SHM from the point it is signalled as closed.
Definition operationalLogicIf.hpp:60
std::optional< numapp::NumaPolicies > monitoring_thread_policies
Definition operationalLogicIf.hpp:64
Shared memory configuration parameters.
Definition operationalLogicIf.hpp:36
std::optional< numapp::MemPolicy > mem_policy
Definition operationalLogicIf.hpp:41
std::string topic_name
Definition operationalLogicIf.hpp:39
size_t capacity
Definition operationalLogicIf.hpp:40