123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233 |
- #ifndef _FASTDDS_DOMAINPARTICIPANT_HPP_
- #define _FASTDDS_DOMAINPARTICIPANT_HPP_
- #include <fastrtps/attributes/ParticipantAttributes.h>
- #include <fastrtps/types/TypesBase.h>
- #include <fastdds/dds/domain/qos/DomainParticipantQos.hpp>
- #include <fastdds/dds/domain/qos/DomainParticipantFactoryQos.hpp>
- #include <fastdds/dds/core/status/StatusMask.hpp>
- #include <mutex>
- #include <map>
- using eprosima::fastrtps::types::ReturnCode_t;
- namespace eprosima {
- namespace fastdds {
- namespace dds {
- class DomainParticipantListener;
- class DomainParticipant;
- class DomainParticipantImpl;
- class DomainParticipantFactory
- {
- public:
-
- RTPS_DllAPI static DomainParticipantFactory* get_instance();
-
- RTPS_DllAPI DomainParticipant* create_participant(
- DomainId_t domain_id,
- const DomainParticipantQos& qos,
- DomainParticipantListener* listener = nullptr,
- const StatusMask& mask = StatusMask::all());
-
- RTPS_DllAPI DomainParticipant* create_participant_with_profile(
- DomainId_t domain_id,
- const std::string& profile_name,
- DomainParticipantListener* listener = nullptr,
- const StatusMask& mask = StatusMask::all());
-
- RTPS_DllAPI DomainParticipant* lookup_participant(
- DomainId_t domain_id) const;
-
- RTPS_DllAPI std::vector<DomainParticipant*> lookup_participants(
- DomainId_t domain_id) const;
-
- RTPS_DllAPI ReturnCode_t get_default_participant_qos(
- DomainParticipantQos& qos) const;
-
- RTPS_DllAPI const DomainParticipantQos& get_default_participant_qos() const;
-
- RTPS_DllAPI ReturnCode_t set_default_participant_qos(
- const DomainParticipantQos& qos);
-
- RTPS_DllAPI ReturnCode_t delete_participant(
- DomainParticipant* part);
-
- RTPS_DllAPI ReturnCode_t load_profiles();
-
- RTPS_DllAPI ReturnCode_t load_XML_profiles_file(
- const std::string& xml_profile_file);
-
- RTPS_DllAPI ReturnCode_t get_qos(
- DomainParticipantFactoryQos& qos) const;
-
- RTPS_DllAPI ReturnCode_t set_qos(
- const DomainParticipantFactoryQos& qos);
- private:
- friend class DomainParticipantFactoryReleaser;
- friend class DomainParticipant;
- std::map<DomainId_t, std::vector<DomainParticipantImpl*> > participants_;
- DomainParticipantFactory();
- virtual ~DomainParticipantFactory();
- void reset_default_participant_qos();
- static bool delete_instance();
- static void set_qos(
- DomainParticipantFactoryQos& to,
- const DomainParticipantFactoryQos& from,
- bool first_time);
- static ReturnCode_t check_qos(
- const DomainParticipantFactoryQos& qos);
- static bool can_qos_be_updated(
- const DomainParticipantFactoryQos& to,
- const DomainParticipantFactoryQos& from);
- void participant_has_been_deleted(
- DomainParticipantImpl* part);
- mutable std::mutex mtx_participants_;
- mutable bool default_xml_profiles_loaded;
- DomainParticipantFactoryQos factory_qos_;
- DomainParticipantQos default_participant_qos_;
- };
- }
- }
- }
- #endif
|