|
RTC Toolkit 5.1.0
|
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 | |
| AgnosticDataSamples & | operator= (const AgnosticDataSamples &)=delete |
Accessors | |
| std::uint8_t | Size () const noexcept |
| DdsSampleSeq & | operator[] (const std::string &topic) noexcept |
| Access sample sequence for topic topic, will create it if it does not exist. | |
| const DdsSampleSeq & | At (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 () |
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> |
| using rtctk::telSub::AgnosticDataSamples::const_iterator = decltype(m_samples)::const_iterator |
| using rtctk::telSub::AgnosticDataSamples::iterator = decltype(m_samples)::iterator |
|
inline |
Construct instance with the specified number of topics.
| topic_count | Number of topics. |
| loaner | Class used to returned loaned samples. |
| alloc | Allocator to use to allocate the vector of sequences. |
|
inlinenoexcept |
|
delete |
|
inline |
Access sample sequence for topic.
Will throw if topic is not known.
| topic | Name of the topic for which the sequence should be returned. |
| std::out_of_range | if topic does not exist. |
|
inline |
|
inline |
|
inline |
|
inlinenoexcept |
Return samples if not owned and clear all sequences.
Clear all stored samples.
Empty() == true Return samples if not owned and clear sequence for topic.
| topic | name of the topic for which the sequence should be cleared |
Full() == false
|
inlinenoexcept |
|
inline |
|
inlinenoexcept |
|
inlinenoexcept |
Get references to objects to be updated with new values.
| topic | The topic for which the sequence should be returned |
|
delete |
|
inlinenoexcept |
Access sample sequence for topic topic, will create it if it does not exist.
| topic | Name of the topic for which the sequence should be returned. |
|
inlinenoexcept |