RTC Toolkit  1.0.0
dataSampleView.hpp
Go to the documentation of this file.
1 
11 #ifndef RTCTK_TELSUB_DATASAMPLEVIEW_HPP
12 #define RTCTK_TELSUB_DATASAMPLEVIEW_HPP
13 #include <cstdint>
14 #include <vector>
15 #include <memory_resource>
16 
17 namespace rtctk::telSub {
18 
25  bool operator==(DataSampleView const& rhs) const noexcept;
26  bool operator!=(DataSampleView const& rhs) const noexcept;
30  double time_stamp;
34  std::uint8_t const* data;
39 };
40 
47  using Alloc = std::pmr::polymorphic_allocator<std::byte>;
48  DataSamplesView(Alloc const& alloc = Alloc()) : sample_id(0u), samples(alloc) {
49  }
53  unsigned long sample_id;
58  std::pmr::vector<DataSampleView> samples;
59 
60  bool operator==(DataSamplesView const& rhs) const noexcept;
61  bool operator!=(DataSamplesView const& rhs) const noexcept;
62 };
63 
64 } // namespace rtctk::telSub
65 
66 #endif // #ifndef RTCTK_TELSUB_DATASAMPLE_HPP
rtctk::telSub::DataSamplesView::Alloc
std::pmr::polymorphic_allocator< std::byte > Alloc
Definition: dataSampleView.hpp:47
rtctk::telSub::DataSamplesView::operator==
bool operator==(DataSamplesView const &rhs) const noexcept
Definition: dataSampleView.cpp:24
rtctk::telSub::DataSampleView::time_stamp
double time_stamp
Time stamp of data sample.
Definition: dataSampleView.hpp:30
rtctk::telSub::DataSampleView
Agnostic data sample non-owning reference type.
Definition: dataSampleView.hpp:24
rtctk::telSub::DataSampleView::operator!=
bool operator!=(DataSampleView const &rhs) const noexcept
Definition: dataSampleView.cpp:20
rtctk::telSub::DataSamplesView::sample_id
unsigned long sample_id
Sample id for all samples in DataSamplesView::samples.
Definition: dataSampleView.hpp:53
rtctk::telSub::DataSamplesView
A set of correlated agnostic non-owning data samples references.
Definition: dataSampleView.hpp:46
rtctk::telSub
Definition: main.cpp:6
rtctk::telSub::DataSamplesView::samples
std::pmr::vector< DataSampleView > samples
Non-owned view of type-agnostic data samples in the same order as topics are specified in configurati...
Definition: dataSampleView.hpp:58
rtctk::telSub::DataSampleView::operator==
bool operator==(DataSampleView const &rhs) const noexcept
Definition: dataSampleView.cpp:16
rtctk::telSub::DataSamplesView::DataSamplesView
DataSamplesView(Alloc const &alloc=Alloc())
Definition: dataSampleView.hpp:48
mudpi::uint32_t
unsigned int uint32_t
Definition: mudpi.h:16
rtctk::telSub::DataSampleView::data
std::uint8_t const * data
Pointer to first byte in data sample payload.
Definition: dataSampleView.hpp:34
rtctk::telSub::DataSamplesView::operator!=
bool operator!=(DataSamplesView const &rhs) const noexcept
Definition: dataSampleView.cpp:28
rtctk::telSub::DataSampleView::size
std::uint32_t size
Number of bytes in data.
Definition: dataSampleView.hpp:38