RTC Toolkit 6.0.0
Loading...
Searching...
No Matches
shmPublisherIf.hpp
Go to the documentation of this file.
1
11#ifndef RTCTK_TELSUB_SHMPUBLISHERIF_HPP
12#define RTCTK_TELSUB_SHMPUBLISHERIF_HPP
13#include <numapp/mempolicy.hpp>
14#include <rtctk/config.hpp>
15
17#include <system_error>
18#include <variant>
19
20namespace rtctk::telSub {
21
31public:
32 struct BlenderError {
33 std::error_code code;
34 bool operator==(const BlenderError& r) const {
35 return r.code == code;
36 };
37 };
38 struct ShmError {
39 std::error_code code;
40 bool operator==(const ShmError& r) const {
41 return r.code == code;
42 };
43 };
44 using PublisherError = std::variant<std::monostate, BlenderError, ShmError>;
45 virtual ~ShmPublisherIf() = default;
52 virtual PublisherError Publish(const DataSamplesView& samples) noexcept = 0;
53
59 virtual void CloseQueue() noexcept = 0;
60};
61
62} // namespace rtctk::telSub
63
64#endif // RTCTK_TELSUB_SHMPUBLISHERIF_HPP
Simple interface to class that owns the shared memory queue.
Definition shmPublisherIf.hpp:30
virtual void CloseQueue() noexcept=0
Close shared memory queue.
virtual PublisherError Publish(const DataSamplesView &samples) noexcept=0
Publish correlated data samples to shared memory.
virtual ~ShmPublisherIf()=default
std::variant< std::monostate, BlenderError, ShmError > PublisherError
Definition shmPublisherIf.hpp:44
Project-wide configuration header.
Declares ShmPublisher.
Definition main.cpp:23
A set of correlated agnostic non-owning data samples references.
Definition dataSampleView.hpp:51
Definition shmPublisherIf.hpp:32
std::error_code code
Definition shmPublisherIf.hpp:33
bool operator==(const BlenderError &r) const
Definition shmPublisherIf.hpp:34
Definition shmPublisherIf.hpp:38
std::error_code code
Definition shmPublisherIf.hpp:39
bool operator==(const ShmError &r) const
Definition shmPublisherIf.hpp:40