RTC Toolkit  1.0.0
Public Types | Public Member Functions | List of all members
rtctk::telSub::AgnosticDataSamples Class Reference

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
 
AgnosticDataSamplesoperator= (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...
 
DdsSampleSeqoperator[] (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...
 

Detailed Description

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().

RTI DDS Note on returning loaned samples

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.

Member Typedef Documentation

◆ Alloc

using rtctk::telSub::AgnosticDataSamples::Alloc = std::pmr::polymorphic_allocator<std::byte>

Constructor & Destructor Documentation

◆ AgnosticDataSamples() [1/2]

rtctk::telSub::AgnosticDataSamples::AgnosticDataSamples ( std::uint8_t  size,
SeqLoanerIf loaner,
Alloc const &  alloc = {} 
)

Construct instance with the specified number of topics.

Parameters
sizeNumber of topics.
loanerClass used to returned loaned samples.
allocAllocator to use to allocate the vector of sequences.

◆ ~AgnosticDataSamples()

rtctk::telSub::AgnosticDataSamples::~AgnosticDataSamples ( )
noexcept

◆ AgnosticDataSamples() [2/2]

rtctk::telSub::AgnosticDataSamples::AgnosticDataSamples ( AgnosticDataSamples const &  )
delete

Member Function Documentation

◆ At()

DdsSampleSeq const& rtctk::telSub::AgnosticDataSamples::At ( std::uint8_t  idx) const
inline

Access sample sequence idx with bounds checking.

Parameters
idxIndex position of the sequence to return.
Returns
sample sequence at idx.
Exceptions
std::out_of_rangeif idx is out of range.

◆ Clear() [1/2]

void rtctk::telSub::AgnosticDataSamples::Clear ( )
inlinenoexcept

Return samples if not owned and clear all sequences.

Postcondition
Empty() == true

◆ Clear() [2/2]

void rtctk::telSub::AgnosticDataSamples::Clear ( std::uint8_t  idx)
inlinenoexcept

Return samples if not owned and clear sequence at idx.

Parameters
idxIndex of sequence to clear.
Precondition
idx < Size()

◆ Empty()

bool rtctk::telSub::AgnosticDataSamples::Empty ( ) const
inlinenoexcept
Returns
true if all sample sequences are empty, otherwise false.

◆ Full()

bool rtctk::telSub::AgnosticDataSamples::Full ( ) const
inlinenoexcept
Returns
true if all sample sequences have data, otherwise false.

◆ GetUpdateRefs()

std::tuple<DdsSampleSeq&, DdsInfoSeq&> rtctk::telSub::AgnosticDataSamples::GetUpdateRefs ( std::uint8_t  idx)
inlinenoexcept

Get references to objects to be updated with new values.

Parameters
idxIndex position of the sequence to return.
Returns
References to objects to be set by caller.
Precondition
idx < Size()

◆ operator=()

AgnosticDataSamples& rtctk::telSub::AgnosticDataSamples::operator= ( AgnosticDataSamples const &  )
delete

◆ operator[]() [1/2]

DdsSampleSeq const& rtctk::telSub::AgnosticDataSamples::operator[] ( std::uint8_t  idx) const
inlinenoexcept

Access sample sequence at index idx without bounds checking.

Precondition
Queue identified by idx must not be empty.
idx < Size()
Parameters
idxIndex position of the sequence to return.
Returns
sample sequence at idx.

◆ operator[]() [2/2]

DdsSampleSeq& rtctk::telSub::AgnosticDataSamples::operator[] ( std::uint8_t  idx)
inlinenoexcept

Access sample sequence at index idx without bounds checking.

Precondition
Queue identified by idx must not be empty.
idx < Size()
Parameters
idxIndex position of the sequence to return.
Returns
sample sequence at idx.

◆ Size()

std::uint8_t rtctk::telSub::AgnosticDataSamples::Size ( ) const
inlinenoexcept
Returns
Number of topics

The documentation for this class was generated from the following files: