20#ifndef FASTDDS_DDS_PUBLISHER__PUBLISHER_HPP
21#define FASTDDS_DDS_PUBLISHER__PUBLISHER_HPP
23#include <fastdds/dds/core/Entity.hpp>
24#include <fastdds/dds/core/ReturnCode.hpp>
25#include <fastdds/dds/publisher/qos/DataWriterQos.hpp>
26#include <fastdds/dds/publisher/qos/PublisherQos.hpp>
27#include <fastdds/dds/topic/TypeSupport.hpp>
28#include <fastdds/rtps/common/Time_t.hpp>
30#include <fastdds/fastdds_dll.hpp>
48class DomainParticipant;
49class PublisherListener;
52class DataWriterListener;
164 std::shared_ptr<fastdds::rtps::IPayloadPool> payload_pool =
nullptr);
178 const std::string& profile_name,
181 std::shared_ptr<fastdds::rtps::IPayloadPool> payload_pool =
nullptr);
212 const std::string& topic_name)
const;
342 const std::string& profile_name,
359 std::vector<DataWriter*>& writers)
const;
372 friend class ::dds::pub::Publisher;
Class DataWriter, contains the actual implementation of the behaviour of the DataWriter.
Definition DataWriter.hpp:64
Class DataWriterListener, allows the end user to implement callbacks triggered by certain events.
Definition DataWriterListener.hpp:39
Class DataWriterQos, containing all the possible Qos that can be set for a determined DataWriter.
Definition DataWriterQos.hpp:85
The DomainEntity class is a subclass of Entity created in order to differentiate between DomainPartic...
Definition Entity.hpp:166
Class DomainParticipant used to group Publishers and Subscribers into a single working unit.
Definition DomainParticipant.hpp:78
Class Publisher, used to send data to associated subscribers.
Definition Publisher.hpp:61
FASTDDS_EXPORTED_API ReturnCode_t set_default_datawriter_qos(const DataWriterQos &qos)
This operation sets a default value of the DataWriter QoS policies which will be used for newly creat...
FASTDDS_EXPORTED_API ReturnCode_t get_datawriter_qos_from_profile(const std::string &profile_name, DataWriterQos &qos) const
Fills the DataWriterQos with the values of the XML profile.
FASTDDS_EXPORTED_API const InstanceHandle_t & get_instance_handle() const
Returns the Publisher's handle.
FASTDDS_EXPORTED_API const PublisherQos & get_qos() const
Allows accessing the Publisher Qos.
FASTDDS_EXPORTED_API ReturnCode_t set_qos(const PublisherQos &qos)
Allows modifying the Publisher Qos.
FASTDDS_EXPORTED_API ReturnCode_t delete_datawriter(const DataWriter *writer)
This operation deletes a DataWriter that belongs to the Publisher.
Publisher(PublisherImpl *p, const StatusMask &mask=StatusMask::all())
Create a publisher, assigning its pointer to the associated implementation.
FASTDDS_EXPORTED_API DataWriter * create_datawriter_with_profile(Topic *topic, const std::string &profile_name, DataWriterListener *listener=nullptr, const StatusMask &mask=StatusMask::all(), std::shared_ptr< fastdds::rtps::IPayloadPool > payload_pool=nullptr)
This operation creates a DataWriter.
FASTDDS_EXPORTED_API const DataWriterQos & get_default_datawriter_qos() const
This operation returns the default value of the DataWriter QoS, that is, the QoS policies which will ...
FASTDDS_EXPORTED_API bool has_datawriters() const
This operation checks if the publisher has DataWriters.
FASTDDS_EXPORTED_API DataWriter * create_datawriter(Topic *topic, const DataWriterQos &qos, DataWriterListener *listener=nullptr, const StatusMask &mask=StatusMask::all(), std::shared_ptr< fastdds::rtps::IPayloadPool > payload_pool=nullptr)
This operation creates a DataWriter.
virtual ~Publisher()
Destructor.
FASTDDS_EXPORTED_API ReturnCode_t set_listener(PublisherListener *listener)
Modifies the PublisherListener, sets the mask to StatusMask::all()
PublisherImpl * impl_
Definition Publisher.hpp:370
FASTDDS_EXPORTED_API const PublisherListener * get_listener() const
Retrieves the attached PublisherListener.
FASTDDS_EXPORTED_API DataWriter * lookup_datawriter(const std::string &topic_name) const
This operation retrieves a previously created DataWriter belonging to the Publisher that is attached ...
static FASTDDS_EXPORTED_API ReturnCode_t copy_from_topic_qos(fastdds::dds::DataWriterQos &writer_qos, const fastdds::dds::TopicQos &topic_qos)
Copies TopicQos into the corresponding DataWriterQos.
FASTDDS_EXPORTED_API const DomainParticipant * get_participant() const
This operation returns the DomainParticipant to which the Publisher belongs.
FASTDDS_EXPORTED_API ReturnCode_t delete_contained_entities()
Deletes all contained DataWriters.
Publisher(DomainParticipant *dp, const PublisherQos &qos=PUBLISHER_QOS_DEFAULT, PublisherListener *listener=nullptr, const StatusMask &mask=StatusMask::all())
FASTDDS_EXPORTED_API ReturnCode_t enable() override
This operation enables the Publisher.
friend class PublisherImpl
Definition Publisher.hpp:64
FASTDDS_EXPORTED_API ReturnCode_t set_listener(PublisherListener *listener, const StatusMask &mask)
Modifies the PublisherListener.
FASTDDS_EXPORTED_API ReturnCode_t resume_publications()
Indicates to FastDDS that the modifications to the DataWriters are complete.
FASTDDS_EXPORTED_API bool get_datawriters(std::vector< DataWriter * > &writers) const
Fills the given vector with all the datawriters of this publisher.
FASTDDS_EXPORTED_API ReturnCode_t suspend_publications()
Indicates to FastDDS that the contained DataWriters are about to be modified.
friend class DomainParticipantImpl
Definition Publisher.hpp:65
FASTDDS_EXPORTED_API ReturnCode_t wait_for_acknowledgments(const fastdds::dds::Duration_t &max_wait)
This operation blocks the calling thread until either all data written by the reliable DataWriter ent...
FASTDDS_EXPORTED_API ReturnCode_t end_coherent_changes()
Signals the end of a set of coherent cache changes.
FASTDDS_EXPORTED_API ReturnCode_t get_default_datawriter_qos(DataWriterQos &qos) const
This operation retrieves the default value of the DataWriter QoS, that is, the QoS policies which wil...
FASTDDS_EXPORTED_API ReturnCode_t begin_coherent_changes()
Signals the beginning of a set of coherent cache changes using the Datawriters attached to the publis...
FASTDDS_EXPORTED_API ReturnCode_t get_qos(PublisherQos &qos) const
Retrieves the Publisher Qos.
Class PublisherListener, allows the end user to implement callbacks triggered by certain events.
Definition PublisherListener.hpp:39
Class PublisherQos, containing all the possible Qos that can be set for a determined Publisher.
Definition PublisherQos.hpp:39
StatusMask is a bitmap or bitset field.
Definition StatusMask.hpp:48
static StatusMask all()
Get all StatusMasks.
Definition StatusMask.hpp:104
Class Topic, represents the fact that both publications and subscriptions are tied to a single data-t...
Definition Topic.hpp:53
Class TopicQos, containing all the possible Qos that can be set for a determined Topic.
Definition TopicQos.hpp:40
Definition DomainParticipant.hpp:45
FASTDDS_EXPORTED_API const PublisherQos PUBLISHER_QOS_DEFAULT
int32_t ReturnCode_t
Definition DDSReturnCode.hpp:59
Structure Time_t, used to describe times at a DDS level.
Definition Time_t.hpp:36
Struct InstanceHandle_t, used to contain the key for WITH_KEY topics.
Definition InstanceHandle.hpp:154