RTC Toolkit  2.0.0
operationalLogicIf.hpp
Go to the documentation of this file.
1 
11 #ifndef RTCKT_TELSUB_OPERATIONALLOGICIF_HPP
12 #define RTCKT_TELSUB_OPERATIONALLOGICIF_HPP
13 #include <rtctk/config.hpp>
14 
15 #include <chrono>
16 #include <optional>
17 #include <string>
18 
19 #include <numapp/numapolicies.hpp>
20 
22 
23 namespace rtctk::telSub {
24 
32 struct ShmParams {
33  std::string topic_name;
34  size_t capacity;
35  std::optional<numapp::MemPolicy> mem_policy;
36 };
37 
51  std::chrono::milliseconds close_detach_delay = std::chrono::milliseconds(0);
52  std::chrono::milliseconds correlator_poll_timeout = std::chrono::milliseconds(100);
53  std::chrono::milliseconds monitor_report_interval = std::chrono::milliseconds(500);
54  std::optional<numapp::NumaPolicies> processing_thread_policies = std::nullopt;
55  std::optional<numapp::NumaPolicies> monitoring_thread_policies = std::nullopt;
56 };
57 
58 
65 public:
66  virtual ~OperationalLogicIf() {
67  }
68 
72  struct LastError {
76  std::error_code correlation;
80  std::error_code publish;
81  };
82 
83 
91  virtual void RunAsync() RTCTK_NOEXCEPT = 0;
92 
98  virtual void IdleAsync() RTCTK_NOEXCEPT = 0;
99 
105  virtual LastError GetLastError() const RTCTK_NOEXCEPT = 0;
106 
114  virtual uint64_t GetErrorCount() const RTCTK_NOEXCEPT = 0;
115 };
116 
117 } // namespace rtctk::telSub
118 #endif // #ifndef RTCKT_TELSUB_OPERATIONALLOGICIF_HPP
rtctk::telSub::ShmParams::mem_policy
std::optional< numapp::MemPolicy > mem_policy
Definition: operationalLogicIf.hpp:35
rtctk::telSub::OperationalParams::correlator_poll_timeout
std::chrono::milliseconds correlator_poll_timeout
Definition: operationalLogicIf.hpp:52
config.hpp
Project-wide configuration header.
rtctk::telSub::OperationalLogicIf::~OperationalLogicIf
virtual ~OperationalLogicIf()
Definition: operationalLogicIf.hpp:66
rtctk::telSub::OperationalLogicIf::RunAsync
virtual void RunAsync() RTCTK_NOEXCEPT=0
Start publishing.
rtctk::telSub::OperationalParams::monitor_report_interval
std::chrono::milliseconds monitor_report_interval
Definition: operationalLogicIf.hpp:53
rtctk::telSub::OperationalLogicIf
Interface to the operational logic implementation.
Definition: operationalLogicIf.hpp:64
rtctk::telSub::OperationalLogicIf::IdleAsync
virtual void IdleAsync() RTCTK_NOEXCEPT=0
Stop publishing.
rtctk::telSub::OperationalLogicIf::LastError::publish
std::error_code publish
Error from user blending function and publishing to SHM.
Definition: operationalLogicIf.hpp:80
ddsWaitSetIf.hpp
Declares DdsWaitSetIf.
rtctk::telSub::OperationalParams::monitoring_thread_policies
std::optional< numapp::NumaPolicies > monitoring_thread_policies
Definition: operationalLogicIf.hpp:55
rtctk::telSub::OperationalLogicIf::GetErrorCount
virtual uint64_t GetErrorCount() const RTCTK_NOEXCEPT=0
Get current error count.
rtctk::telSub::OperationalLogicIf::LastError
Describes last errors.
Definition: operationalLogicIf.hpp:72
rtctk::telSub::ShmParams
Shared memory configuration parameters.
Definition: operationalLogicIf.hpp:32
rtctk::telSub
Definition: main.cpp:6
rtctk::telSub::OperationalLogicIf::LastError::correlation
std::error_code correlation
Error reading and correlating samples from DDS.
Definition: operationalLogicIf.hpp:76
rtctk::telSub::OperationalParams
Configuration parameters needed for operational logic.
Definition: operationalLogicIf.hpp:45
rtctk::telSub::ShmParams::capacity
size_t capacity
Definition: operationalLogicIf.hpp:34
rtctk::telSub::ShmParams::topic_name
std::string topic_name
Definition: operationalLogicIf.hpp:33
rtctk::telSub::OperationalLogicIf::GetLastError
virtual LastError GetLastError() const RTCTK_NOEXCEPT=0
Return last recorded error.
RTCTK_NOEXCEPT
#define RTCTK_NOEXCEPT
Definition: config.hpp:15
rtctk::telSub::OperationalParams::processing_thread_policies
std::optional< numapp::NumaPolicies > processing_thread_policies
Definition: operationalLogicIf.hpp:54
rtctk::telSub::OperationalParams::close_detach_delay
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:51