Fast DDS  Version 3.0.1
Fast DDS
Loading...
Searching...
No Matches
RTPSDomain.hpp
1// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima).
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
19#ifndef FASTDDS_RTPS__RTPSDOMAIN_HPP
20#define FASTDDS_RTPS__RTPSDOMAIN_HPP
21
22#include <atomic>
23#include <mutex>
24#include <set>
25
26#include <fastdds/LibrarySettings.hpp>
27#include <fastdds/rtps/attributes/RTPSParticipantAttributes.hpp>
28#include <fastdds/rtps/attributes/ThreadSettings.hpp>
29#include <fastdds/rtps/common/Types.hpp>
30#include <fastdds/rtps/history/IPayloadPool.hpp>
31#include <fastdds/rtps/history/IChangePool.hpp>
32
33namespace eprosima {
34namespace fastdds {
35namespace rtps {
36
37class RTPSParticipantImpl;
38class RTPSParticipant;
39class RTPSParticipantListener;
40class RTPSWriter;
41class WriterAttributes;
42class WriterHistory;
43class WriterListener;
44class RTPSReader;
45class ReaderAttributes;
46class ReaderHistory;
47class ReaderListener;
48class RTPSDomainImpl;
49
56{
57public:
58
67 FASTDDS_EXPORTED_API static void set_filewatch_thread_config(
68 const fastdds::rtps::ThreadSettings& watch_thread,
69 const fastdds::rtps::ThreadSettings& callback_thread);
70
79 FASTDDS_EXPORTED_API static void stopAll();
80
91 FASTDDS_EXPORTED_API static RTPSParticipant* createParticipant(
92 uint32_t domain_id,
93 const RTPSParticipantAttributes& attrs,
94 RTPSParticipantListener* plisten = nullptr);
95
107 FASTDDS_EXPORTED_API static RTPSParticipant* createParticipant(
108 uint32_t domain_id,
109 bool enabled,
110 const RTPSParticipantAttributes& attrs,
111 RTPSParticipantListener* plisten = nullptr);
112
126 FASTDDS_EXPORTED_API static RTPSWriter* createRTPSWriter(
128 WriterAttributes& watt,
129 WriterHistory* hist,
130 WriterListener* listen = nullptr);
131
146 FASTDDS_EXPORTED_API static RTPSWriter* createRTPSWriter(
148 const EntityId_t& entity_id,
149 WriterAttributes& watt,
150 WriterHistory* hist,
151 WriterListener* listen = nullptr);
152
158 FASTDDS_EXPORTED_API static bool removeRTPSWriter(
159 RTPSWriter* writer);
160
172 FASTDDS_EXPORTED_API static RTPSReader* createRTPSReader(
174 ReaderAttributes& ratt,
175 ReaderHistory* hist,
176 ReaderListener* listen = nullptr);
177
190 FASTDDS_EXPORTED_API static RTPSReader* createRTPSReader(
192 ReaderAttributes& ratt,
193 const std::shared_ptr<IPayloadPool>& payload_pool,
194 ReaderHistory* hist,
195 ReaderListener* listen = nullptr);
196
210 FASTDDS_EXPORTED_API static RTPSReader* createRTPSReader(
212 const EntityId_t& entity_id,
213 ReaderAttributes& ratt,
214 const std::shared_ptr<IPayloadPool>& payload_pool,
215 ReaderHistory* hist,
216 ReaderListener* listen = nullptr);
217
223 FASTDDS_EXPORTED_API static bool removeRTPSReader(
224 RTPSReader* reader);
225
231 FASTDDS_EXPORTED_API static bool removeRTPSParticipant(
232 RTPSParticipant* p);
233
240 FASTDDS_EXPORTED_API static bool get_library_settings(
241 fastdds::LibrarySettings& library_settings);
242
250 FASTDDS_EXPORTED_API static bool set_library_settings(
251 const fastdds::LibrarySettings& library_settings);
252
253private:
254
255 RTPSDomain() = delete;
256
260 ~RTPSDomain() = delete;
261};
262
263} // namespace rtps
264} // namespace fastdds
265} // namespace eprosima
266
267#endif // FASTDDS_RTPS__RTPSDOMAIN_HPP
Class LibraySettings, used by the user to define the Fast DDS library behaviour.
Definition LibrarySettings.hpp:38
Class RTPSDomain,it manages the creation and destruction of RTPSParticipant RTPSWriter and RTPSReader...
Definition RTPSDomain.hpp:56
static FASTDDS_EXPORTED_API RTPSWriter * createRTPSWriter(RTPSParticipant *p, const EntityId_t &entity_id, WriterAttributes &watt, WriterHistory *hist, WriterListener *listen=nullptr)
Create a RTPSWriter in a participant.
static FASTDDS_EXPORTED_API RTPSWriter * createRTPSWriter(RTPSParticipant *p, WriterAttributes &watt, WriterHistory *hist, WriterListener *listen=nullptr)
Create a RTPSWriter in a participant.
static FASTDDS_EXPORTED_API RTPSReader * createRTPSReader(RTPSParticipant *p, ReaderAttributes &ratt, ReaderHistory *hist, ReaderListener *listen=nullptr)
Create a RTPSReader in a participant.
static FASTDDS_EXPORTED_API RTPSParticipant * createParticipant(uint32_t domain_id, const RTPSParticipantAttributes &attrs, RTPSParticipantListener *plisten=nullptr)
Create a RTPSParticipant.
static FASTDDS_EXPORTED_API void stopAll()
Method to shut down all RTPSParticipants, readers, writers, etc.
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 bool set_library_settings(const fastdds::LibrarySettings &library_settings)
Set the library settings-.
static FASTDDS_EXPORTED_API bool removeRTPSParticipant(RTPSParticipant *p)
Remove a RTPSParticipant and delete all its associated Writers, Readers, resources,...
static FASTDDS_EXPORTED_API bool get_library_settings(fastdds::LibrarySettings &library_settings)
Get the library settings.
static FASTDDS_EXPORTED_API bool removeRTPSReader(RTPSReader *reader)
Remove a RTPSReader.
static FASTDDS_EXPORTED_API 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.
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)
Create a RTPSReader in a participant using a custom payload pool.
static FASTDDS_EXPORTED_API RTPSParticipant * createParticipant(uint32_t domain_id, bool enabled, const RTPSParticipantAttributes &attrs, RTPSParticipantListener *plisten=nullptr)
Create a RTPSParticipant.
static FASTDDS_EXPORTED_API bool removeRTPSWriter(RTPSWriter *writer)
Remove a RTPSWriter.
Class RTPSParticipantAttributes used to define different aspects of a RTPSParticipant.
Definition RTPSParticipantAttributes.hpp:423
Class RTPSParticipant, contains the public API for a RTPSParticipant.
Definition RTPSParticipant.hpp:76
Class RTPSParticipantListener with virtual method that the user can overload to respond to certain ev...
Definition RTPSParticipantListener.hpp:40
Class RTPSReader, manages the reception of data from its matched writers.
Definition RTPSReader.hpp:54
Class RTPSWriter, manages the sending of data to the readers.
Definition RTPSWriter.hpp:62
Class ReaderAttributes, to define the attributes of a RTPSReader.
Definition ReaderAttributes.hpp:59
Class ReaderHistory, container of the different CacheChanges of a reader.
Definition ReaderHistory.hpp:39
Class ReaderListener, to be used by the user to override some of is virtual method to program actions...
Definition ReaderListener.hpp:45
Class WriterAttributes, defining the attributes of a RTPSWriter.
Definition WriterAttributes.hpp:73
Class WriterHistory, container of the different CacheChanges of a writer.
Definition WriterHistory.hpp:47
Class WriterListener with virtual method so the user can implement callbacks to certain events.
Definition WriterListener.hpp:40
eProsima namespace.
Structure EntityId_t, entity id part of GUID_t.
Definition EntityId_t.hpp:77
Struct ThreadSettings to specify various thread settings.
Definition ThreadSettings.hpp:37