|
RTC Toolkit 5.1.0
|
Base class abstracting DDS communication code. More...
#include <rtctk/telSub/ddsWaitSetIf.hpp>
Public Member Functions | |
| DdsWaitSetIf () RTCTK_NOEXCEPT | |
| virtual | ~DdsWaitSetIf () RTCTK_NOEXCEPT |
| virtual AgnosticDataSamples & | GetSamples () RTCTK_NOEXCEPT=0 |
| Returns reference to data structure holding taken data samples. | |
| virtual std::optional< DdsWaitSetError > | Take (std::chrono::nanoseconds timeout) RTCTK_NOEXCEPT=0 |
| Takes new samples from DDS readers and updates data structure accessable from GetSamples() | |
| virtual size_t | GetNumberOfTopics () const RTCTK_NOEXCEPT=0 |
| Returns the number of configured topics. | |
| virtual void | CheckDdsConnections ()=0 |
Base class abstracting DDS communication code.
|
inline |
|
inlinevirtual |
Implemented in rtctk::telSub::FakeDdsSubscriber, and rtctk::telSub::DdsWaitSet.
Returns the number of configured topics.
This returns the number of topics that were configured during construction of the subscriber object. This corresponds to the size of the DdsParams::m_topics vector passed to the constructor.
Implemented in rtctk::telSub::FakeDdsSubscriber, and rtctk::telSub::DdsWaitSet.
|
pure virtual |
Returns reference to data structure holding taken data samples.
To update structure with new samples TakeSamples() must be used.
Implemented in rtctk::telSub::FakeDdsSubscriber, and rtctk::telSub::DdsWaitSet.
|
pure virtual |
Takes new samples from DDS readers and updates data structure accessable from GetSamples()
The method waits for new DDS samples to become available on one or more of the DDS topic readers as needed to fill up AgnosticDataSamples from GetSamples() with a non-empty sample sequence for each topic.
An empty / zero error code is returned if the operation completed successfully, meaning at least one non-empty sample sequence was taken.
If no samples were available within the timeout period then a std::errc::timed_out error code is returned. If some other error occurred, an appropriate error code is returned.
It is expected that the caller processes the samples and when done with them calls AgnosticAgnosticDataSamples::Clear() to return the samples to DDS. It is not required that all sample sequences are cleared at the same time.
| [in] | timeout | The maximum amount of time to wait for this operation to complete, measured in nanoseconds. |
The following is the list of possible error codes returned:
0 std::errc::timed_out std::errc::protocol_error std::errc::bad_address Implemented in rtctk::telSub::FakeDdsSubscriber, and rtctk::telSub::DdsWaitSet.