Go to the documentation of this file.
11 #ifndef RTCTK_TELSUB_AGNOSTICDATASAMPLES_HPP
12 #define RTCTK_TELSUB_AGNOSTICDATASAMPLES_HPP
17 #include <memory_resource>
18 #include <system_error>
26 using DdsSample = rtctk::componentFramework::AgnosticTopic;
29 using DdsInfoSeq = rtctk::componentFramework::SampleInfoSeq;
49 virtual std::error_code
73 using Alloc = std::pmr::polymorphic_allocator<std::byte>;
93 inline
std::uint8_t
Size() const noexcept {
94 return m_samples.size();
107 assert(idx <
Size());
108 return m_samples[idx];
121 assert(idx <
Size());
122 return m_samples[idx];
136 throw std::out_of_range(
"idx is out of range");
142 inline bool Empty() const noexcept;
147 inline
bool Full() const noexcept;
162 assert(idx <
Size());
163 return {m_samples[idx], m_infos[idx]};
172 inline void Clear(std::uint8_t idx) noexcept;
179 inline void Clear() noexcept;
199 for (std::uint8_t idx = 0u; idx < m_samples.size(); ++idx) {
204 assert(idx <
Size());
205 auto& seq = m_samples[idx];
206 if (seq.has_ownership()) {
211 (void)m_loaner.
ReturnLoan(idx, seq, m_infos[idx]);
216 for (std::uint8_t idx = 0u; idx <
Size(); ++idx) {
217 if (m_samples[idx].length() > 0) {
225 for (std::uint8_t idx = 0u; idx <
Size(); ++idx) {
226 if (m_samples[idx].length() == 0) {
234 #endif // #ifndef RTCTK_TELSUB_AGNOSTICDATASAMPLES_HPP
rtctk::componentFramework::AgnosticTopicSeq DdsSampleSeq
Definition: agnosticDataSamples.hpp:27
std::uint8_t Size() const noexcept
Definition: agnosticDataSamples.hpp:93
std::tuple< DdsSampleSeq &, DdsInfoSeq & > GetUpdateRefs(std::uint8_t idx) noexcept
Get references to objects to be updated with new values.
Definition: agnosticDataSamples.hpp:161
Project-wide configuration header.
DdsSampleSeq const & At(std::uint8_t idx) const
Access sample sequence idx with bounds checking.
Definition: agnosticDataSamples.hpp:132
void Clear() noexcept
Return samples if not owned and clear all sequences.
Definition: agnosticDataSamples.hpp:198
DdsSampleSeq & operator[](std::uint8_t idx) noexcept
Access sample sequence at index idx without bounds checking.
Definition: agnosticDataSamples.hpp:120
Loaner interface.
Definition: agnosticDataSamples.hpp:36
AgnosticDataSamples(std::uint8_t size, SeqLoanerIf &loaner, Alloc const &alloc={})
Construct instance with the specified number of topics.
Definition: agnosticDataSamples.cpp:15
bool Empty() const noexcept
Definition: agnosticDataSamples.hpp:215
bool Full() const noexcept
Definition: agnosticDataSamples.hpp:224
~AgnosticDataSamples() noexcept
Definition: agnosticDataSamples.cpp:22
rtctk::componentFramework::AgnosticTopic DdsSample
Definition: agnosticDataSamples.hpp:26
virtual std::error_code ReturnLoan(std::uint8_t idx, DdsSampleSeq &samples, DdsInfoSeq &infos) RTCTK_NOEXCEPT=0
Returns loaned sample sequence.
Definition: mudpiProcessingError.hpp:119
DdsSampleSeq const & operator[](std::uint8_t idx) const noexcept
Access sample sequence at index idx without bounds checking.
Definition: agnosticDataSamples.hpp:106
#define RTCTK_NOEXCEPT
Definition: config.hpp:15
rtctk::componentFramework::SampleInfoSeq DdsInfoSeq
Definition: agnosticDataSamples.hpp:29
Declares common DDS class.
Container of DDS samples and associated sample information.
Definition: agnosticDataSamples.hpp:71
std::pmr::polymorphic_allocator< std::byte > Alloc
Definition: agnosticDataSamples.hpp:73