Program Listing for File DomainParticipant.hpp
↰ Return to documentation for file (include/fastdds/dds/domain/DomainParticipant.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_DOMAIN__DOMAINPARTICIPANT_HPP
#define FASTDDS_DDS_DOMAIN__DOMAINPARTICIPANT_HPP
#include <functional>
#include <string>
#include <utility>
#include <vector>
#include <fastdds/dds/builtin/topic/ParticipantBuiltinTopicData.hpp>
#include <fastdds/dds/builtin/topic/TopicBuiltinTopicData.hpp>
#include <fastdds/dds/core/Entity.hpp>
#include <fastdds/dds/core/ReturnCode.hpp>
#include <fastdds/dds/core/status/StatusMask.hpp>
#include <fastdds/dds/domain/qos/DomainParticipantQos.hpp>
#include <fastdds/dds/domain/qos/ReplierQos.hpp>
#include <fastdds/dds/domain/qos/RequesterQos.hpp>
#include <fastdds/dds/topic/ContentFilteredTopic.hpp>
#include <fastdds/dds/topic/IContentFilterFactory.hpp>
#include <fastdds/dds/topic/Topic.hpp>
#include <fastdds/dds/topic/TopicListener.hpp>
#include <fastdds/dds/topic/TypeSupport.hpp>
#include <fastdds/rtps/common/Guid.hpp>
#include <fastdds/rtps/common/SampleIdentity.hpp>
#include <fastdds/rtps/common/Time_t.hpp>
namespace dds {
namespace domain {
class DomainParticipant;
} // namespace domain
} // namespace dds
namespace eprosima {
namespace fastdds {
namespace rtps {
class ResourceEvent;
} // namespace rtps
namespace dds {
class DomainParticipantImpl;
class DomainParticipantListener;
class Publisher;
class PublisherQos;
class PublisherListener;
class Subscriber;
class SubscriberQos;
class SubscriberListener;
class TopicQos;
// Not implemented classes
class MultiTopic;
class DomainParticipant : public Entity
{
public:
virtual ~DomainParticipant();
// Superclass methods
FASTDDS_EXPORTED_API ReturnCode_t get_qos(
DomainParticipantQos& qos) const;
FASTDDS_EXPORTED_API const DomainParticipantQos& get_qos() const;
FASTDDS_EXPORTED_API ReturnCode_t set_qos(
const DomainParticipantQos& qos) const;
FASTDDS_EXPORTED_API const DomainParticipantListener* get_listener() const;
FASTDDS_EXPORTED_API ReturnCode_t set_listener(
DomainParticipantListener* listener);
FASTDDS_EXPORTED_API ReturnCode_t set_listener(
DomainParticipantListener* listener,
const std::chrono::seconds timeout);
FASTDDS_EXPORTED_API ReturnCode_t set_listener(
DomainParticipantListener* listener,
const StatusMask& mask);
FASTDDS_EXPORTED_API ReturnCode_t set_listener(
DomainParticipantListener* listener,
const StatusMask& mask,
const std::chrono::seconds timeout);
FASTDDS_EXPORTED_API ReturnCode_t enable() override;
// DomainParticipant specific methods from DDS API
FASTDDS_EXPORTED_API Publisher* create_publisher(
const PublisherQos& qos,
PublisherListener* listener = nullptr,
const StatusMask& mask = StatusMask::all());
FASTDDS_EXPORTED_API Publisher* create_publisher_with_profile(
const std::string& profile_name,
PublisherListener* listener = nullptr,
const StatusMask& mask = StatusMask::all());
FASTDDS_EXPORTED_API ReturnCode_t delete_publisher(
const Publisher* publisher);
FASTDDS_EXPORTED_API Subscriber* create_subscriber(
const SubscriberQos& qos,
SubscriberListener* listener = nullptr,
const StatusMask& mask = StatusMask::all());
FASTDDS_EXPORTED_API Subscriber* create_subscriber_with_profile(
const std::string& profile_name,
SubscriberListener* listener = nullptr,
const StatusMask& mask = StatusMask::all());
FASTDDS_EXPORTED_API ReturnCode_t delete_subscriber(
const Subscriber* subscriber);
FASTDDS_EXPORTED_API Topic* create_topic(
const std::string& topic_name,
const std::string& type_name,
const TopicQos& qos,
TopicListener* listener = nullptr,
const StatusMask& mask = StatusMask::all());
FASTDDS_EXPORTED_API Topic* create_topic_with_profile(
const std::string& topic_name,
const std::string& type_name,
const std::string& profile_name,
TopicListener* listener = nullptr,
const StatusMask& mask = StatusMask::all());
FASTDDS_EXPORTED_API ReturnCode_t delete_topic(
const Topic* topic);
FASTDDS_EXPORTED_API ContentFilteredTopic* create_contentfilteredtopic(
const std::string& name,
Topic* related_topic,
const std::string& filter_expression,
const std::vector<std::string>& expression_parameters);
FASTDDS_EXPORTED_API ContentFilteredTopic* create_contentfilteredtopic(
const std::string& name,
Topic* related_topic,
const std::string& filter_expression,
const std::vector<std::string>& expression_parameters,
const char* filter_class_name);
FASTDDS_EXPORTED_API ReturnCode_t delete_contentfilteredtopic(
const ContentFilteredTopic* a_contentfilteredtopic);
FASTDDS_EXPORTED_API MultiTopic* create_multitopic(
const std::string& name,
const std::string& type_name,
const std::string& subscription_expression,
const std::vector<std::string>& expression_parameters);
FASTDDS_EXPORTED_API ReturnCode_t delete_multitopic(
const MultiTopic* a_multitopic);
FASTDDS_EXPORTED_API Topic* find_topic(
const std::string& topic_name,
const fastdds::dds::Duration_t& timeout);
FASTDDS_EXPORTED_API TopicDescription* lookup_topicdescription(
const std::string& topic_name) const;
FASTDDS_EXPORTED_API const Subscriber* get_builtin_subscriber() const;
FASTDDS_EXPORTED_API ReturnCode_t ignore_participant(
const InstanceHandle_t& handle);
FASTDDS_EXPORTED_API ReturnCode_t ignore_topic(
const InstanceHandle_t& handle);
FASTDDS_EXPORTED_API ReturnCode_t ignore_publication(
const InstanceHandle_t& handle);
FASTDDS_EXPORTED_API ReturnCode_t ignore_subscription(
const InstanceHandle_t& handle);
FASTDDS_EXPORTED_API DomainId_t get_domain_id() const;
FASTDDS_EXPORTED_API ReturnCode_t delete_contained_entities();
FASTDDS_EXPORTED_API ReturnCode_t assert_liveliness();
FASTDDS_EXPORTED_API ReturnCode_t set_default_publisher_qos(
const PublisherQos& qos);
FASTDDS_EXPORTED_API const PublisherQos& get_default_publisher_qos() const;
FASTDDS_EXPORTED_API ReturnCode_t get_default_publisher_qos(
PublisherQos& qos) const;
FASTDDS_EXPORTED_API ReturnCode_t get_publisher_qos_from_profile(
const std::string& profile_name,
PublisherQos& qos) const;
FASTDDS_EXPORTED_API ReturnCode_t get_publisher_qos_from_xml(
const std::string& xml,
PublisherQos& qos) const;
FASTDDS_EXPORTED_API ReturnCode_t get_publisher_qos_from_xml(
const std::string& xml,
PublisherQos& qos,
const std::string& profile_name) const;
FASTDDS_EXPORTED_API ReturnCode_t get_default_publisher_qos_from_xml(
const std::string& xml,
PublisherQos& qos) const;
FASTDDS_EXPORTED_API ReturnCode_t set_default_subscriber_qos(
const SubscriberQos& qos);
FASTDDS_EXPORTED_API const SubscriberQos& get_default_subscriber_qos() const;
FASTDDS_EXPORTED_API ReturnCode_t get_default_subscriber_qos(
SubscriberQos& qos) const;
FASTDDS_EXPORTED_API ReturnCode_t get_subscriber_qos_from_profile(
const std::string& profile_name,
SubscriberQos& qos) const;
FASTDDS_EXPORTED_API ReturnCode_t get_subscriber_qos_from_xml(
const std::string& xml,
SubscriberQos& qos) const;
FASTDDS_EXPORTED_API ReturnCode_t get_subscriber_qos_from_xml(
const std::string& xml,
SubscriberQos& qos,
const std::string& profile_name) const;
FASTDDS_EXPORTED_API ReturnCode_t get_default_subscriber_qos_from_xml(
const std::string& xml,
SubscriberQos& qos) const;
FASTDDS_EXPORTED_API ReturnCode_t set_default_topic_qos(
const TopicQos& qos);
FASTDDS_EXPORTED_API const TopicQos& get_default_topic_qos() const;
FASTDDS_EXPORTED_API ReturnCode_t get_default_topic_qos(
TopicQos& qos) const;
FASTDDS_EXPORTED_API ReturnCode_t get_topic_qos_from_profile(
const std::string& profile_name,
TopicQos& qos) const;
FASTDDS_EXPORTED_API ReturnCode_t get_topic_qos_from_profile(
const std::string& profile_name,
TopicQos& qos,
std::string& topic_name,
std::string& topic_data_type) const;
FASTDDS_EXPORTED_API ReturnCode_t get_topic_qos_from_xml(
const std::string& xml,
TopicQos& qos) const;
FASTDDS_EXPORTED_API ReturnCode_t get_topic_qos_from_xml(
const std::string& xml,
TopicQos& qos,
std::string& topic_name,
std::string& topic_data_type) const;
FASTDDS_EXPORTED_API ReturnCode_t get_topic_qos_from_xml(
const std::string& xml,
TopicQos& qos,
const std::string& profile_name) const;
FASTDDS_EXPORTED_API ReturnCode_t get_topic_qos_from_xml(
const std::string& xml,
TopicQos& qos,
std::string& topic_name,
std::string& topic_data_type,
const std::string& profile_name) const;
FASTDDS_EXPORTED_API ReturnCode_t get_default_topic_qos_from_xml(
const std::string& xml,
TopicQos& qos) const;
FASTDDS_EXPORTED_API ReturnCode_t get_default_topic_qos_from_xml(
const std::string& xml,
TopicQos& qos,
std::string& topic_name,
std::string& topic_data_type) const;
FASTDDS_EXPORTED_API ReturnCode_t get_replier_qos_from_profile(
const std::string& profile_name,
ReplierQos& qos) const;
FASTDDS_EXPORTED_API ReturnCode_t get_replier_qos_from_xml(
const std::string& xml,
ReplierQos& qos) const;
FASTDDS_EXPORTED_API ReturnCode_t get_replier_qos_from_xml(
const std::string& xml,
ReplierQos& qos,
const std::string& profile_name) const;
FASTDDS_EXPORTED_API ReturnCode_t get_default_replier_qos_from_xml(
const std::string& xml,
ReplierQos& qos) const;
FASTDDS_EXPORTED_API ReturnCode_t get_requester_qos_from_profile(
const std::string& profile_name,
RequesterQos& qos) const;
FASTDDS_EXPORTED_API ReturnCode_t get_requester_qos_from_xml(
const std::string& xml,
RequesterQos& qos) const;
FASTDDS_EXPORTED_API ReturnCode_t get_requester_qos_from_xml(
const std::string& xml,
RequesterQos& qos,
const std::string& profile_name) const;
FASTDDS_EXPORTED_API ReturnCode_t get_default_requester_qos_from_xml(
const std::string& xml,
RequesterQos& qos) const;
FASTDDS_EXPORTED_API ReturnCode_t get_discovered_participants(
std::vector<InstanceHandle_t>& participant_handles) const;
FASTDDS_EXPORTED_API ReturnCode_t get_discovered_participant_data(
ParticipantBuiltinTopicData& participant_data,
const InstanceHandle_t& participant_handle) const;
FASTDDS_EXPORTED_API ReturnCode_t get_discovered_topics(
std::vector<InstanceHandle_t>& topic_handles) const;
FASTDDS_EXPORTED_API ReturnCode_t get_discovered_topic_data(
builtin::TopicBuiltinTopicData& topic_data,
const InstanceHandle_t& topic_handle) const;
FASTDDS_EXPORTED_API bool contains_entity(
const InstanceHandle_t& a_handle,
bool recursive = true) const;
FASTDDS_EXPORTED_API ReturnCode_t get_current_time(
fastdds::dds::Time_t& current_time) const;
// DomainParticipant methods specific from Fast DDS
FASTDDS_EXPORTED_API ReturnCode_t register_type(
TypeSupport type,
const std::string& type_name);
FASTDDS_EXPORTED_API ReturnCode_t register_type(
TypeSupport type);
FASTDDS_EXPORTED_API ReturnCode_t unregister_type(
const std::string& typeName);
FASTDDS_EXPORTED_API TypeSupport find_type(
const std::string& type_name) const;
FASTDDS_EXPORTED_API const InstanceHandle_t& get_instance_handle() const;
// From here legacy RTPS methods.
FASTDDS_EXPORTED_API const fastdds::rtps::GUID_t& guid() const;
FASTDDS_EXPORTED_API std::vector<std::string> get_participant_names() const;
FASTDDS_EXPORTED_API bool new_remote_endpoint_discovered(
const fastdds::rtps::GUID_t& partguid,
uint16_t userId,
fastdds::rtps::EndpointKind_t kind);
FASTDDS_EXPORTED_API ReturnCode_t register_content_filter_factory(
const char* filter_class_name,
IContentFilterFactory* const filter_factory);
FASTDDS_EXPORTED_API IContentFilterFactory* lookup_content_filter_factory(
const char* filter_class_name);
FASTDDS_EXPORTED_API ReturnCode_t unregister_content_filter_factory(
const char* filter_class_name);
FASTDDS_EXPORTED_API bool has_active_entities();
protected:
DomainParticipant(
const StatusMask& mask = StatusMask::all());
DomainParticipantImpl* impl_;
friend class DomainParticipantFactory;
friend class DomainParticipantImpl;
friend class ::dds::domain::DomainParticipant;
};
} // namespace dds
} // namespace fastdds
} // namespace eprosima
#endif // FASTDDS_DDS_DOMAIN__DOMAINPARTICIPANT_HPP