Fast RTPS  Version 2.14.1
Fast RTPS
Loading...
Searching...
No Matches

Class Publisher, used to send data to associated subscribers. More...

#include <Publisher.h>

Public Member Functions

 Publisher (PublisherImpl *pimpl)
 Constructor from a PublisherImpl pointer.
 
bool write (void *sample)
 Writes a sample of the topic.
 
bool write (void *sample, rtps::WriteParams &wparams)
 Writes a sample of the topic with additional options.
 
fastrtps::rtps::InstanceHandle_t register_instance (void *instance)
 Informs that the application will be modifying a particular instance.
 
bool dispose (void *data, const rtps::InstanceHandle_t &handle)
 Requests the middleware to delete the instance.
 
bool unregister_instance (void *instance, const rtps::InstanceHandle_t &handle)
 This operation reserves the action of register_instance.
 
bool removeAllChange (size_t *removed=nullptr)
 Remove all the Changes in the associated RTPSWriter.
 
bool wait_for_all_acked (const Duration_t &max_wait)
 Waits until all changes were acknowledged or max_wait.
 
const rtps::GUID_t & getGuid ()
 Get the GUID_t of the associated RTPSWriter.
 
const PublisherAttributesgetAttributes () const
 Get the Attributes of the Publisher.
 
bool updateAttributes (const PublisherAttributes &att)
 Update the Attributes of the publisher.
 
void get_offered_deadline_missed_status (OfferedDeadlineMissedStatus &status)
 Returns the offered deadline missed status.
 
void assert_liveliness ()
 Asserts liveliness.
 
void get_liveliness_lost_status (LivelinessLostStatus &status)
 Returns the liveliness lost status.
 
void get_sending_locators (rtps::LocatorList_t &locators) const
 Get the list of locators from which this publisher may send data.
 

Friends

class PublisherImpl
 

Detailed Description

Class Publisher, used to send data to associated subscribers.

Constructor & Destructor Documentation

◆ Publisher()

Publisher ( PublisherImpl pimpl)

Constructor from a PublisherImpl pointer.

Parameters
pimplActual implementation of the publisher

Member Function Documentation

◆ assert_liveliness()

void assert_liveliness ( )

Asserts liveliness.

◆ dispose()

bool dispose ( void *  data,
const rtps::InstanceHandle_t &  handle 
)

Requests the middleware to delete the instance.

Applications are made aware of the deletion through the DataReader objects.

Parameters
[in]dataSample used to deduce instance's key in case of handle parameter is HANDLE_NIL.
[in]handleInstance's key to be unregistered.
Returns
Returns the operation's result. If the operation finishes successfully, true is returned.

◆ get_liveliness_lost_status()

void get_liveliness_lost_status ( LivelinessLostStatus &  status)

Returns the liveliness lost status.

Parameters
statusLiveliness lost status

◆ get_offered_deadline_missed_status()

void get_offered_deadline_missed_status ( OfferedDeadlineMissedStatus status)

Returns the offered deadline missed status.

Parameters
statusmissed status struct

◆ get_sending_locators()

void get_sending_locators ( rtps::LocatorList_t &  locators) const

Get the list of locators from which this publisher may send data.

Parameters
[out]locatorsLocatorList_t where the list of locators will be stored.

◆ getAttributes()

const PublisherAttributes & getAttributes ( ) const

Get the Attributes of the Publisher.

Returns
Attributes of the publisher

◆ getGuid()

const rtps::GUID_t & getGuid ( )

Get the GUID_t of the associated RTPSWriter.

Returns
GUID_t.

◆ register_instance()

fastrtps::rtps::InstanceHandle_t register_instance ( void *  instance)

Informs that the application will be modifying a particular instance.

It gives and opportunity to the middleware to pre-configure itself to improve performance.

Parameters
[in]instanceSample used to get the instance's key.
Returns
Handle containing the instance's key. This handle could be used in successive write or dispose operations. In case of error, HANDLE_NIL will be returned.

◆ removeAllChange()

bool removeAllChange ( size_t *  removed = nullptr)

Remove all the Changes in the associated RTPSWriter.

Parameters
[out]removedNumber of elements removed
Returns
True if all elements were removed.

◆ unregister_instance()

bool unregister_instance ( void *  instance,
const rtps::InstanceHandle_t &  handle 
)

This operation reserves the action of register_instance.

Informs the middleware that the DataWriter is not intending to modify any more of that data instance. Also indicates that the middleware can locally remove all information regarding that instance.

Parameters
[in]instanceSample used to deduce instance's key in case of handle parameter is HANDLE_NIL.
[in]handleInstance's key to be unregistered.
Returns
Returns the operation's result. If the operation finishes successfully, true is returned.

◆ updateAttributes()

bool updateAttributes ( const PublisherAttributes att)

Update the Attributes of the publisher.

Parameters
attReference to a PublisherAttributes object to update the parameters.
Returns
True if correctly updated, false if ANY of the updated parameters cannot be updated.

◆ wait_for_all_acked()

bool wait_for_all_acked ( const Duration_t &  max_wait)

Waits until all changes were acknowledged or max_wait.

Parameters
max_waitMaximum time to wait until all changes are acknowledged.
Returns
True if all were acknowledged.

◆ write() [1/2]

bool write ( void *  sample)

Writes a sample of the topic.

Parameters
samplePointer to the sample.
Returns
true when operation works successfully.
Note
This method is blocked for a period of time. ReliabilityQosPolicy.max_blocking_time on PublisherAttributes defines this period of time.
Calling example:
TypeStructure tp; //TypeStructure is your own define structure for the topic
//Fill tp with the data you want.
write((void*)&tp);
bool write(void *sample)
Writes a sample of the topic.

◆ write() [2/2]

bool write ( void *  sample,
rtps::WriteParams &  wparams 
)

Writes a sample of the topic with additional options.

Parameters
samplePointer to the sample.
wparamsExtra write parameters.
Returns
true when operation works successfully.
Note
This method is blocked for a period of time. ReliabilityQosPolicy.max_blocking_time on PublisherAttributes defines this period of time.
Calling example:
TypeStructure tp; //TypeStructure is your own define structure for the topic
//Fill tp with the data you want.
write((void*)&tp);

Friends And Related Symbol Documentation

◆ PublisherImpl

friend class PublisherImpl
friend

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