CoreDX DDS Modern C++ API
|
Type specific DataWriter. More...
Public Member Functions | |
DataWriter (const dds::pub::Publisher &pub, const dds::topic::Topic< T > &topic) | |
Create a DataWriter . More... | |
DataWriter (const dds::pub::Publisher &pub, const dds::topic::Topic< T > &topic, const dds::pub::qos::DataWriterQos &qos, dds::pub::DataWriterListener< T > *listener=NULL, const dds::core::status::StatusMask &mask=dds::core::status::StatusMask::none()) | |
Create a DataWriter . More... | |
void | write (const T &sample) |
Write a sample. More... | |
void | write (const T &sample, const dds::core::Time ×tamp) |
Write a sample with a given timestamp. More... | |
void | write (const T &data, const dds::core::InstanceHandle &instance) |
Write a sample by providing the instance handle. More... | |
void | write (const T &data, const dds::core::InstanceHandle &instance, const dds::core::Time ×tamp) |
Write a sample, with a time-stamp, by providing the instance handle. More... | |
void | write (const dds::topic::TopicInstance< T > &i) |
Write a topic instance – a class that encapsulate the sample and its associated instance handle. More... | |
void | write (const dds::topic::TopicInstance< T > &i, const dds::core::Time ×tamp) |
Write a topic instance with time stamp. More... | |
template<typename FWIterator > | |
void | write (const FWIterator &begin, const FWIterator &end) |
Write a series of samples or TopicInstances (determined by the template specialization). | |
template<typename FWIterator > | |
void | write (const FWIterator &begin, const FWIterator &end, const dds::core::Time ×tamp) |
Write a series of samples or TopicInstances (determined by the template specialization) with timestamp. | |
template<typename SamplesFWIterator , typename HandlesFWIterator > | |
void | write (const SamplesFWIterator &data_begin, const SamplesFWIterator &data_end, const HandlesFWIterator &handle_begin, const HandlesFWIterator &handle_end) |
Write a series of samples and their parallel instance handles. | |
template<typename SamplesFWIterator , typename HandlesFWIterator > | |
void | write (const SamplesFWIterator &data_begin, const SamplesFWIterator &data_end, const HandlesFWIterator &handle_begin, const HandlesFWIterator &handle_end, const dds::core::Time ×tamp) |
Write a series of samples and their parallel instance handles with a timestamp. | |
const dds::core::InstanceHandle | register_instance (const T &key) |
Register an instance. More... | |
const dds::core::InstanceHandle | register_instance (const T &key, const dds::core::Time &ts) |
Register an instance with timestamp. More... | |
DataWriter & | unregister_instance (const dds::core::InstanceHandle &i) |
Unregister an instance. More... | |
DataWriter & | unregister_instance (const dds::core::InstanceHandle &i, const dds::core::Time &ts) |
Unregister an instance with timestamp. More... | |
DataWriter & | dispose_instance (const dds::core::InstanceHandle &i) |
Dispose an instance. More... | |
DataWriter & | dispose_instance (const dds::core::InstanceHandle &i, const dds::core::Time &ts) |
Dispose an instance with a timestamp. More... | |
dds::topic::TopicInstance< T > & | key_value (dds::topic::TopicInstance< T > &i, const dds::core::InstanceHandle &h) |
This operation can be used to retrieve the instance key that corresponds to an instance_handle. More... | |
T & | key_value (T &sample, const dds::core::InstanceHandle &h) |
This operation can be used to retrieve the instance key that corresponds to an instance_handle. More... | |
dds::core::InstanceHandle | lookup_instance (const T &key) |
This operation takes as a parameter an instance and returns a handle that can be used in subsequent operations that accept an instance handle as an argument. More... | |
DataWriter & | operator<< (const dds::pub::qos::DataWriterQos &qos) |
This operation replaces the existing set of QosPolicy settings for a DataWriter. More... | |
const dds::topic::Topic< T > & | topic () const |
Get the Topic associated with this DataWriter | |
void | listener (DataWriterListener< T > *the_listener, const dds::core::status::StatusMask &mask) |
By virtue of extending Entity, a DataWriter can be attached to a Listener at creation time or later by using the listener operation. More... | |
DataWriterListener< T > * | listener () const |
Return the listener currently associated with this DataWriter . More... | |
Public Member Functions inherited from dds::pub::AnyDataWriter | |
const dds::pub::Publisher & | publisher () const |
Get the Publisher that owns this DataWriter. More... | |
const dds::topic::TopicDescription & | topic_description () const |
Get the TopicDescription associated with this DataWriter. More... | |
dds::pub::qos::DataWriterQos | qos () const |
Gets the DataWriterQos setting for this instance. More... | |
void | qos (const dds::pub::qos::DataWriterQos &qos) |
This operation replaces the existing set of QosPolicy settings for a DataWriter. More... | |
AnyDataWriter & | operator<< (const dds::pub::qos::DataWriterQos &qos) |
This operation replaces the existing set of QosPolicy settings for a DataWriter. More... | |
const AnyDataWriter & | operator>> (dds::pub::qos::DataWriterQos &qos) const |
Gets the DataWriterQos setting for this instance. More... | |
void | wait_for_acknowledgments (const dds::core::Duration &timeout) |
This operation blocks the calling thread until either all data written by the DataWriter is acknowledged by the local infrastructure, or until the duration specified by the timeout parameter elapses, whichever happens first. More... | |
const dds::core::status::LivelinessLostStatus | liveliness_lost_status () |
This operation obtains the LivelinessLostStatus object of the DataWriter. More... | |
const dds::core::status::OfferedDeadlineMissedStatus | offered_deadline_missed_status () |
This operation obtains the OfferedDeadlineMissedStatus object of the DataWriter. More... | |
const dds::core::status::OfferedIncompatibleQosStatus | offered_incompatible_qos_status () |
This operation obtains the OfferedIncompatibleQosStatus object of the DataWriter. More... | |
const dds::core::status::PublicationMatchedStatus | publication_matched_status () |
This operation obtains the PublicationMatchedStatus object of the DataWriter. More... | |
void | assert_liveliness () |
This operation asserts the liveliness for the DataWriter. More... | |
Type specific DataWriter.
dds::pub::DataWriter< T, DELEGATE >::DataWriter | ( | const dds::pub::Publisher & | pub, |
const dds::topic::Topic< T > & | topic | ||
) |
Create a DataWriter
.
The QoS will be set to pub.default_datawriter_qos().
pub | the publisher |
topic | the Topic associated with this DataWriter |
dds::pub::DataWriter< T, DELEGATE >::DataWriter | ( | const dds::pub::Publisher & | pub, |
const dds::topic::Topic< T > & | topic, | ||
const dds::pub::qos::DataWriterQos & | qos, | ||
dds::pub::DataWriterListener< T > * | listener = NULL , |
||
const dds::core::status::StatusMask & | mask = dds::core::status::StatusMask::none() |
||
) |
Create a DataWriter
.
pub | the publisher |
topic | the Topic associated with this DataWriter |
qos | the DataWriter qos. |
listener | the DataWriter listener. |
mask | the listener event mask. |
DataWriter< T, DELEGATE > & dds::pub::DataWriter< T, DELEGATE >::dispose_instance | ( | const dds::core::InstanceHandle & | i | ) |
Dispose an instance.
i | the instance to dispose. |
DataWriter< T, DELEGATE > & dds::pub::DataWriter< T, DELEGATE >::dispose_instance | ( | const dds::core::InstanceHandle & | i, |
const dds::core::Time & | ts | ||
) |
Dispose an instance with a timestamp.
i | the instance to dispose. |
ts | the timestamp. |
dds::topic::TopicInstance< T > & dds::pub::DataWriter< T, DELEGATE >::key_value | ( | dds::topic::TopicInstance< T > & | i, |
const dds::core::InstanceHandle & | h | ||
) |
This operation can be used to retrieve the instance key that corresponds to an instance_handle.
The operation will only fill the fields that form the key inside the key_holder instance. This operation may raise a BadParameter exception if the InstanceHandle does not correspond to an existing data-object known to the DataWriter. If the implementation is not able to check invalid handles, then the result in this situation is unspecified.
T & dds::pub::DataWriter< T, DELEGATE >::key_value | ( | T & | sample, |
const dds::core::InstanceHandle & | h | ||
) |
This operation can be used to retrieve the instance key that corresponds to an instance_handle.
The operation will only fill the fields that form the key inside the key_holder instance. This operation may raise a BadParameter exception if the InstanceHandle does not correspond to an existing data-object known to the DataWriter. If the implementation is not able to check invalid handles, then the result in this situation is unspecified.
void dds::pub::DataWriter< T, DELEGATE >::listener | ( | DataWriterListener< T > * | the_listener, |
const dds::core::status::StatusMask & | mask | ||
) |
By virtue of extending Entity, a DataWriter can be attached to a Listener at creation time or later by using the listener operation.
The attached Listener must be a DataWriterListener.
the_listener | the data writer listener |
mask | the event mask associated with this listener. |
DataWriterListener< T > * dds::pub::DataWriter< T, DELEGATE >::listener | ( | ) | const |
Return the listener currently associated with this DataWriter
.
DataWriterListener
. dds::core::InstanceHandle dds::pub::DataWriter< T, DELEGATE >::lookup_instance | ( | const T & | key | ) |
This operation takes as a parameter an instance and returns a handle that can be used in subsequent operations that accept an instance handle as an argument.
The instance parameter is only used for the purpose of examining the fields that define the key. This operation does not register the instance in question. If the instance has not been previously registered, or if for any other reason the Service is unable to provide an instance handle, the Service will return a TopicInstance whose handle will be set to the HANDLE_NIL value.
DataWriter< T, DELEGATE > & dds::pub::DataWriter< T, DELEGATE >::operator<< | ( | const dds::pub::qos::DataWriterQos & | qos | ) |
This operation replaces the existing set of QosPolicy settings for a DataWriter.
The parameter qos contains the object with the QosPolicy settings which is checked for self-consistency and mutability.
When the application tries to change a QosPolicy setting for an enabled DataWriter, which can only be set before the DataWriter is enabled, the operation will fail and a ImmutablePolicyError is thrown. In other words, the application must provide the presently set QosPolicy settings in case of the immutable QosPolicy settings. Only the mutable QosPolicy settings can be changed.
When the qos contains conflicting QosPolicy settings (not self-consistent), the operation will fail and an InconsistentPolicyError is thrown.
qos | the qos |
dds::core::Error | An internal error has occurred. |
dds::core::NullReferenceError | The entity was not properly created and references to dds::core::null. |
dds::core::AlreadyClosedError | The entity has already been closed. |
dds::core::OutOfResourcesError | The Data Distribution Service ran out of resources to complete this operation. |
dds::core::ImmutablePolicyError | The parameter qos contains an immutable QosPolicy setting with a different value than set during enabling of the DataWriter. |
dds::core::InconsistentPolicyError | The parameter qos contains conflicting QosPolicy settings, |
const dds::core::InstanceHandle dds::pub::DataWriter< T, DELEGATE >::register_instance | ( | const T & | key | ) |
Register an instance.
key | the key of the instance to register. |
const dds::core::InstanceHandle dds::pub::DataWriter< T, DELEGATE >::register_instance | ( | const T & | key, |
const dds::core::Time & | ts | ||
) |
Register an instance with timestamp.
key | the key of the instance to register. |
ts | the timestamp used for registration. |
DataWriter< T, DELEGATE > & dds::pub::DataWriter< T, DELEGATE >::unregister_instance | ( | const dds::core::InstanceHandle & | i | ) |
Unregister an instance.
i | the instance to unregister. |
DataWriter< T, DELEGATE > & dds::pub::DataWriter< T, DELEGATE >::unregister_instance | ( | const dds::core::InstanceHandle & | i, |
const dds::core::Time & | ts | ||
) |
Unregister an instance with timestamp.
i | the instance to unregister. |
ts | the timestamp used for registration. |
void dds::pub::DataWriter< T, DELEGATE >::write | ( | const T & | sample | ) |
Write a sample.
sample | the sample to be written. |
void dds::pub::DataWriter< T, DELEGATE >::write | ( | const T & | sample, |
const dds::core::Time & | timestamp | ||
) |
Write a sample with a given timestamp.
sample | the sample to be written. |
timestamp | the timestamp used for this sample. |
void dds::pub::DataWriter< T, DELEGATE >::write | ( | const T & | data, |
const dds::core::InstanceHandle & | instance | ||
) |
Write a sample by providing the instance handle.
This is usually the most efficint way of writing a sample.
data | the sample to be written. |
instance | the handle representing the instance written. |
void dds::pub::DataWriter< T, DELEGATE >::write | ( | const T & | data, |
const dds::core::InstanceHandle & | instance, | ||
const dds::core::Time & | timestamp | ||
) |
Write a sample, with a time-stamp, by providing the instance handle.
This is usually the most efficient way of writing a sample.
data | the sample to be written. |
instance | the handle representing the instance written. |
timestamp | the timestamp to use for this sample. |
void dds::pub::DataWriter< T, DELEGATE >::write | ( | const dds::topic::TopicInstance< T > & | i | ) |
Write a topic instance – a class that encapsulate the sample and its associated instance handle.
i | the instance to write. |
void dds::pub::DataWriter< T, DELEGATE >::write | ( | const dds::topic::TopicInstance< T > & | i, |
const dds::core::Time & | timestamp | ||
) |
Write a topic instance with time stamp.
i | the instance to write. |
timestamp | the timestamp for this sample. |