Fast DDS  Version 3.0.1
Fast DDS
Loading...
Searching...
No Matches
RTPSDomain Class Reference

Class RTPSDomain,it manages the creation and destruction of RTPSParticipant RTPSWriter and RTPSReader. More...

#include <RTPSDomain.hpp>

Static Public Member Functions

static FASTDDS_EXPORTED_API void set_filewatch_thread_config (const fastdds::rtps::ThreadSettings &watch_thread, const fastdds::rtps::ThreadSettings &callback_thread)
 Method to set the configuration of the threads created by the file watcher for the environment file.
 
static FASTDDS_EXPORTED_API void stopAll ()
 Method to shut down all RTPSParticipants, readers, writers, etc.
 
static FASTDDS_EXPORTED_API RTPSParticipantcreateParticipant (uint32_t domain_id, const RTPSParticipantAttributes &attrs, RTPSParticipantListener *plisten=nullptr)
 Create a RTPSParticipant.
 
static FASTDDS_EXPORTED_API RTPSParticipantcreateParticipant (uint32_t domain_id, bool enabled, const RTPSParticipantAttributes &attrs, RTPSParticipantListener *plisten=nullptr)
 Create a RTPSParticipant.
 
static FASTDDS_EXPORTED_API RTPSWritercreateRTPSWriter (RTPSParticipant *p, WriterAttributes &watt, WriterHistory *hist, WriterListener *listen=nullptr)
 Create a RTPSWriter in a participant.
 
static FASTDDS_EXPORTED_API RTPSWritercreateRTPSWriter (RTPSParticipant *p, const EntityId_t &entity_id, WriterAttributes &watt, WriterHistory *hist, WriterListener *listen=nullptr)
 Create a RTPSWriter in a participant.
 
static FASTDDS_EXPORTED_API bool removeRTPSWriter (RTPSWriter *writer)
 Remove a RTPSWriter.
 
static FASTDDS_EXPORTED_API RTPSReadercreateRTPSReader (RTPSParticipant *p, ReaderAttributes &ratt, ReaderHistory *hist, ReaderListener *listen=nullptr)
 Create a RTPSReader in a participant.
 
static FASTDDS_EXPORTED_API RTPSReadercreateRTPSReader (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.
 
static FASTDDS_EXPORTED_API RTPSReadercreateRTPSReader (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.
 
static FASTDDS_EXPORTED_API bool removeRTPSReader (RTPSReader *reader)
 Remove a RTPSReader.
 
static FASTDDS_EXPORTED_API bool removeRTPSParticipant (RTPSParticipant *p)
 Remove a RTPSParticipant and delete all its associated Writers, Readers, resources, etc.
 
static FASTDDS_EXPORTED_API bool get_library_settings (fastdds::LibrarySettings &library_settings)
 Get the library settings.
 
static FASTDDS_EXPORTED_API bool set_library_settings (const fastdds::LibrarySettings &library_settings)
 Set the library settings-.
 

Detailed Description

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.

Member Function Documentation

◆ createParticipant() [1/2]

static FASTDDS_EXPORTED_API RTPSParticipant * createParticipant ( uint32_t  domain_id,
bool  enabled,
const RTPSParticipantAttributes attrs,
RTPSParticipantListener plisten = nullptr 
)
static

Create a RTPSParticipant.

Parameters
domain_idDomainId to be used by the RTPSParticipant (80 by default).
enabledTrue if the RTPSParticipant should be enabled on creation. False if it will be enabled later with RTPSParticipant::enable()
attrsRTPSParticipant Attributes.
plistenPointer to the ParticipantListener.
Returns
Pointer to the RTPSParticipant.
Warning
The returned pointer is invalidated after a call to removeRTPSParticipant() or stopAll(), so its use may result in undefined behaviour.

◆ createParticipant() [2/2]

static FASTDDS_EXPORTED_API RTPSParticipant * createParticipant ( uint32_t  domain_id,
const RTPSParticipantAttributes attrs,
RTPSParticipantListener plisten = nullptr 
)
static

Create a RTPSParticipant.

Parameters
domain_idDomainId to be used by the RTPSParticipant (80 by default).
attrsRTPSParticipant Attributes.
plistenPointer to the ParticipantListener.
Returns
Pointer to the RTPSParticipant.
Warning
The returned pointer is invalidated after a call to removeRTPSParticipant() or stopAll(), so its use may result in undefined behaviour.

◆ createRTPSReader() [1/3]

static FASTDDS_EXPORTED_API RTPSReader * createRTPSReader ( RTPSParticipant p,
const EntityId_t entity_id,
ReaderAttributes ratt,
const std::shared_ptr< IPayloadPool > &  payload_pool,
ReaderHistory hist,
ReaderListener listen = nullptr 
)
static

Create a RTPSReader in a participant using a custom payload pool.

Parameters
pPointer to the RTPSParticipant.
entity_idSpecific entity id to use for the created reader.
rattReader Attributes.
payload_poolShared pointer to the IPayloadPool
histPointer to the ReaderHistory.
listenPointer to the ReaderListener.
Returns
Pointer to the created RTPSReader.
Warning
The returned pointer is invalidated after a call to removeRTPSReader() or stopAll(), so its use may result in undefined behaviour.

◆ createRTPSReader() [2/3]

static FASTDDS_EXPORTED_API RTPSReader * createRTPSReader ( RTPSParticipant p,
ReaderAttributes ratt,
const std::shared_ptr< IPayloadPool > &  payload_pool,
ReaderHistory hist,
ReaderListener listen = nullptr 
)
static

Create a RTPReader in a participant using a custom payload pool.

Parameters
pPointer to the RTPSParticipant.
rattReader Attributes.
payload_poolShared pointer to the IPayloadPool
histPointer to the ReaderHistory.
listenPointer to the ReaderListener.
Returns
Pointer to the created RTPSReader.
Warning
The returned pointer is invalidated after a call to removeRTPSReader() or stopAll(), so its use may result in undefined behaviour.

◆ createRTPSReader() [3/3]

static FASTDDS_EXPORTED_API RTPSReader * createRTPSReader ( RTPSParticipant p,
ReaderAttributes ratt,
ReaderHistory hist,
ReaderListener listen = nullptr 
)
static

Create a RTPSReader in a participant.

Parameters
pPointer to the RTPSParticipant.
rattReader Attributes.
histPointer to the ReaderHistory.
listenPointer to the ReaderListener.
Returns
Pointer to the created RTPSReader.
Warning
The returned pointer is invalidated after a call to removeRTPSReader() or stopAll(), so its use may result in undefined behaviour.

◆ createRTPSWriter() [1/2]

static FASTDDS_EXPORTED_API RTPSWriter * createRTPSWriter ( RTPSParticipant p,
const EntityId_t entity_id,
WriterAttributes watt,
WriterHistory hist,
WriterListener listen = nullptr 
)
static

Create a RTPSWriter in a participant.

Parameters
pPointer to the RTPSParticipant.
entity_idSpecific entity id to use for the created writer.
wattWriter Attributes.
histPointer to the WriterHistory.
listenPointer to the WriterListener.
Returns
Pointer to the created RTPSWriter.
Warning
The returned pointer is invalidated after a call to removeRTPSWriter() or stopAll(), so its use may result in undefined behaviour.

◆ createRTPSWriter() [2/2]

static FASTDDS_EXPORTED_API RTPSWriter * createRTPSWriter ( RTPSParticipant p,
WriterAttributes watt,
WriterHistory hist,
WriterListener listen = nullptr 
)
static

Create a RTPSWriter in a participant.

Parameters
pPointer to the RTPSParticipant.
wattWriter Attributes.
histPointer to the WriterHistory.
listenPointer to the WriterListener.
Returns
Pointer to the created RTPSWriter.
Warning
The returned pointer is invalidated after a call to removeRTPSWriter() or stopAll(), so its use may result in undefined behaviour.

◆ get_library_settings()

static FASTDDS_EXPORTED_API bool get_library_settings ( fastdds::LibrarySettings library_settings)
static

Get the library settings.

Parameters
library_settingsLibrarySettings reference where the settings are returned.
Returns
True.

◆ removeRTPSParticipant()

static FASTDDS_EXPORTED_API bool removeRTPSParticipant ( RTPSParticipant p)
static

Remove a RTPSParticipant and delete all its associated Writers, Readers, resources, etc.

Parameters
[in]pPointer to the RTPSParticipant;
Returns
True if correct.

◆ removeRTPSReader()

static FASTDDS_EXPORTED_API bool removeRTPSReader ( RTPSReader reader)
static

Remove a RTPSReader.

Parameters
readerPointer to the reader you want to remove.
Returns
True if correctly removed.

◆ removeRTPSWriter()

static FASTDDS_EXPORTED_API bool removeRTPSWriter ( RTPSWriter writer)
static

Remove a RTPSWriter.

Parameters
writerPointer to the writer you want to remove.
Returns
True if correctly removed.

◆ set_filewatch_thread_config()

static FASTDDS_EXPORTED_API void set_filewatch_thread_config ( const fastdds::rtps::ThreadSettings watch_thread,
const fastdds::rtps::ThreadSettings callback_thread 
)
static

Method to set the configuration of the threads created by the file watcher for the environment file.

In order for these settings to take effect, this method must be called before the first call to createParticipant.

Parameters
watch_threadSettings for the thread watching the environment file.
callback_threadSettings for the thread executing the callback when the environment file changed.

◆ set_library_settings()

static FASTDDS_EXPORTED_API bool set_library_settings ( const fastdds::LibrarySettings library_settings)
static

Set the library settings-.

Parameters
library_settingsLibrarySettings to be set.
Returns
False if there is any RTPSParticipant already created. True if correctly set.

◆ stopAll()

static FASTDDS_EXPORTED_API void stopAll ( )
static

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.

Postcondition
After this call, all the pointers to RTPS entities are invalidated and their use may result in undefined behaviour.

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