RTC Toolkit
2.0.0
|
Container of DDS samples and associated sample information. More...
#include <agnosticDataSamples.hpp>
Public Types | |
using | Alloc = std::pmr::polymorphic_allocator< std::byte > |
Public Member Functions | |
AgnosticDataSamples (std::uint8_t size, SeqLoanerIf &loaner, Alloc const &alloc={}) | |
Construct instance with the specified number of topics. More... | |
~AgnosticDataSamples () noexcept | |
AgnosticDataSamples (AgnosticDataSamples const &)=delete | |
AgnosticDataSamples & | operator= (AgnosticDataSamples const &)=delete |
Accessors | |
std::uint8_t | Size () const noexcept |
DdsSampleSeq const & | operator[] (std::uint8_t idx) const noexcept |
Access sample sequence at index idx without bounds checking. More... | |
DdsSampleSeq & | operator[] (std::uint8_t idx) noexcept |
Access sample sequence at index idx without bounds checking. More... | |
DdsSampleSeq const & | At (std::uint8_t idx) const |
Access sample sequence idx with bounds checking. More... | |
bool | Empty () const noexcept |
bool | Full () const noexcept |
Modifiers | |
std::tuple< DdsSampleSeq &, DdsInfoSeq & > | GetUpdateRefs (std::uint8_t idx) noexcept |
Get references to objects to be updated with new values. More... | |
void | Clear (std::uint8_t idx) noexcept |
Return samples if not owned and clear sequence at idx. More... | |
void | Clear () noexcept |
Return samples if not owned and clear all sequences. More... | |
Container of DDS samples and associated sample information.
Container is constructed with a fixed topic capacity which is then managed by the instance. If a sequence is emptied with Clear()
the samples will be returned automatically if loaned.
User must not modify sequence length if samples are borrowed. DDS does not support returning a subset (see note below) so the full sequence must be returned with Clear()
.
According to https://community.rti.com/forum-topic/copy-samples-sequence-java-api the return_loan() must return the same pair of sequences that was provided in take(). I.e. it's not possible to create new (sub-) sequences from the original and return that.
using rtctk::telSub::AgnosticDataSamples::Alloc = std::pmr::polymorphic_allocator<std::byte> |
rtctk::telSub::AgnosticDataSamples::AgnosticDataSamples | ( | std::uint8_t | size, |
SeqLoanerIf & | loaner, | ||
Alloc const & | alloc = {} |
||
) |
Construct instance with the specified number of topics.
size | Number of topics. |
loaner | Class used to returned loaned samples. |
alloc | Allocator to use to allocate the vector of sequences. |
|
noexcept |
|
delete |
|
inline |
Access sample sequence idx with bounds checking.
idx | Index position of the sequence to return. |
std::out_of_range | if idx is out of range. |
|
inlinenoexcept |
Return samples if not owned and clear all sequences.
Empty() == true
|
inlinenoexcept |
Return samples if not owned and clear sequence at idx.
idx | Index of sequence to clear. |
idx < Size()
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
Get references to objects to be updated with new values.
idx | Index position of the sequence to return. |
idx < Size()
|
delete |
|
inlinenoexcept |
Access sample sequence at index idx without bounds checking.
idx | Index position of the sequence to return. |
|
inlinenoexcept |
Access sample sequence at index idx without bounds checking.
idx | Index position of the sequence to return. |
|
inlinenoexcept |