Class RTPSDomain
Defined in File RTPSDomain.h
Class Documentation
-
class RTPSDomain
Class RTPSDomain,it manages the creation and destruction of RTPSParticipant RTPSWriter and RTPSReader. It stores a list of all created RTPSParticipant. It has only static methods.
Public Static Functions
- static RTPS_DllAPI void stopAll ()
Method to shut down all RTPSParticipants, readers, writers, etc. It must be called at the end of the process to avoid memory leaks. It also shut downs the DomainRTPSParticipant.
- Post
After this call, all the pointers to RTPS entities are invalidated and their use may result in undefined behaviour.
- static RTPS_DllAPI RTPSParticipant * createParticipant (uint32_t domain_id, const RTPSParticipantAttributes &attrs, RTPSParticipantListener *plisten=nullptr)
Create a RTPSParticipant.
Warning
The returned pointer is invalidated after a call to removeRTPSParticipant() or stopAll(), so its use may result in undefined behaviour.
- Parameters
domain_id – DomainId to be used by the RTPSParticipant (80 by default).
attrs – RTPSParticipant Attributes.
plisten – Pointer to the ParticipantListener.
- Returns
Pointer to the RTPSParticipant.
- static RTPS_DllAPI RTPSParticipant * createParticipant (uint32_t domain_id, bool enabled, const RTPSParticipantAttributes &attrs, RTPSParticipantListener *plisten=nullptr)
Create a RTPSParticipant.
Warning
The returned pointer is invalidated after a call to removeRTPSParticipant() or stopAll(), so its use may result in undefined behaviour.
- Parameters
domain_id – DomainId to be used by the RTPSParticipant (80 by default).
enabled – True if the RTPSParticipant should be enabled on creation. False if it will be enabled later with RTPSParticipant::enable()
attrs – RTPSParticipant Attributes.
plisten – Pointer to the ParticipantListener.
- Returns
Pointer to the RTPSParticipant.
- static RTPS_DllAPI RTPSWriter * createRTPSWriter (RTPSParticipant *p, WriterAttributes &watt, WriterHistory *hist, WriterListener *listen=nullptr)
Create a RTPSWriter in a participant.
Warning
The returned pointer is invalidated after a call to removeRTPSWriter() or stopAll(), so its use may result in undefined behaviour.
- Parameters
p – Pointer to the RTPSParticipant.
watt – Writer Attributes.
hist – Pointer to the WriterHistory.
listen – Pointer to the WriterListener.
- Returns
Pointer to the created RTPSWriter.
- static RTPS_DllAPI RTPSWriter * createRTPSWriter (RTPSParticipant *p, WriterAttributes &watt, const std::shared_ptr< IPayloadPool > &payload_pool, WriterHistory *hist, WriterListener *listen=nullptr)
Create a RTPSWriter in a participant using a custom payload pool.
Warning
The returned pointer is invalidated after a call to removeRTPSWriter() or stopAll(), so its use may result in undefined behaviour.
- Parameters
p – Pointer to the RTPSParticipant.
watt – Writer Attributes.
payload_pool – Shared pointer to the IPayloadPool
hist – Pointer to the WriterHistory.
listen – Pointer to the WriterListener.
- Returns
Pointer to the created RTPSWriter.
- static RTPS_DllAPI RTPSWriter * createRTPSWriter (RTPSParticipant *p, WriterAttributes &watt, const std::shared_ptr< IPayloadPool > &payload_pool, const std::shared_ptr< IChangePool > &change_pool, WriterHistory *hist, WriterListener *listen=nullptr)
Create a RTPSWriter in a participant using a custom payload pool.
Warning
The returned pointer is invalidated after a call to removeRTPSWriter() or stopAll(), so its use may result in undefined behaviour.
- Parameters
p – Pointer to the RTPSParticipant.
watt – Writer Attributes.
payload_pool – Shared pointer to the IPayloadPool
change_pool – Shared pointer to the IChangePool
hist – Pointer to the WriterHistory.
listen – Pointer to the WriterListener.
- Returns
Pointer to the created RTPSWriter.
- static RTPS_DllAPI RTPSWriter * createRTPSWriter (RTPSParticipant *p, const EntityId_t &entity_id, WriterAttributes &watt, const std::shared_ptr< IPayloadPool > &payload_pool, const std::shared_ptr< IChangePool > &change_pool, WriterHistory *hist, WriterListener *listen=nullptr)
Create a RTPSWriter in a participant using a custom payload pool.
Warning
The returned pointer is invalidated after a call to removeRTPSWriter() or stopAll(), so its use may result in undefined behaviour.
- Parameters
p – Pointer to the RTPSParticipant.
entity_id – Specific entity id to use for the created writer.
watt – Writer Attributes.
payload_pool – Shared pointer to the IPayloadPool
change_pool – Shared pointer to the IChangePool
hist – Pointer to the WriterHistory.
listen – Pointer to the WriterListener.
- Returns
Pointer to the created RTPSWriter.
- static RTPS_DllAPI RTPSWriter * createRTPSWriter (RTPSParticipant *p, const EntityId_t &entity_id, WriterAttributes &watt, const std::shared_ptr< IPayloadPool > &payload_pool, WriterHistory *hist, WriterListener *listen=nullptr)
Create a RTPSWriter in a participant.
Warning
The returned pointer is invalidated after a call to removeRTPSWriter() or stopAll(), so its use may result in undefined behaviour.
- Parameters
p – Pointer to the RTPSParticipant.
entity_id – Specific entity id to use for the created writer.
watt – Writer Attributes.
payload_pool – Shared pointer to the IPayloadPool
hist – Pointer to the WriterHistory.
listen – Pointer to the WriterListener.
- Returns
Pointer to the created RTPSWriter.
- static RTPS_DllAPI bool removeRTPSWriter (RTPSWriter *writer)
Remove a RTPSWriter.
- Parameters
writer – Pointer to the writer you want to remove.
- Returns
True if correctly removed.
- static RTPS_DllAPI RTPSReader * createRTPSReader (RTPSParticipant *p, ReaderAttributes &ratt, ReaderHistory *hist, ReaderListener *listen=nullptr)
Create a RTPSReader in a participant.
Warning
The returned pointer is invalidated after a call to removeRTPSReader() or stopAll(), so its use may result in undefined behaviour.
- Parameters
p – Pointer to the RTPSParticipant.
ratt – Reader Attributes.
hist – Pointer to the ReaderHistory.
listen – Pointer to the ReaderListener.
- Returns
Pointer to the created RTPSReader.
- static RTPS_DllAPI RTPSReader * createRTPSReader (RTPSParticipant *p, ReaderAttributes &ratt, const std::shared_ptr< IPayloadPool > &payload_pool, ReaderHistory *hist, ReaderListener *listen=nullptr)
Create a RTPReader in a participant using a custom payload pool.
Warning
The returned pointer is invalidated after a call to removeRTPSReader() or stopAll(), so its use may result in undefined behaviour.
- Parameters
p – Pointer to the RTPSParticipant.
ratt – Reader Attributes.
payload_pool – Shared pointer to the IPayloadPool
hist – Pointer to the ReaderHistory.
listen – Pointer to the ReaderListener.
- Returns
Pointer to the created RTPSReader.
- static RTPS_DllAPI RTPSReader * createRTPSReader (RTPSParticipant *p, const EntityId_t &entity_id, ReaderAttributes &ratt, const std::shared_ptr< IPayloadPool > &payload_pool, ReaderHistory *hist, ReaderListener *listen=nullptr)
Create a RTPSReader in a participant using a custom payload pool.
Warning
The returned pointer is invalidated after a call to removeRTPSReader() or stopAll(), so its use may result in undefined behaviour.
- Parameters
p – Pointer to the RTPSParticipant.
entity_id – Specific entity id to use for the created reader.
ratt – Reader Attributes.
payload_pool – Shared pointer to the IPayloadPool
hist – Pointer to the ReaderHistory.
listen – Pointer to the ReaderListener.
- Returns
Pointer to the created RTPSReader.
- static RTPS_DllAPI bool removeRTPSReader (RTPSReader *reader)
Remove a RTPSReader.
- Parameters
reader – Pointer to the reader you want to remove.
- Returns
True if correctly removed.
- static RTPS_DllAPI bool removeRTPSParticipant (RTPSParticipant *p)
Remove a RTPSParticipant and delete all its associated Writers, Readers, resources, etc.
- Parameters
p – [in] Pointer to the RTPSParticipant;
- Returns
True if correct.