RTC Toolkit 6.0.0
Loading...
Searching...
No Matches
operationalLogicIf.hpp
Go to the documentation of this file.
1
11#ifndef RTCKT_TELSUB_OPERATIONALLOGICIF_HPP
12#define RTCKT_TELSUB_OPERATIONALLOGICIF_HPP
15#include <rtctk/config.hpp>
16
17#include <chrono>
18#include <optional>
19#include <string>
20
21#include <numapp/numapolicies.hpp>
22
24
25namespace rtctk::telSub {
26
35struct ShmParams {
36 // cppcheck-suppress-begin unusedStructMember
37
38 std::string topic_name;
39 size_t capacity;
40 std::optional<numapp::MemPolicy> mem_policy;
41
42 // cppcheck-suppress-end unusedStructMember
43};
44
59 std::chrono::milliseconds close_detach_delay = std::chrono::milliseconds(0);
60 std::chrono::milliseconds correlator_poll_timeout = std::chrono::milliseconds(100);
61 std::chrono::milliseconds monitor_report_interval = std::chrono::milliseconds(500);
62 std::optional<numapp::NumaPolicies> processing_thread_policies = std::nullopt;
63 std::optional<numapp::NumaPolicies> monitoring_thread_policies = std::nullopt;
64};
65
73public:
74 virtual ~OperationalLogicIf() = default;
75
79 struct LastError {
83 std::optional<CorrelationError> correlation;
88 };
89
97 virtual void RunAsync() noexcept = 0;
98
104 virtual void IdleAsync() noexcept = 0;
105
111 virtual LastError GetLastError() const noexcept = 0;
112
120 virtual uint64_t GetErrorCount() const noexcept = 0;
121};
122
123} // namespace rtctk::telSub
124
125#endif // RTCKT_TELSUB_OPERATIONALLOGICIF_HPP
Interface to the operational logic implementation.
Definition operationalLogicIf.hpp:72
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:44
Project-wide configuration header.
Declares CorrelatorIf.
Declares DdsWaitSetIf.
Definition main.cpp:23
Declares ShmPublisher.
Describes last errors.
Definition operationalLogicIf.hpp:79
std::optional< CorrelationError > correlation
Error reading and correlating samples from DDS.
Definition operationalLogicIf.hpp:83
ShmPublisherIf::PublisherError publish
Error from user blending function and publishing to SHM.
Definition operationalLogicIf.hpp:87
Configuration parameters needed for operational logic.
Definition operationalLogicIf.hpp:53
std::chrono::milliseconds monitor_report_interval
Definition operationalLogicIf.hpp:61
std::chrono::milliseconds correlator_poll_timeout
Definition operationalLogicIf.hpp:60
std::optional< numapp::NumaPolicies > processing_thread_policies
Definition operationalLogicIf.hpp:62
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:59
std::optional< numapp::NumaPolicies > monitoring_thread_policies
Definition operationalLogicIf.hpp:63
Shared memory configuration parameters.
Definition operationalLogicIf.hpp:35
std::optional< numapp::MemPolicy > mem_policy
Definition operationalLogicIf.hpp:40
std::string topic_name
Definition operationalLogicIf.hpp:38
size_t capacity
Definition operationalLogicIf.hpp:39