Program Listing for File Publisher.hpp
↰ Return to documentation for file (include/fastdds/dds/publisher/Publisher.hpp)
// Copyright 2019 Proyectos y Sistemas de Mantenimiento SL (eProsima).
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef FASTDDS_DDS_PUBLISHER__PUBLISHER_HPP
#define FASTDDS_DDS_PUBLISHER__PUBLISHER_HPP
#include <fastdds/dds/core/Entity.hpp>
#include <fastdds/dds/core/ReturnCode.hpp>
#include <fastdds/dds/publisher/qos/DataWriterQos.hpp>
#include <fastdds/dds/publisher/qos/PublisherQos.hpp>
#include <fastdds/dds/topic/TypeSupport.hpp>
#include <fastdds/rtps/common/Time_t.hpp>
#include <fastdds/fastdds_dll.hpp>
namespace dds {
namespace pub {
class Publisher;
} // namespace pub
} // namespace dds
namespace eprosima {
namespace fastdds {
namespace rtps {
class IPayloadPool;
} // namespace rtps
namespace dds {
class DomainParticipant;
class PublisherListener;
class PublisherImpl;
class DataWriter;
class DataWriterListener;
class Topic;
class Publisher : public DomainEntity
{
protected:
friend class PublisherImpl;
friend class DomainParticipantImpl;
Publisher(
PublisherImpl* p,
const StatusMask& mask = StatusMask::all());
Publisher(
DomainParticipant* dp,
const PublisherQos& qos = PUBLISHER_QOS_DEFAULT,
PublisherListener* listener = nullptr,
const StatusMask& mask = StatusMask::all());
public:
virtual ~Publisher();
FASTDDS_EXPORTED_API ReturnCode_t enable() override;
FASTDDS_EXPORTED_API const PublisherQos& get_qos() const;
FASTDDS_EXPORTED_API ReturnCode_t get_qos(
PublisherQos& qos) const;
FASTDDS_EXPORTED_API ReturnCode_t set_qos(
const PublisherQos& qos);
FASTDDS_EXPORTED_API const PublisherListener* get_listener() const;
FASTDDS_EXPORTED_API ReturnCode_t set_listener(
PublisherListener* listener);
FASTDDS_EXPORTED_API ReturnCode_t set_listener(
PublisherListener* listener,
const StatusMask& mask);
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);
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);
FASTDDS_EXPORTED_API ReturnCode_t delete_datawriter(
const DataWriter* writer);
FASTDDS_EXPORTED_API DataWriter* lookup_datawriter(
const std::string& topic_name) const;
FASTDDS_EXPORTED_API ReturnCode_t suspend_publications();
FASTDDS_EXPORTED_API ReturnCode_t resume_publications();
FASTDDS_EXPORTED_API ReturnCode_t begin_coherent_changes();
FASTDDS_EXPORTED_API ReturnCode_t end_coherent_changes();
FASTDDS_EXPORTED_API ReturnCode_t wait_for_acknowledgments(
const fastdds::dds::Duration_t& max_wait);
FASTDDS_EXPORTED_API const DomainParticipant* get_participant() const;
FASTDDS_EXPORTED_API ReturnCode_t delete_contained_entities();
FASTDDS_EXPORTED_API ReturnCode_t set_default_datawriter_qos(
const DataWriterQos& qos);
FASTDDS_EXPORTED_API const DataWriterQos& get_default_datawriter_qos() const;
FASTDDS_EXPORTED_API ReturnCode_t get_default_datawriter_qos(
DataWriterQos& qos) const;
FASTDDS_EXPORTED_API static ReturnCode_t copy_from_topic_qos(
fastdds::dds::DataWriterQos& writer_qos,
const fastdds::dds::TopicQos& topic_qos);
FASTDDS_EXPORTED_API ReturnCode_t get_datawriter_qos_from_profile(
const std::string& profile_name,
DataWriterQos& qos) const;
FASTDDS_EXPORTED_API ReturnCode_t get_datawriter_qos_from_profile(
const std::string& profile_name,
DataWriterQos& qos,
std::string& topic_name) const;
FASTDDS_EXPORTED_API ReturnCode_t get_datawriter_qos_from_xml(
const std::string& xml,
DataWriterQos& qos) const;
FASTDDS_EXPORTED_API ReturnCode_t get_datawriter_qos_from_xml(
const std::string& xml,
DataWriterQos& qos,
std::string& topic_name) const;
FASTDDS_EXPORTED_API ReturnCode_t get_datawriter_qos_from_xml(
const std::string& xml,
DataWriterQos& qos,
const std::string& profile_name) const;
FASTDDS_EXPORTED_API ReturnCode_t get_datawriter_qos_from_xml(
const std::string& xml,
DataWriterQos& qos,
std::string& topic_name,
const std::string& profile_name) const;
FASTDDS_EXPORTED_API ReturnCode_t get_default_datawriter_qos_from_xml(
const std::string& xml,
DataWriterQos& qos) const;
FASTDDS_EXPORTED_API ReturnCode_t get_default_datawriter_qos_from_xml(
const std::string& xml,
DataWriterQos& qos,
std::string& topic_name) const;
FASTDDS_EXPORTED_API const InstanceHandle_t& get_instance_handle() const;
FASTDDS_EXPORTED_API bool get_datawriters(
std::vector<DataWriter*>& writers) const;
FASTDDS_EXPORTED_API bool has_datawriters() const;
protected:
PublisherImpl* impl_;
friend class ::dds::pub::Publisher;
};
} // namespace dds
} // namespace fastdds
} // namespace eprosima
#endif // FASTDDS_DDS_PUBLISHER__PUBLISHER_HPP