RTC Toolkit 5.1.0
Loading...
Searching...
No Matches
Public Types | Public Member Functions | List of all members
rtctk::telSub::AgnosticDataSamples Class Reference

Container of DDS samples and associated sample information. More...

#include <rtctk/telSub/agnosticDataSamples.hpp>

Public Types

using Alloc = std::pmr::polymorphic_allocator<std::byte>
 

Public Member Functions

 AgnosticDataSamples (SeqLoanerIf &loaner, size_t topic_count, const Alloc &alloc={})
 Construct instance with the specified number of topics.
 
 ~AgnosticDataSamples () noexcept
 
 AgnosticDataSamples (const AgnosticDataSamples &)=delete
 
AgnosticDataSamplesoperator= (const AgnosticDataSamples &)=delete
 
Accessors
std::uint8_t Size () const noexcept
 
DdsSampleSeqoperator[] (const std::string &topic) noexcept
 Access sample sequence for topic topic, will create it if it does not exist.
 
const DdsSampleSeqAt (const std::string &topic) const
 Access sample sequence for topic.
 
bool Empty () const noexcept
 
bool Full () const noexcept
 

Modifiers

using iterator = decltype(m_samples)::iterator
 
using const_iterator = decltype(m_samples)::const_iterator
 
std::tuple< DdsSampleSeq &, DdsInfoSeq & > GetUpdateRefs (const std::string &topic) noexcept
 Get references to objects to be updated with new values.
 
void Clear (const std::string &topic) noexcept
 Return samples if not owned and clear sequence for topic.
 
void Clear () noexcept
 Return samples if not owned and clear all sequences.
 
iterator begin ()
 
const_iterator cbegin ()
 
iterator end ()
 
const_iterator cend ()
 

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>

◆ const_iterator

◆ iterator

Constructor & Destructor Documentation

◆ AgnosticDataSamples() [1/2]

rtctk::telSub::AgnosticDataSamples::AgnosticDataSamples ( SeqLoanerIf & loaner,
size_t topic_count,
const Alloc & alloc = {} )
inline

Construct instance with the specified number of topics.

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

◆ ~AgnosticDataSamples()

rtctk::telSub::AgnosticDataSamples::~AgnosticDataSamples ( )
inlinenoexcept

◆ AgnosticDataSamples() [2/2]

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

Member Function Documentation

◆ At()

const DdsSampleSeq & rtctk::telSub::AgnosticDataSamples::At ( const std::string & topic) const
inline

Access sample sequence for topic.

Will throw if topic is not known.

Parameters
topicName of the topic for which the sequence should be returned.
Returns
sample sequence for topic.
Exceptions
std::out_of_rangeif topic does not exist.

◆ begin()

iterator rtctk::telSub::AgnosticDataSamples::begin ( )
inline

◆ cbegin()

const_iterator rtctk::telSub::AgnosticDataSamples::cbegin ( )
inline

◆ cend()

const_iterator rtctk::telSub::AgnosticDataSamples::cend ( )
inline

◆ Clear() [1/2]

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

Return samples if not owned and clear all sequences.

Clear all stored samples.

Postcondition
Empty() == true

◆ Clear() [2/2]

void rtctk::telSub::AgnosticDataSamples::Clear ( const std::string & topic)
inlinenoexcept

Return samples if not owned and clear sequence for topic.

Parameters
topicname of the topic for which the sequence should be cleared
Postcondition
Full() == false

◆ Empty()

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

◆ end()

iterator rtctk::telSub::AgnosticDataSamples::end ( )
inline

◆ 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 ( const std::string & topic)
inlinenoexcept

Get references to objects to be updated with new values.

Parameters
topicThe topic for which the sequence should be returned
Returns
References to objects to be set by caller.

◆ operator=()

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

◆ operator[]()

DdsSampleSeq & rtctk::telSub::AgnosticDataSamples::operator[] ( const std::string & topic)
inlinenoexcept

Access sample sequence for topic topic, will create it if it does not exist.

Precondition
topic must be a valid topic name
Parameters
topicName of the topic for which the sequence should be returned.
Returns
sample sequence for topic.

◆ Size()

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

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