RTI Connext Modern C++ API
Version 6.0.0
|
Specifies how long the data written by a dds::pub::DataWriter is considered valid. More...
#include <dds/core/policy/CorePolicy.hpp>
Public Member Functions | |
Lifespan () | |
Creates the default policy with an infinite lifespan. | |
Lifespan (const dds::core::Duration &d) | |
Creates a policy with the specified lifespan duration. | |
Lifespan & | duration (const dds::core::Duration &d) |
Sets the maximum duration for which the data is valid. | |
const dds::core::Duration | duration () const |
Getter (see setter with the same name) | |
Specifies how long the data written by a dds::pub::DataWriter is considered valid.
Each data sample written by the dds::pub::DataWriter has an associated expiration time beyond which the data should not be delivered to any application. Once the sample expires, the data will be removed from the dds::sub::DataReader caches as well as from the transient and persistent information caches.
The expiration time of each sample from the dds::pub::DataWriter's cache is computed by adding the duration specified by this QoS policy to the time when the sample is added to the dds::pub::DataWriter's cache. This timestamp is not necessarily equal to the sample's source timestamp that can be provided by the user using the dds::pub::DataWriter::write(const T&,const dds::core::Time&) or dds::pub::DataWriter::write(const T&,rti::pub::WriteParams&) API.
The expiration time of each sample from the dds::sub::DataReader's cache is computed by adding the duration to the reception timestamp.
The Lifespan QoS policy can be used to control how much data is stored by RTI Connext. Even if it is configured to store "all" of the data sent or received for a topic (see dds::core::policy::History), the total amount of data it stores may be limited by this QoS policy.
You may also use this QoS policy to ensure that applications do not receive or act on data, commands or messages that are too old and have 'expired.'
To avoid inconsistencies, multiple writers of the same instance should have the same lifespan.
|
inline |
Creates the default policy with an infinite lifespan.
|
inlineexplicit |
Creates a policy with the specified lifespan duration.
|
inline |
Sets the maximum duration for which the data is valid.
[default] dds::core::Duration::infinite()
[range] [1 nanosec, 1 year] or dds::core::Duration::infinite()
|
inline |
Getter (see setter with the same name)