DDS-PSM-C++  1.0
ISO C++ API for OpenSplice DDS
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
Public Types | Public Member Functions | List of all members
dds::pub::DataWriter< T, DELEGATE > Class Template Reference

#include <DataWriter.hpp>

Inheritance diagram for dds::pub::DataWriter< T, DELEGATE >:
Inheritance graph
[legend]

Public Types

typedef
dds::pub::DataWriterListener
< T > 
Listener
 

Public Member Functions

 DataWriter (const dds::pub::Publisher &pub, const ::dds::topic::Topic< T > &topic)
 
 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::all())
 
 ~DataWriter ()
 
void assert_liveliness ()
 
DataWriterdispose_instance (const ::dds::core::InstanceHandle &i)
 
DataWriterdispose_instance (const ::dds::core::InstanceHandle &i, const dds::core::Time &ts)
 
dds::topic::TopicInstance< T > & key_value (dds::topic::TopicInstance< T > &i, const ::dds::core::InstanceHandle &h)
 
T & key_value (T &sample, const ::dds::core::InstanceHandle &h)
 
void listener (DataWriterListener< T > *the_listener, const ::dds::core::status::StatusMask &mask)
 
DataWriterListener< T > * listener () const
 
const
::dds::core::status::LivelinessLostStatus 
liveliness_lost_status ()
 
dds::core::InstanceHandle lookup_instance (const T &key)
 
const
::dds::core::status::OfferedDeadlineMissedStatus 
offered_deadlined_missed_status ()
 
const
::dds::core::status::OfferedIncompatibleQosStatus 
offered_incompatible_qos_staus ()
 
DataWriteroperator<< (const T &data)
 
DataWriteroperator<< (const std::pair< T, dds::core::Time > &data)
 
DataWriteroperator<< (const std::pair< T,::dds::core::InstanceHandle > &data)
 
DataWriteroperator<< (DataWriter &(*manipulator)(DataWriter &))
 
DataWriteroperator<< (const ::dds::pub::qos::DataWriterQos &the_qos)
 
const DataWriteroperator>> (::dds::pub::qos::DataWriterQos &the_qos) const
 
const
::dds::core::status::PublicationMatchedStatus 
publication_matched_status ()
 
const dds::pub::Publisherpublisher () const
 
const
::dds::pub::qos::DataWriterQos
qos () const
 
void qos (const ::dds::pub::qos::DataWriterQos &the_qos)
 
const ::dds::core::InstanceHandle register_instance (const T &key)
 
const ::dds::core::InstanceHandle register_instance (const T &key, const dds::core::Time &ts)
 
const dds::topic::Topic< T > & topic () const
 
DataWriterunregister_instance (const ::dds::core::InstanceHandle &i)
 
DataWriterunregister_instance (const ::dds::core::InstanceHandle &i, const dds::core::Time &ts)
 
void wait_for_acknowledgments (const dds::core::Duration &timeout)
 
void write (const T &sample)
 
void write (const T &sample, const dds::core::Time &timestamp)
 
void write (const T &data, const ::dds::core::InstanceHandle &instance)
 
void write (const T &data, const ::dds::core::InstanceHandle &instance, const dds::core::Time &timestamp)
 
void write (const dds::topic::TopicInstance< T > &i)
 
void write (const dds::topic::TopicInstance< T > &i, const dds::core::Time &timestamp)
 
template<typename FWIterator >
void write (const FWIterator &begin, const FWIterator &end)
 
template<typename FWIterator >
void write (const FWIterator &begin, const FWIterator &end, const dds::core::Time &timestamp)
 
template<typename SamplesFWIterator , typename HandlesFWIterator >
void write (const SamplesFWIterator &data_begin, const SamplesFWIterator &data_end, const HandlesFWIterator &handle_begin, const HandlesFWIterator &handle_end)
 
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 &timestamp)
 
- Public Member Functions inherited from dds::core::TEntity< DELEGATE< T > >
 ~TEntity ()
 
void close ()
 
void enable ()
 
const dds::core::InstanceHandle instance_handle () const
 
void retain ()
 
const dds::core::status::StatusMask status_changes ()
 
- Public Member Functions inherited from dds::core::Reference< DELEGATE< T > >
 Reference (dds::core::null_type &)
 
 Reference (const Reference &ref)
 
 Reference (const Reference< D > &ref)
 
 Reference (DELEGATE_T *p)
 
 ~Reference ()
 
const DELEGATE_REF_T & delegate () const
 
DELEGATE_REF_T & delegate ()
 
bool is_nil () const
 
 operator const DELEGATE_REF_T & () const
 
 operator DELEGATE_REF_T () const
 
 operator DELEGATE_REF_T & ()
 
bool operator!= (const R &ref) const
 
bool operator!= (const null_type nil) const
 
DELEGATE< T > * operator-> ()
 
const DELEGATE< T > * operator-> () const
 
Referenceoperator= (const Reference< D > &that)
 
Referenceoperator= (const R &rhs)
 
Referenceoperator= (const null_type)
 
bool operator== (const R &ref) const
 
bool operator== (const null_type) const
 

Additional Inherited Members

- Protected Attributes inherited from dds::core::Reference< DELEGATE< T > >
DELEGATE_REF_T impl_
 

Detailed Description

template<typename T, template< typename Q > class DELEGATE>
class dds::pub::DataWriter< T, DELEGATE >

Definition at line 41 of file DataWriter.hpp.

Member Typedef Documentation

template<typename T, template< typename Q > class DELEGATE>
typedef dds::pub::DataWriterListener<T> dds::pub::DataWriter< T, DELEGATE >::Listener

Definition at line 44 of file DataWriter.hpp.

Constructor & Destructor Documentation

template<typename T, template< typename Q > class DELEGATE>
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().

Parameters
pubthe publisher
topicthe Topic associated with this DataWriter
qosthe DataWriter qos.
listenerthe DataWriter listener.
maskthe listener event mask.
template<typename T, template< typename Q > class DELEGATE>
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::all() 
)

Create a DataWriter.

Parameters
pubthe publisher
topicthe Topic associated with this DataWriter
qosthe DataWriter qos.
listenerthe DataWriter listener.
maskthe listener event mask.
template<typename T, template< typename Q > class DELEGATE>
dds::pub::DataWriter< T, DELEGATE >::~DataWriter ( )

Member Function Documentation

template<typename T, template< typename Q > class DELEGATE>
void dds::pub::DataWriter< T, DELEGATE >::assert_liveliness ( )

Mannually asserts the livelines of this DataWriter

template<typename T, template< typename Q > class DELEGATE>
DataWriter& dds::pub::DataWriter< T, DELEGATE >::dispose_instance ( const ::dds::core::InstanceHandle i)

Dispose an instance.

Parameters
ithe instance to dispose.
template<typename T, template< typename Q > class DELEGATE>
DataWriter& dds::pub::DataWriter< T, DELEGATE >::dispose_instance ( const ::dds::core::InstanceHandle i,
const dds::core::Time ts 
)

Dispose an instance with a timestamp.

Parameters
ithe instance to dispose.
tsthe timestamp.
template<typename T, template< typename Q > class DELEGATE>
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.

template<typename T, template< typename Q > class DELEGATE>
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.

template<typename T, template< typename Q > class DELEGATE>
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.

Parameters
listenerthe data writer listener
maskthe event mask associated with this listener.
template<typename T, template< typename Q > class DELEGATE>
DataWriterListener<T>* dds::pub::DataWriter< T, DELEGATE >::listener ( ) const

Return the listener currently associated with this DataWriter.

Returns
the DataWriterListener.
template<typename T, template< typename Q > class DELEGATE>
const ::dds::core::status::LivelinessLostStatus dds::pub::DataWriter< T, DELEGATE >::liveliness_lost_status ( )

Get the LivelinessLostStatus.

template<typename T, template< typename Q > class DELEGATE>
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.

template<typename T, template< typename Q > class DELEGATE>
const ::dds::core::status::OfferedDeadlineMissedStatus dds::pub::DataWriter< T, DELEGATE >::offered_deadlined_missed_status ( )

Get the OfferedDeadlineMissedStatus.

template<typename T, template< typename Q > class DELEGATE>
const ::dds::core::status::OfferedIncompatibleQosStatus dds::pub::DataWriter< T, DELEGATE >::offered_incompatible_qos_staus ( )

Get the OfferedIncompatibleQosStatus.

template<typename T, template< typename Q > class DELEGATE>
DataWriter& dds::pub::DataWriter< T, DELEGATE >::operator<< ( const T &  data)
template<typename T, template< typename Q > class DELEGATE>
DataWriter& dds::pub::DataWriter< T, DELEGATE >::operator<< ( const std::pair< T, dds::core::Time > &  data)
template<typename T, template< typename Q > class DELEGATE>
DataWriter& dds::pub::DataWriter< T, DELEGATE >::operator<< ( const std::pair< T,::dds::core::InstanceHandle > &  data)
template<typename T, template< typename Q > class DELEGATE>
DataWriter& dds::pub::DataWriter< T, DELEGATE >::operator<< ( DataWriter< T, DELEGATE > &(*)(DataWriter< T, DELEGATE > &)  manipulator)
template<typename T, template< typename Q > class DELEGATE>
DataWriter& dds::pub::DataWriter< T, DELEGATE >::operator<< ( const ::dds::pub::qos::DataWriterQos the_qos)

Get the DataWriter QoS.

template<typename T, template< typename Q > class DELEGATE>
const DataWriter& dds::pub::DataWriter< T, DELEGATE >::operator>> ( ::dds::pub::qos::DataWriterQos the_qos) const

Set the DataWriter QoS.

Parameters
the_qosthe new qos for this DataWriter.
template<typename T, template< typename Q > class DELEGATE>
const ::dds::core::status::PublicationMatchedStatus dds::pub::DataWriter< T, DELEGATE >::publication_matched_status ( )

Get the PublicationMatchedStatus.

template<typename T, template< typename Q > class DELEGATE>
const dds::pub::Publisher& dds::pub::DataWriter< T, DELEGATE >::publisher ( ) const

Get the Publisher that owns this DataWriter.

template<typename T, template< typename Q > class DELEGATE>
const ::dds::pub::qos::DataWriterQos& dds::pub::DataWriter< T, DELEGATE >::qos ( ) const

Get the DataWriter QoS.

template<typename T, template< typename Q > class DELEGATE>
void dds::pub::DataWriter< T, DELEGATE >::qos ( const ::dds::pub::qos::DataWriterQos the_qos)

Set the DataWriter QoS.

Parameters
the_qosthe new qos for this DataWriter.
template<typename T, template< typename Q > class DELEGATE>
const ::dds::core::InstanceHandle dds::pub::DataWriter< T, DELEGATE >::register_instance ( const T &  key)

Register an instance.

Parameters
keythe key of the instance to register.
template<typename T, template< typename Q > class DELEGATE>
const ::dds::core::InstanceHandle dds::pub::DataWriter< T, DELEGATE >::register_instance ( const T &  key,
const dds::core::Time ts 
)

Register an instance with timestamp.

Parameters
keythe key of the instance to register.
timestampthe timestamp used for registration.
template<typename T, template< typename Q > class DELEGATE>
const dds::topic::Topic<T>& dds::pub::DataWriter< T, DELEGATE >::topic ( ) const

Get the Topic associated with this DataWriter

template<typename T, template< typename Q > class DELEGATE>
DataWriter& dds::pub::DataWriter< T, DELEGATE >::unregister_instance ( const ::dds::core::InstanceHandle i)

Unregister an instance.

Parameters
ithe instance to unregister.
template<typename T, template< typename Q > class DELEGATE>
DataWriter& dds::pub::DataWriter< T, DELEGATE >::unregister_instance ( const ::dds::core::InstanceHandle i,
const dds::core::Time ts 
)

Unregister an instance with timestamp.

Parameters
ithe instance to unregister.
timestampthe timestamp used for registration.
template<typename T, template< typename Q > class DELEGATE>
void dds::pub::DataWriter< T, DELEGATE >::wait_for_acknowledgments ( const dds::core::Duration timeout)

This operation blocks the calling thread until either all data written by the reliable DataWriter entities is acknowledged by all matched reliable DataReader entities, or else the duration specified by the max_wait parameter elapses, whichever happens first. A normal return indicates that all the samples written have been acknowledged by all reliable matched data readers; A TimeoutError indicates that max_wait elapsed before all the data was acknowledged.

template<typename T, template< typename Q > class DELEGATE>
void dds::pub::DataWriter< T, DELEGATE >::write ( const T &  sample)

Write a sample.

Parameters
samplethe sample to be written.
template<typename T, template< typename Q > class DELEGATE>
void dds::pub::DataWriter< T, DELEGATE >::write ( const T &  sample,
const dds::core::Time timestamp 
)

Write a sample with a given timestamp.

Parameters
samplethe sample to be written.
timestampthe timestamp used for this sample.
template<typename T, template< typename Q > class DELEGATE>
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.

Parameters
samplethe sample to be written.
instancethe handle representing the instance written.
template<typename T, template< typename Q > class DELEGATE>
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.

Parameters
samplethe sample to be written.
instancethe handle representing the instance written.
timestampthe timestamp to use for this sample.
template<typename T, template< typename Q > class DELEGATE>
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.

Parameters
ithe instance to write.
template<typename T, template< typename Q > class DELEGATE>
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.

Parameters
ithe instance to write.
timestampthe timestamp for this sample.
template<typename T, template< typename Q > class DELEGATE>
template<typename FWIterator >
void dds::pub::DataWriter< T, DELEGATE >::write ( const FWIterator &  begin,
const FWIterator &  end 
)

Write a series of samples or TopicInstances (determined by the template specialization).

template<typename T, template< typename Q > class DELEGATE>
template<typename FWIterator >
void dds::pub::DataWriter< T, DELEGATE >::write ( const FWIterator &  begin,
const FWIterator &  end,
const dds::core::Time timestamp 
)

Write a series of samples or TopicInstances (determined by the template specialization) with timestamp.

template<typename T, template< typename Q > class DELEGATE>
template<typename SamplesFWIterator , typename HandlesFWIterator >
void dds::pub::DataWriter< T, DELEGATE >::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 T, template< typename Q > class DELEGATE>
template<typename SamplesFWIterator , typename HandlesFWIterator >
void dds::pub::DataWriter< T, DELEGATE >::write ( const SamplesFWIterator &  data_begin,
const SamplesFWIterator &  data_end,
const HandlesFWIterator &  handle_begin,
const HandlesFWIterator &  handle_end,
const dds::core::Time timestamp 
)

Write a series of samples and their parallel instance handles with a timestamp.


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