OpenDDS  Snapshot(2023/04/07-19:43)
Classes | Public Types | Public Member Functions | Private Types | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
OpenDDS::DCPS::DomainParticipantImpl Class Reference

Implements the OpenDDS::DCPS::DomainParticipant interfaces. More...

#include <DomainParticipantImpl.h>

Inheritance diagram for OpenDDS::DCPS::DomainParticipantImpl:
Inheritance graph
[legend]
Collaboration diagram for OpenDDS::DCPS::DomainParticipantImpl:
Collaboration graph
[legend]

Classes

class  AutomaticLivelinessTimer
 
class  LivelinessTimer
 
class  ParticipantLivelinessTimer
 
struct  RefCounted_Topic
 
class  RepoIdSequence
 

Public Types

typedef Objref_Servant_Pair< SubscriberImpl, DDS::Subscriber, DDS::Subscriber_ptr, DDS::Subscriber_var > Subscriber_Pair
 
typedef Objref_Servant_Pair< PublisherImpl, DDS::Publisher, DDS::Publisher_ptr, DDS::Publisher_var > Publisher_Pair
 
typedef Objref_Servant_Pair< TopicImpl, DDS::Topic, DDS::Topic_ptr, DDS::Topic_var > Topic_Pair
 
typedef TopicMap::iterator TopicMapIterator
 
typedef std::pair< TopicMapIterator, TopicMapIteratorTopicMapIteratorPair
 
- Public Types inherited from OpenDDS::DCPS::LocalObject< DDS::DomainParticipant >
typedef DDS::DomainParticipant ::_ptr_type _ptr_type
 
typedef DDS::DomainParticipant ::_var_type _var_type
 
- Public Types inherited from CORBA::LocalObject
typedef LocalObject_ptr _ptr_type
 
typedef LocalObject_var _var_type
 
typedef LocalObject_out _out_type
 
- Public Types inherited from CORBA::Object
typedef Object_ptr _ptr_type
 
typedef Object_var _var_type
 
typedef Object_out _out_type
 
- Public Types inherited from OpenDDS::DCPS::LocalObject< DDS::Entity >
typedef DDS::Entity ::_ptr_type _ptr_type
 
typedef DDS::Entity ::_var_type _var_type
 
- Public Types inherited from ACE_Event_Handler
typedef long Reference_Count
 

Public Member Functions

typedef OPENDDS_SET (Subscriber_Pair) SubscriberSet
 
typedef OPENDDS_SET (Publisher_Pair) PublisherSet
 
typedef OPENDDS_MULTIMAP (OPENDDS_STRING, RefCounted_Topic) TopicMap
 
typedef OPENDDS_MAP (OPENDDS_STRING, DDS::TopicDescription_var) TopicDescriptionMap
 
 DomainParticipantImpl (InstanceHandleGenerator &handle_generator, const DDS::DomainId_t &domain_id, const DDS::DomainParticipantQos &qos, DDS::DomainParticipantListener_ptr a_listener, const DDS::StatusMask &mask)
 
virtual ~DomainParticipantImpl ()
 
virtual DDS::InstanceHandle_t get_instance_handle ()
 
virtual DDS::Publisher_ptr create_publisher (const DDS::PublisherQos &qos, DDS::PublisherListener_ptr a_listener, DDS::StatusMask mask)
 
virtual DDS::ReturnCode_t delete_publisher (DDS::Publisher_ptr p)
 
virtual DDS::Subscriber_ptr create_subscriber (const DDS::SubscriberQos &qos, DDS::SubscriberListener_ptr a_listener, DDS::StatusMask mask)
 
virtual DDS::ReturnCode_t delete_subscriber (DDS::Subscriber_ptr s)
 
virtual DDS::Subscriber_ptr get_builtin_subscriber ()
 
RcHandle< DCPS::BitSubscriberget_builtin_subscriber_proxy ()
 
virtual DDS::Topic_ptr create_topic (const char *topic_name, const char *type_name, const DDS::TopicQos &qos, DDS::TopicListener_ptr a_listener, DDS::StatusMask mask)
 
virtual DDS::ReturnCode_t delete_topic (DDS::Topic_ptr a_topic)
 
virtual DDS::Topic_ptr find_topic (const char *topic_name, const DDS::Duration_t &timeout)
 
virtual DDS::TopicDescription_ptr lookup_topicdescription (const char *name)
 
virtual DDS::ContentFilteredTopic_ptr create_contentfilteredtopic (const char *name, DDS::Topic_ptr related_topic, const char *filter_expression, const DDS::StringSeq &expression_parameters)
 
virtual DDS::ReturnCode_t delete_contentfilteredtopic (DDS::ContentFilteredTopic_ptr a_contentfilteredtopic)
 
virtual DDS::MultiTopic_ptr create_multitopic (const char *name, const char *type_name, const char *subscription_expression, const DDS::StringSeq &expression_parameters)
 
virtual DDS::ReturnCode_t delete_multitopic (DDS::MultiTopic_ptr a_multitopic)
 
RcHandle< FilterEvaluatorget_filter_eval (const char *filter)
 
void deref_filter_eval (const char *filter)
 
virtual DDS::ReturnCode_t delete_contained_entities ()
 
virtual CORBA::Boolean contains_entity (DDS::InstanceHandle_t a_handle)
 
virtual DDS::ReturnCode_t set_qos (const DDS::DomainParticipantQos &qos)
 
virtual DDS::ReturnCode_t get_qos (DDS::DomainParticipantQos &qos)
 
virtual DDS::ReturnCode_t set_listener (DDS::DomainParticipantListener_ptr a_listener, DDS::StatusMask mask)
 
virtual DDS::DomainParticipantListener_ptr get_listener ()
 
virtual DDS::ReturnCode_t ignore_participant (DDS::InstanceHandle_t handle)
 
virtual DDS::ReturnCode_t ignore_topic (DDS::InstanceHandle_t handle)
 
virtual DDS::ReturnCode_t ignore_publication (DDS::InstanceHandle_t handle)
 
virtual DDS::ReturnCode_t ignore_subscription (DDS::InstanceHandle_t handle)
 
virtual DDS::DomainId_t get_domain_id ()
 
virtual DDS::ReturnCode_t assert_liveliness ()
 
virtual DDS::ReturnCode_t set_default_publisher_qos (const DDS::PublisherQos &qos)
 
virtual DDS::ReturnCode_t get_default_publisher_qos (DDS::PublisherQos &qos)
 
virtual DDS::ReturnCode_t set_default_subscriber_qos (const DDS::SubscriberQos &qos)
 
virtual DDS::ReturnCode_t get_default_subscriber_qos (DDS::SubscriberQos &qos)
 
virtual DDS::ReturnCode_t set_default_topic_qos (const DDS::TopicQos &qos)
 
virtual DDS::ReturnCode_t get_default_topic_qos (DDS::TopicQos &qos)
 
virtual DDS::ReturnCode_t get_current_time (DDS::Time_t &current_time)
 
virtual DDS::ReturnCode_t get_discovered_participants (DDS::InstanceHandleSeq &participant_handles)
 
virtual DDS::ReturnCode_t get_discovered_participant_data (DDS::ParticipantBuiltinTopicData &participant_data, DDS::InstanceHandle_t participant_handle)
 
virtual DDS::ReturnCode_t get_discovered_topics (DDS::InstanceHandleSeq &topic_handles)
 
virtual DDS::ReturnCode_t get_discovered_topic_data (DDS::TopicBuiltinTopicData &topic_data, DDS::InstanceHandle_t topic_handle)
 
virtual DDS::ReturnCode_t enable ()
 
GUID_t get_id () const
 
OPENDDS_STRING get_unique_id ()
 
DDS::InstanceHandle_t assign_handle (const GUID_t &id=GUID_UNKNOWN)
 
DDS::InstanceHandle_t lookup_handle (const GUID_t &id) const
 
DDS::InstanceHandle_t await_handle (const GUID_t &id, TimeDuration max_wait=TimeDuration::zero_value) const
 
void return_handle (DDS::InstanceHandle_t handle)
 
GUID_t get_repoid (DDS::InstanceHandle_t id) const
 
bool is_clean (String *leftover_entities=0) const
 
DDS::DomainParticipantListener_ptr listener_for (DDS::StatusKind kind)
 
typedef OPENDDS_VECTOR (GUID_t) TopicIdVec
 
void get_topic_ids (TopicIdVec &topics)
 
OwnershipManagerownership_manager ()
 
void update_ownership_strength (const GUID_t &pub_id, const CORBA::Long &ownership_strength)
 
bool federated () const
 
Recorder_ptr create_recorder (DDS::Topic_ptr a_topic, const DDS::SubscriberQos &subscriber_qos, const DDS::DataReaderQos &datareader_qos, const RecorderListener_rch &a_listener, DDS::StatusMask mask)
 
Replayer_ptr create_replayer (DDS::Topic_ptr a_topic, const DDS::PublisherQos &publisher_qos, const DDS::DataWriterQos &datawriter_qos, const ReplayerListener_rch &a_listener, DDS::StatusMask mask)
 
DDS::Topic_ptr create_typeless_topic (const char *topic_name, const char *type_name, bool type_has_keys, const DDS::TopicQos &qos, DDS::TopicListener_ptr a_listener, DDS::StatusMask mask)
 
void delete_recorder (Recorder_ptr recorder)
 
void delete_replayer (Replayer_ptr replayer)
 
void add_adjust_liveliness_timers (DataWriterImpl *writer)
 
void remove_adjust_liveliness_timers ()
 
XTypes::TypeLookupService_rch get_type_lookup_service ()
 
Security::SecurityConfig_rch get_security_config () const
 
DDS::Security::PermissionsHandle permissions_handle () const
 
DDS::Security::ParticipantCryptoHandle crypto_handle () const
 
bool prepare_to_delete_datawriters ()
 
bool set_wait_pending_deadline (const MonotonicTimePoint &deadline)
 
DDS::ReturnCode_t get_dynamic_type (DDS::DynamicType_var &type, const DDS::BuiltinTopicKey_t &key)
 
- Public Member Functions inherited from DDS::DomainParticipant
Publisher create_publisher (in PublisherQos qos, in PublisherListener a_listener, in StatusMask mask)
 
ReturnCode_t delete_publisher (in Publisher p)
 
Subscriber create_subscriber (in SubscriberQos qos, in SubscriberListener a_listener, in StatusMask mask)
 
ReturnCode_t delete_subscriber (in Subscriber s)
 
Topic create_topic (in string topic_name, in string type_name, in TopicQos qos, in TopicListener a_listener, in StatusMask mask)
 
ReturnCode_t delete_topic (in Topic a_topic)
 
Topic find_topic (in string topic_name, in Duration_t timeout)
 
TopicDescription lookup_topicdescription (in string name)
 
ContentFilteredTopic create_contentfilteredtopic (in string name, in Topic related_topic, in string filter_expression, in StringSeq expression_parameters)
 
ReturnCode_t delete_contentfilteredtopic (in ContentFilteredTopic a_contentfilteredtopic)
 
MultiTopic create_multitopic (in string name, in string type_name, in string subscription_expression, in StringSeq expression_parameters)
 
ReturnCode_t delete_multitopic (in MultiTopic a_multitopic)
 
boolean contains_entity (in InstanceHandle_t a_handle)
 
ReturnCode_t set_qos (in DomainParticipantQos qos)
 
ReturnCode_t get_qos (inout DomainParticipantQos qos)
 
ReturnCode_t set_listener (in DomainParticipantListener a_listener, in StatusMask mask)
 
ReturnCode_t ignore_participant (in InstanceHandle_t handle)
 
ReturnCode_t ignore_topic (in InstanceHandle_t handle)
 
ReturnCode_t ignore_publication (in InstanceHandle_t handle)
 
ReturnCode_t ignore_subscription (in InstanceHandle_t handle)
 
ReturnCode_t set_default_publisher_qos (in PublisherQos qos)
 
ReturnCode_t get_default_publisher_qos (inout PublisherQos qos)
 
ReturnCode_t set_default_subscriber_qos (in SubscriberQos qos)
 
ReturnCode_t get_default_subscriber_qos (inout SubscriberQos qos)
 
ReturnCode_t set_default_topic_qos (in TopicQos qos)
 
ReturnCode_t get_default_topic_qos (inout TopicQos qos)
 
ReturnCode_t get_current_time (inout Time_t current_time)
 
ReturnCode_t get_discovered_participants (inout InstanceHandleSeq participant_handles)
 
ReturnCode_t get_discovered_participant_data (inout ParticipantBuiltinTopicData participant_data, in InstanceHandle_t participant_handle)
 
ReturnCode_t get_discovered_topics (inout InstanceHandleSeq topic_handles)
 
ReturnCode_t get_discovered_topic_data (inout TopicBuiltinTopicData topic_data, in InstanceHandle_t topic_handle)
 
- Public Member Functions inherited from OpenDDS::DCPS::LocalObjectBase
virtual void _add_ref ()
 
virtual void _remove_ref ()
 
virtual CORBA::ULong _refcount_value () const
 
- Public Member Functions inherited from CORBA::LocalObject
virtual ~LocalObject (void)
 
virtual CORBA::Boolean _non_existent (void)
 
virtual char * _repository_id (void)
 
virtual CORBA::InterfaceDef_ptr _get_interface (void)
 
virtual CORBA::Object_ptr _get_component (void)
 
virtual void _create_request (CORBA::Context_ptr ctx, const char *operation, CORBA::NVList_ptr arg_list, CORBA::NamedValue_ptr result, CORBA::Request_ptr &request, CORBA::Flags req_flags)
 
virtual void _create_request (CORBA::Context_ptr ctx, const char *operation, CORBA::NVList_ptr arg_list, CORBA::NamedValue_ptr result, CORBA::ExceptionList_ptr exclist, CORBA::ContextList_ptr ctxtlist, CORBA::Request_ptr &request, CORBA::Flags req_flags)
 
virtual CORBA::Request_ptr _request (const char *operation)
 
CORBA::Policy_ptr _get_policy (CORBA::PolicyType type)
 
CORBA::Policy_ptr _get_cached_policy (TAO_Cached_Policy_Type type)
 
CORBA::Object_ptr _set_policy_overrides (const CORBA::PolicyList &policies, CORBA::SetOverrideType set_add)
 
CORBA::PolicyList_get_policy_overrides (const CORBA::PolicyTypeSeq &types)
 
CORBA::Boolean _validate_connection (CORBA::PolicyList_out inconsistent_policies)
 
virtual CORBA::ULong _hash (CORBA::ULong maximum)
 
virtual CORBA::Boolean _is_equivalent (CORBA::Object_ptr other_obj)
 
virtual CORBA::ORB_ptr _get_orb (void)
 
virtual TAO::ObjectKey_key (void)
 
- Public Member Functions inherited from CORBA::Object
virtual ~Object (void)
 
virtual TAO_Abstract_ServantBase_servant (void) const
 
virtual CORBA::Boolean _is_collocated (void) const
 
virtual CORBA::Boolean _is_local (void) const
 
 Object (TAO_Stub *p, CORBA::Boolean collocated=false, TAO_Abstract_ServantBase *servant=0, TAO_ORB_Core *orb_core=0)
 
 Object (IOP::IOR *ior, TAO_ORB_Core *orb_core)
 
virtual TAO_Stub_stubobj (void) const
 
virtual TAO_Stub_stubobj (void)
 
virtual void _proxy_broker (TAO::Object_Proxy_Broker *proxy_broker)
 
virtual CORBA::Boolean marshal (TAO_OutputCDR &cdr)
 
CORBA::Boolean is_evaluated (void) const
 
TAO_ORB_Coreorb_core (void) const
 
IOP::IORsteal_ior (void)
 
const IOP::IORior (void) const
 
virtual bool can_convert_to_ior (void) const
 
virtual char * convert_to_ior (bool use_omg_ior_format, const char *ior_prefix) const
 
void _decr_refcount (void)
 
virtual CORBA::Boolean _is_a (const char *logical_type_id)
 
virtual const char * _interface_repository_id (void) const
 
CORBA::Policy_ptr _get_policy (CORBA::PolicyType type)
 
CORBA::Policy_ptr _get_cached_policy (TAO_Cached_Policy_Type type)
 
CORBA::Object_ptr _set_policy_overrides (const CORBA::PolicyList &policies, CORBA::SetOverrideType set_add)
 
CORBA::PolicyList_get_policy_overrides (const CORBA::PolicyTypeSeq &types)
 
CORBA::Boolean _validate_connection (CORBA::PolicyList_out inconsistent_policies)
 
- Public Member Functions inherited from OpenDDS::DCPS::RcObject
virtual ~RcObject ()
 
long ref_count () const
 
WeakObject_get_weak_object () const
 
- Public Member Functions inherited from OpenDDS::DCPS::EntityImpl
 EntityImpl ()
 
virtual ~EntityImpl ()
 
bool is_enabled () const
 
virtual DDS::StatusCondition_ptr get_statuscondition ()
 
virtual DDS::StatusMask get_status_changes ()
 
void set_status_changed_flag (DDS::StatusKind status, bool status_changed_flag)
 
void notify_status_condition ()
 
virtual void transport_config (const TransportConfig_rch &cfg)
 
TransportConfig_rch transport_config () const
 
virtual RcHandle< EntityImplparent () const
 
void set_observer (Observer_rch observer, Observer::Event e)
 
Observer_rch get_observer (Observer::Event e)
 
- Public Member Functions inherited from ACE_Event_Handler
virtual ~ACE_Event_Handler (void)
 
virtual ACE_HANDLE get_handle (void) const
 
virtual void set_handle (ACE_HANDLE)
 
virtual int priority (void) const
 
virtual void priority (int priority)
 
virtual int handle_input (ACE_HANDLE fd=ACE_INVALID_HANDLE)
 
virtual int handle_output (ACE_HANDLE fd=ACE_INVALID_HANDLE)
 
virtual int handle_timeout (const ACE_Time_Value &current_time, const void *act=0)
 
virtual int handle_exit (ACE_Process *)
 
virtual int handle_close (ACE_HANDLE handle, ACE_Reactor_Mask close_mask)
 
virtual int handle_signal (int signum, siginfo_t *=0, ucontext_t *=0)
 
virtual int resume_handler (void)
 
virtual int handle_qos (ACE_HANDLE=ACE_INVALID_HANDLE)
 
virtual int handle_group_qos (ACE_HANDLE=ACE_INVALID_HANDLE)
 
virtual void reactor (ACE_Reactor *reactor)
 
virtual ACE_Reactorreactor (void) const
 
virtual ACE_Reactor_Timer_Interfacereactor_timer_interface (void) const
 
virtual Reference_Count add_reference (void)
 
virtual Reference_Count remove_reference (void)
 
Reference_Counting_Policyreference_counting_policy (void)
 

Private Types

typedef std::pair< DDS::InstanceHandle_t, unsigned int > HandleWithCounter
 
typedef PmfSporadicTask< AutomaticLivelinessTimerAutomaticLivelinessTask
 
typedef PmfSporadicTask< ParticipantLivelinessTimerParticipantLivelinessTask
 

Private Member Functions

bool validate_publisher_qos (DDS::PublisherQos &publisher_qos)
 
bool validate_subscriber_qos (DDS::SubscriberQos &subscriber_qos)
 
DDS::Topic_ptr create_topic_i (const char *topic_name, const char *type_name, const DDS::TopicQos &qos, DDS::TopicListener_ptr a_listener, DDS::StatusMask mask, int topic_mask)
 
DDS::Topic_ptr create_new_topic (const char *topic_name, const char *type_name, const DDS::TopicQos &qos, DDS::TopicListener_ptr a_listener, const DDS::StatusMask &mask, OpenDDS::DCPS::TypeSupport_ptr type_support)
 
DDS::ReturnCode_t delete_topic_i (DDS::Topic_ptr a_topic, bool remove_objref)
 
typedef OPENDDS_MAP_CMP (GUID_t, HandleWithCounter, GUID_tKeyLessThan) CountedHandleMap
 
typedef OPENDDS_MAP (DDS::InstanceHandle_t, GUID_t) RepoIdMap
 
typedef OPENDDS_MAP_CMP (GUID_t, DDS::InstanceHandle_t, GUID_tKeyLessThan) HandleMap
 
 OPENDDS_MAP (OPENDDS_STRING, RcHandle< FilterEvaluator >) filter_cache_
 
typedef OPENDDS_SET_CMP (Recorder_var, VarLess< Recorder >) RecorderSet
 
typedef OPENDDS_SET_CMP (Replayer_var, VarLess< Replayer >) ReplayerSet
 
TimeDuration liveliness_check_interval (DDS::LivelinessQosPolicyKind kind)
 
bool participant_liveliness_activity_after (const MonotonicTimePoint &tv)
 
void signal_liveliness (DDS::LivelinessQosPolicyKind kind)
 
virtual int handle_exception (ACE_HANDLE fd)
 

Private Attributes

DDS::TopicQos default_topic_qos_
 The default topic qos. More...
 
DDS::PublisherQos default_publisher_qos_
 The default publisher qos. More...
 
DDS::SubscriberQos default_subscriber_qos_
 The default subscriber qos. More...
 
DDS::DomainParticipantQos qos_
 The qos of this DomainParticipant. More...
 
ACE_Thread_Mutex listener_mutex_
 Mutex to protect listener info. More...
 
DDS::DomainParticipantListener_var listener_
 Used to notify the entity for relevant events. More...
 
DDS::StatusMask listener_mask_
 
DDS::Security::IdentityHandle id_handle_
 This participant id handle given by authentication. More...
 
DDS::Security::PermissionsHandle perm_handle_
 This participant permissions handle given by access constrol. More...
 
DDS::Security::ParticipantCryptoHandle part_crypto_handle_
 This participant crypto handle given by crypto. More...
 
const DDS::DomainId_t domain_id_
 The id of the domain that creates this participant. More...
 
GUID_t dp_id_
 This participant id given by discovery. More...
 
bool federated_
 
PublisherSet publishers_
 Collection of publishers. More...
 
SubscriberSet subscribers_
 Collection of subscribers. More...
 
TopicMap topics_
 Collection of topics. More...
 
TopicDescriptionMap topic_descrs_
 Collection of TopicDescriptions which are not also Topics. More...
 
CountedHandleMap handles_
 Instance handles assigned which are mapped to GUIDs (use handle_protector_) More...
 
RepoIdMap repoIds_
 By-handle lookup of instance handles assigned to GUIDs (use handle_protector_) More...
 
HandleMap ignored_participants_
 Collection of ignored participants. More...
 
HandleMap ignored_topics_
 Collection of ignored topics. More...
 
ACE_Recursive_Thread_Mutex publishers_protector_
 Protect the publisher collection. More...
 
ACE_Recursive_Thread_Mutex subscribers_protector_
 Protect the subscriber collection. More...
 
ACE_Recursive_Thread_Mutex topics_protector_
 Protect the topic collection. More...
 
ACE_Thread_Mutex handle_protector_
 Protect the handle collection. More...
 
ConditionVariable< ACE_Thread_Mutexhandle_waiters_
 
ACE_Thread_Mutex shutdown_mutex_
 Protect the shutdown. More...
 
ConditionVariable< ACE_Thread_Mutexshutdown_condition_
 
DDS::ReturnCode_t shutdown_result_
 
bool shutdown_complete_
 
RcHandle< BitSubscriberbit_subscriber_
 The built in topic subscriber. More...
 
InstanceHandleGeneratorparticipant_handles_
 Get instances handles from DomainParticipantFactory (use handle_protector_) More...
 
DisjointSequence::OrderedRanges< DDS::InstanceHandle_treusable_handles_
 Keep track of handles that can be reused (use handle_protector_) More...
 
unique_ptr< Monitormonitor_
 
OwnershipManager owner_man_
 
RepoIdSequence pub_id_gen_
 Publisher ID generator. More...
 
ACE_Thread_Mutex filter_cache_lock_
 
RecorderSet recorders_
 
ReplayerSet replayers_
 
Security::SecurityConfig_rch security_config_
 
ACE_Recursive_Thread_Mutex recorders_protector_
 Protect the recorders collection. More...
 
ACE_Recursive_Thread_Mutex replayers_protector_
 Protect the replayers collection. More...
 
RcHandle< AutomaticLivelinessTimerautomatic_liveliness_timer_
 
RcHandle< AutomaticLivelinessTaskautomatic_liveliness_task_
 
RcHandle< ParticipantLivelinessTimerparticipant_liveliness_timer_
 
RcHandle< ParticipantLivelinessTaskparticipant_liveliness_task_
 
MonotonicTimePoint last_liveliness_activity_
 
XTypes::TypeLookupService_rch type_lookup_service_
 

Static Private Attributes

static const int TOPIC_TYPE_HAS_KEYS = 1
 
static const int TOPIC_TYPELESS = 2
 

Additional Inherited Members

- Static Public Member Functions inherited from OpenDDS::DCPS::LocalObject< DDS::DomainParticipant >
static _ptr_type _narrow (CORBA::Object_ptr obj)
 
- Static Public Member Functions inherited from CORBA::LocalObject
static LocalObject_ptr _duplicate (LocalObject_ptr obj)
 
static LocalObject_ptr _nil (void)
 
static LocalObject_ptr _narrow (CORBA::Object_ptr obj)
 
- Static Public Member Functions inherited from CORBA::Object
static CORBA::Boolean marshal (const Object_ptr x, TAO_OutputCDR &cdr)
 
static void _tao_any_destructor (void *)
 
static CORBA::Boolean is_nil_i (CORBA::Object_ptr obj)
 
static void tao_object_initialize (Object *)
 
static CORBA::Object_ptr _duplicate (CORBA::Object_ptr obj)
 
static CORBA::Object_ptr _nil (void)
 
static CORBA::Object_ptr _narrow (CORBA::Object_ptr obj)
 
- Static Public Member Functions inherited from OpenDDS::DCPS::LocalObject< DDS::Entity >
static _ptr_type _narrow (CORBA::Object_ptr obj)
 
- Static Public Member Functions inherited from ACE_Event_Handler
static ACE_THR_FUNC_RETURN read_adapter (void *event_handler)
 
static int register_stdin_handler (ACE_Event_Handler *eh, ACE_Reactor *reactor, ACE_Thread_Manager *thr_mgr, int flags=THR_DETACHED)
 
static int remove_stdin_handler (ACE_Reactor *reactor, ACE_Thread_Manager *thr_mgr)
 
- Public Attributes inherited from ACE_Event_Handler
 LO_PRIORITY
 
 HI_PRIORITY
 
 NULL_MASK
 
 READ_MASK
 
 WRITE_MASK
 
 EXCEPT_MASK
 
 ACCEPT_MASK
 
 CONNECT_MASK
 
 TIMER_MASK
 
 QOS_MASK
 
 GROUP_QOS_MASK
 
 SIGNAL_MASK
 
 ALL_EVENTS_MASK
 
 RWE_MASK
 
 DONT_CALL
 
 ACE_EVENT_HANDLER_NOT_RESUMED
 
 ACE_REACTOR_RESUMES_HANDLER
 
 ACE_APPLICATION_RESUMES_HANDLER
 
- Protected Types inherited from ACE_Event_Handler
typedef ACE_Atomic_Op< ACE_SYNCH_MUTEX, Reference_CountAtomic_Reference_Count
 
- Protected Member Functions inherited from CORBA::LocalObject
 LocalObject (void)
 
- Protected Member Functions inherited from CORBA::Object
 Object (int dummy=0)
 
TAO::Object_Proxy_Brokerproxy_broker () const
 
- Protected Member Functions inherited from OpenDDS::DCPS::RcObject
 RcObject ()
 
- Protected Member Functions inherited from OpenDDS::DCPS::EntityImpl
DDS::ReturnCode_t set_enabled ()
 
void set_deleted (bool state)
 
bool get_deleted () const
 
DDS::InstanceHandle_t get_entity_instance_handle (const GUID_t &id, const RcHandle< DomainParticipantImpl > &participant)
 
- Protected Member Functions inherited from ACE_Event_Handler
 ACE_Event_Handler (ACE_Reactor *=0, int priority=ACE_Event_Handler::LO_PRIORITY)
 
- Protected Attributes inherited from CORBA::Object
ACE_Atomic_Op< TAO_SYNCH_MUTEX, unsigned long > refcount_
 
- Protected Attributes inherited from OpenDDS::DCPS::EntityImpl
AtomicBool enabled_
 The flag indicates the entity is enabled. More...
 
AtomicBool entity_deleted_
 The flag indicates the entity is being deleted. More...
 
- Protected Attributes inherited from ACE_Event_Handler
Atomic_Reference_Count reference_count_
 

Detailed Description

Implements the OpenDDS::DCPS::DomainParticipant interfaces.

This class acts as an entrypoint of the service and a factory for publisher, subscriber and topic. It also acts as a container for the publisher, subscriber and topic objects.

See the DDS specification, OMG formal/2015-04-10, for a description of the interface this class is implementing.

Definition at line 77 of file DomainParticipantImpl.h.

Member Typedef Documentation

◆ AutomaticLivelinessTask

Definition at line 622 of file DomainParticipantImpl.h.

◆ HandleWithCounter

Definition at line 509 of file DomainParticipantImpl.h.

◆ ParticipantLivelinessTask

Definition at line 642 of file DomainParticipantImpl.h.

◆ Publisher_Pair

Definition at line 87 of file DomainParticipantImpl.h.

◆ Subscriber_Pair

Definition at line 84 of file DomainParticipantImpl.h.

◆ Topic_Pair

Definition at line 90 of file DomainParticipantImpl.h.

◆ TopicMapIterator

Definition at line 124 of file DomainParticipantImpl.h.

◆ TopicMapIteratorPair

Definition at line 125 of file DomainParticipantImpl.h.

Constructor & Destructor Documentation

◆ DomainParticipantImpl()

OpenDDS::DCPS::DomainParticipantImpl::DomainParticipantImpl ( InstanceHandleGenerator handle_generator,
const DDS::DomainId_t domain_id,
const DDS::DomainParticipantQos qos,
DDS::DomainParticipantListener_ptr  a_listener,
const DDS::StatusMask mask 
)

Definition at line 92 of file DomainParticipantImpl.cpp.

References monitor_, set_listener(), TheServiceParticipant, and type_lookup_service_.

98  : default_topic_qos_(TheServiceParticipant->initial_TopicQos())
99  , default_publisher_qos_(TheServiceParticipant->initial_PublisherQos())
100  , default_subscriber_qos_(TheServiceParticipant->initial_SubscriberQos())
101  , qos_(qos)
102 #ifdef OPENDDS_SECURITY
106 #endif
107  , domain_id_(domain_id)
109  , federated_(false)
112  , shutdown_complete_(false)
113  , participant_handles_(handle_generator)
115  , automatic_liveliness_timer_(make_rch<AutomaticLivelinessTimer>(ref(*this)))
116  , automatic_liveliness_task_(make_rch<AutomaticLivelinessTask>(
117  TheServiceParticipant->time_source(),
118  TheServiceParticipant->interceptor(),
121  , participant_liveliness_timer_(make_rch<ParticipantLivelinessTimer>(ref(*this)))
122  , participant_liveliness_task_(make_rch<ParticipantLivelinessTask>(
123  TheServiceParticipant->time_source(),
124  TheServiceParticipant->interceptor(),
127 {
128  (void) this->set_listener(a_listener, mask);
129  monitor_.reset(TheServiceParticipant->monitor_factory_->create_dp_monitor(this));
130  type_lookup_service_ = make_rch<XTypes::TypeLookupService>();
131 }
GUID_t dp_id_
This participant id given by discovery.
virtual DDS::ReturnCode_t set_listener(DDS::DomainParticipantListener_ptr a_listener, DDS::StatusMask mask)
RcHandle< AutomaticLivelinessTimer > automatic_liveliness_timer_
RcHandle< AutomaticLivelinessTask > automatic_liveliness_task_
reference_wrapper< T > ref(T &r)
Definition: RcHandle_T.h:237
const InstanceHandle_t HANDLE_NIL
const GUID_t GUID_UNKNOWN
Nil value for GUID.
Definition: GuidUtils.h:59
const DDS::DomainId_t domain_id_
The id of the domain that creates this participant.
RcHandle< ParticipantLivelinessTimer > participant_liveliness_timer_
DDS::TopicQos default_topic_qos_
The default topic qos.
ConditionVariable< ACE_Thread_Mutex > handle_waiters_
XTypes::TypeLookupService_rch type_lookup_service_
InstanceHandleGenerator & participant_handles_
Get instances handles from DomainParticipantFactory (use handle_protector_)
DDS::Security::ParticipantCryptoHandle part_crypto_handle_
This participant crypto handle given by crypto.
DDS::Security::IdentityHandle id_handle_
This participant id handle given by authentication.
ConditionVariable< ACE_Thread_Mutex > shutdown_condition_
DDS::Security::PermissionsHandle perm_handle_
This participant permissions handle given by access constrol.
DDS::PublisherQos default_publisher_qos_
The default publisher qos.
RepoIdSequence pub_id_gen_
Publisher ID generator.
#define TheServiceParticipant
RcHandle< ParticipantLivelinessTask > participant_liveliness_task_
ACE_Thread_Mutex shutdown_mutex_
Protect the shutdown.
DDS::SubscriberQos default_subscriber_qos_
The default subscriber qos.
DDS::DomainParticipantQos qos_
The qos of this DomainParticipant.
ACE_Thread_Mutex handle_protector_
Protect the handle collection.

◆ ~DomainParticipantImpl()

OpenDDS::DCPS::DomainParticipantImpl::~DomainParticipantImpl ( )
virtual

Definition at line 133 of file DomainParticipantImpl.cpp.

References access(), ACE_ERROR, ACE_TEXT(), DDS::Security::SecurityException::code, DDS::HANDLE_NIL, LM_ERROR, DDS::Security::SecurityException::message, DDS::Security::SecurityException::minor_code, perm_handle_, security_config_, and OpenDDS::DCPS::security_debug.

134 {
135 #ifdef OPENDDS_SECURITY
137  Security::AccessControl_var access = security_config_->get_access_control();
139  if (!access->return_permissions_handle(perm_handle_, se)) {
140  if (DCPS::security_debug.auth_warn) {
141  ACE_ERROR((LM_ERROR,
142  ACE_TEXT("(%P|%t) ERROR: DomainParticipantImpl::~DomainParticipantImpl: ")
143  ACE_TEXT("Unable to return permissions handle. SecurityException[%d.%d]: %C\n"),
144  se.code, se.minor_code, se.message.in()));
145  }
146  }
147  }
148 #endif
149 
150 }
#define ACE_ERROR(X)
int access(const char *path, int amode)
const InstanceHandle_t HANDLE_NIL
Security::SecurityConfig_rch security_config_
ACE_TEXT("TCP_Factory")
DDS::Security::PermissionsHandle perm_handle_
This participant permissions handle given by access constrol.
OpenDDS_Dcps_Export SecurityDebug security_debug
Definition: debug.cpp:32

Member Function Documentation

◆ add_adjust_liveliness_timers()

void OpenDDS::DCPS::DomainParticipantImpl::add_adjust_liveliness_timers ( DataWriterImpl writer)

Definition at line 2307 of file DomainParticipantImpl.cpp.

References automatic_liveliness_timer_, and participant_liveliness_timer_.

2308 {
2309  automatic_liveliness_timer_->add_adjust(writer);
2310  participant_liveliness_timer_->add_adjust(writer);
2311 }
RcHandle< AutomaticLivelinessTimer > automatic_liveliness_timer_
RcHandle< ParticipantLivelinessTimer > participant_liveliness_timer_

◆ assert_liveliness()

DDS::ReturnCode_t OpenDDS::DCPS::DomainParticipantImpl::assert_liveliness ( )
virtual

Implements DDS::DomainParticipant.

Definition at line 1425 of file DomainParticipantImpl.cpp.

References ACE_GUARD_RETURN, last_liveliness_activity_, publishers_, publishers_protector_, DDS::RETCODE_ERROR, DDS::RETCODE_OK, and OpenDDS::DCPS::TimePoint_T< AceClock >::set_to_now().

1426 {
1427  // This operation needs to only be used if the DomainParticipant contains
1428  // DataWriter entities with the LIVELINESS set to MANUAL_BY_PARTICIPANT and
1429  // it only affects the liveliness of those DataWriter entities. Otherwise,
1430  // it has no effect.
1431  // This will do nothing in current implementation since we only
1432  // support the AUTOMATIC liveliness qos for datawriter.
1433  // Add implementation here.
1434 
1436  tao_mon,
1437  this->publishers_protector_,
1439 
1440  for (PublisherSet::iterator it(publishers_.begin());
1441  it != publishers_.end(); ++it) {
1442  it->svt_->assert_liveliness_by_participant();
1443  }
1444 
1446 
1447  return DDS::RETCODE_OK;
1448 }
const ReturnCode_t RETCODE_OK
PublisherSet publishers_
Collection of publishers.
#define ACE_GUARD_RETURN(MUTEX, OBJ, LOCK, RETURN)
const ReturnCode_t RETCODE_ERROR
ACE_Recursive_Thread_Mutex publishers_protector_
Protect the publisher collection.

◆ assign_handle()

DDS::InstanceHandle_t OpenDDS::DCPS::DomainParticipantImpl::assign_handle ( const GUID_t id = GUID_UNKNOWN)

Assign an instance handle, optionally representing a GUID. If a GUID is provided (not GUID_UNKNOWN), other calls to assign_handle for this GUID will return the same handle, as will subsequent calls to lookup_handle.

If this method returns a valid (non-HANDLE_NIL) handle, it must be returned by calling return_handle.

Definition at line 1842 of file DomainParticipantImpl.cpp.

References ACE_DEBUG, ACE_GUARD_RETURN, OpenDDS::DCPS::DCPS_debug_level, OpenDDS::DCPS::DisjointSequence::OrderedRanges< T >::empty(), OpenDDS::DCPS::GUID_UNKNOWN, DDS::HANDLE_NIL, handle_protector_, handle_waiters_, handles_, LM_DEBUG, OpenDDS::DCPS::InstanceHandleGenerator::next(), OpenDDS::DCPS::ConditionVariable< Mutex >::notify_all(), participant_handles_, OpenDDS::DCPS::DisjointSequence::OrderedRanges< T >::pop_front(), repoIds_, and reusable_handles_.

Referenced by OpenDDS::DCPS::RecorderImpl::add_association(), OpenDDS::DCPS::ReplayerImpl::association_complete_i(), create_publisher(), and create_subscriber().

1843 {
1845  if (id == GUID_UNKNOWN) {
1846  const DDS::InstanceHandle_t ih =
1848  if (DCPS_debug_level > 5) {
1849  ACE_DEBUG((LM_DEBUG, "(%P|%t) DomainParticipantImpl::assign_handle: "
1850  "New unmapped InstanceHandle %d\n", ih));
1851  }
1852  return ih;
1853  }
1854 
1855  const CountedHandleMap::iterator location = handles_.find(id);
1856  if (location == handles_.end()) {
1857  const DDS::InstanceHandle_t handle =
1859  if (DCPS_debug_level > 5) {
1860  ACE_DEBUG((LM_DEBUG, "(%P|%t) DomainParticipantImpl::assign_handle: "
1861  "New mapped InstanceHandle %d for %C\n",
1862  handle, LogGuid(id).c_str()));
1863  }
1864  handles_[id] = std::make_pair(handle, 1);
1865  repoIds_[handle] = id;
1867  return handle;
1868  }
1869 
1870  HandleWithCounter& mapped = location->second;
1871  ++mapped.second;
1872  if (DCPS_debug_level > 5) {
1873  ACE_DEBUG((LM_DEBUG, "(%P|%t) DomainParticipantImpl::assign_handle: "
1874  "Incremented refcount for InstanceHandle %d to %d\n",
1875  mapped.first, mapped.second));
1876  }
1877  return mapped.first;
1878 }
#define ACE_DEBUG(X)
const InstanceHandle_t HANDLE_NIL
const GUID_t GUID_UNKNOWN
Nil value for GUID.
Definition: GuidUtils.h:59
std::pair< DDS::InstanceHandle_t, unsigned int > HandleWithCounter
bool notify_all()
Unblock all of the threads waiting on this condition.
ConditionVariable< ACE_Thread_Mutex > handle_waiters_
InstanceHandleGenerator & participant_handles_
Get instances handles from DomainParticipantFactory (use handle_protector_)
#define ACE_GUARD_RETURN(MUTEX, OBJ, LOCK, RETURN)
DisjointSequence::OrderedRanges< DDS::InstanceHandle_t > reusable_handles_
Keep track of handles that can be reused (use handle_protector_)
OpenDDS_Dcps_Export unsigned int DCPS_debug_level
Definition: debug.cpp:30
RepoIdMap repoIds_
By-handle lookup of instance handles assigned to GUIDs (use handle_protector_)
HANDLE_TYPE_NATIVE InstanceHandle_t
Definition: DdsDcpsCore.idl:51
CountedHandleMap handles_
Instance handles assigned which are mapped to GUIDs (use handle_protector_)
ACE_Thread_Mutex handle_protector_
Protect the handle collection.

◆ await_handle()

DDS::InstanceHandle_t OpenDDS::DCPS::DomainParticipantImpl::await_handle ( const GUID_t id,
TimeDuration  max_wait = TimeDuration::zero_value 
) const

Similar to lookup_handle in that it will return a previously mapped handle, but will coorindate with assign_handle when a desired handle has not yet been mapped, but is expected to be. The optional max_wait argument can be supplied to limit the time spent waiting for a handle. If the wait times out, a value of HANDLE_NIL is returned.

Definition at line 1880 of file DomainParticipantImpl.cpp.

References ACE_GUARD_RETURN, OpenDDS::DCPS::CvStatus_NoTimeout, DDS::HANDLE_NIL, handle_protector_, handle_waiters_, handles_, OpenDDS::DCPS::TimeDuration::is_zero(), OpenDDS::DCPS::TimePoint_T< MonotonicClock >::now(), TheServiceParticipant, OpenDDS::DCPS::ConditionVariable< Mutex >::wait(), and OpenDDS::DCPS::ConditionVariable< Mutex >::wait_until().

1882 {
1883  MonotonicTimePoint expire_at = MonotonicTimePoint::now() + max_wait;
1885  CountedHandleMap::const_iterator iter = handles_.find(id);
1887  ThreadStatusManager& thread_status_manager = TheServiceParticipant->get_thread_status_manager();
1888  while (res == CvStatus_NoTimeout && iter == handles_.end()) {
1889  res = max_wait.is_zero() ? handle_waiters_.wait(thread_status_manager) : handle_waiters_.wait_until(expire_at, thread_status_manager);
1890  iter = handles_.find(id);
1891  }
1892  return iter == handles_.end() ? DDS::HANDLE_NIL : iter->second.first;
1893 }
static TimePoint_T< MonotonicClock > now()
Definition: TimePoint_T.inl:41
const InstanceHandle_t HANDLE_NIL
ConditionVariable< ACE_Thread_Mutex > handle_waiters_
#define ACE_GUARD_RETURN(MUTEX, OBJ, LOCK, RETURN)
CvStatus wait(ThreadStatusManager &thread_status_manager)
Block until thread is woken up.
TimePoint_T< MonotonicClock > MonotonicTimePoint
Definition: TimeTypes.h:51
#define TheServiceParticipant
CvStatus wait_until(const MonotonicTimePoint &expire_at, ThreadStatusManager &thread_status_manager)
Block until woken up or until expire_at. Same as wait() if expire_at is zero.
The wait has returned because it was woken up.
CountedHandleMap handles_
Instance handles assigned which are mapped to GUIDs (use handle_protector_)
ACE_Thread_Mutex handle_protector_
Protect the handle collection.

◆ contains_entity()

CORBA::Boolean OpenDDS::DCPS::DomainParticipantImpl::contains_entity ( DDS::InstanceHandle_t  a_handle)
virtual

Check top-level containers for Topic, Subscriber, and Publisher instances.

Recurse into SubscriberImpl and PublisherImpl for DataReader and DataWriter instances respectively.

Definition at line 1100 of file DomainParticipantImpl.cpp.

References ACE_GUARD_RETURN, publishers_, publishers_protector_, subscribers_, subscribers_protector_, topics_, and topics_protector_.

1101 {
1102  /// Check top-level containers for Topic, Subscriber,
1103  /// and Publisher instances.
1104  {
1106  guard,
1107  this->topics_protector_,
1108  false);
1109 
1110  for (TopicMap::iterator it(topics_.begin());
1111  it != topics_.end(); ++it) {
1112  if (a_handle == it->second.pair_.svt_->get_instance_handle())
1113  return true;
1114  }
1115  }
1116 
1117  {
1119  guard,
1120  this->subscribers_protector_,
1121  false);
1122 
1123  for (SubscriberSet::iterator it(subscribers_.begin());
1124  it != subscribers_.end(); ++it) {
1125  if (a_handle == it->svt_->get_instance_handle())
1126  return true;
1127  }
1128  }
1129 
1130  {
1132  guard,
1133  this->publishers_protector_,
1134  false);
1135 
1136  for (PublisherSet::iterator it(publishers_.begin());
1137  it != publishers_.end(); ++it) {
1138  if (a_handle == it->svt_->get_instance_handle())
1139  return true;
1140  }
1141  }
1142 
1143  /// Recurse into SubscriberImpl and PublisherImpl for
1144  /// DataReader and DataWriter instances respectively.
1145  for (SubscriberSet::iterator it(subscribers_.begin());
1146  it != subscribers_.end(); ++it) {
1147  if (it->svt_->contains_reader(a_handle))
1148  return true;
1149  }
1150 
1151  for (PublisherSet::iterator it(publishers_.begin());
1152  it != publishers_.end(); ++it) {
1153  if (it->svt_->contains_writer(a_handle))
1154  return true;
1155  }
1156 
1157  return false;
1158 }
SubscriberSet subscribers_
Collection of subscribers.
ACE_Recursive_Thread_Mutex topics_protector_
Protect the topic collection.
PublisherSet publishers_
Collection of publishers.
#define ACE_GUARD_RETURN(MUTEX, OBJ, LOCK, RETURN)
TopicMap topics_
Collection of topics.
ACE_Recursive_Thread_Mutex publishers_protector_
Protect the publisher collection.
ACE_Recursive_Thread_Mutex subscribers_protector_
Protect the subscriber collection.

◆ create_contentfilteredtopic()

DDS::ContentFilteredTopic_ptr OpenDDS::DCPS::DomainParticipantImpl::create_contentfilteredtopic ( const char *  name,
DDS::Topic_ptr  related_topic,
const char *  filter_expression,
const DDS::StringSeq expression_parameters 
)
virtual

Definition at line 813 of file DomainParticipantImpl.cpp.

References ACE_ERROR, ACE_GUARD_RETURN, ACE_TEXT(), OpenDDS::DCPS::DCPS_debug_level, CORBA::is_nil(), LM_ERROR, name, DDS::RETCODE_OK, topic_descrs_, topics_, and topics_protector_.

818 {
819  if (CORBA::is_nil(related_topic)) {
820  if (DCPS_debug_level > 3) {
821  ACE_ERROR((LM_ERROR, ACE_TEXT("(%P|%t) ERROR: ")
822  ACE_TEXT("DomainParticipantImpl::create_contentfilteredtopic, ")
823  ACE_TEXT("can't create a content-filtered topic due to null related ")
824  ACE_TEXT("topic.\n")));
825  }
826  return 0;
827  }
828 
830 
831  if (topics_.count(name)) {
832  if (DCPS_debug_level > 3) {
833  ACE_ERROR((LM_ERROR, ACE_TEXT("(%P|%t) ERROR: ")
834  ACE_TEXT("DomainParticipantImpl::create_contentfilteredtopic, ")
835  ACE_TEXT("can't create a content-filtered topic due to name \"%C\" ")
836  ACE_TEXT("already in use by a Topic.\n"), name));
837  }
838  return 0;
839  }
840 
841  if (topic_descrs_.count(name)) {
842  if (DCPS_debug_level > 3) {
843  ACE_ERROR((LM_ERROR, ACE_TEXT("(%P|%t) ERROR: ")
844  ACE_TEXT("DomainParticipantImpl::create_contentfilteredtopic, ")
845  ACE_TEXT("can't create a content-filtered topic due to name \"%C\" ")
846  ACE_TEXT("already in use by a TopicDescription.\n"), name));
847  }
848  return 0;
849  }
850 
851  DDS::ContentFilteredTopic_var cft;
852  try {
853  // Create the cft in two steps so that we only have one place to
854  // check the expression parameters
855  cft = new ContentFilteredTopicImpl(name, related_topic, filter_expression, this);
856  if (cft->set_expression_parameters(expression_parameters) != DDS::RETCODE_OK) {
857  return 0;
858  }
859  } catch (const std::exception& e) {
860  if (DCPS_debug_level) {
861  ACE_ERROR((LM_ERROR, ACE_TEXT("(%P|%t) ERROR: ")
862  ACE_TEXT("DomainParticipantImpl::create_contentfilteredtopic, ")
863  ACE_TEXT("can't create a content-filtered topic due to runtime error: ")
864  ACE_TEXT("%C.\n"), e.what()));
865  }
866  return 0;
867  }
868  DDS::TopicDescription_var td = DDS::TopicDescription::_duplicate(cft);
869  topic_descrs_[name] = td;
870  return cft._retn();
871 }
TopicDescriptionMap topic_descrs_
Collection of TopicDescriptions which are not also Topics.
#define ACE_ERROR(X)
const ReturnCode_t RETCODE_OK
ACE_Recursive_Thread_Mutex topics_protector_
Protect the topic collection.
#define ACE_GUARD_RETURN(MUTEX, OBJ, LOCK, RETURN)
OpenDDS_Dcps_Export unsigned int DCPS_debug_level
Definition: debug.cpp:30
const char *const name
Definition: debug.cpp:60
TopicMap topics_
Collection of topics.
ACE_TEXT("TCP_Factory")
Boolean is_nil(T x)

◆ create_multitopic()

DDS::MultiTopic_ptr OpenDDS::DCPS::DomainParticipantImpl::create_multitopic ( const char *  name,
const char *  type_name,
const char *  subscription_expression,
const DDS::StringSeq expression_parameters 
)
virtual

Definition at line 921 of file DomainParticipantImpl.cpp.

References ACE_ERROR, ACE_GUARD_RETURN, ACE_TEXT(), OpenDDS::DCPS::DCPS_debug_level, LM_ERROR, name, topic_descrs_, topics_, and topics_protector_.

925 {
927 
928  if (topics_.count(name)) {
929  if (DCPS_debug_level > 3) {
930  ACE_ERROR((LM_ERROR, ACE_TEXT("(%P|%t) ERROR: ")
931  ACE_TEXT("DomainParticipantImpl::create_multitopic, ")
932  ACE_TEXT("can't create a multi topic due to name \"%C\" ")
933  ACE_TEXT("already in use by a Topic.\n"), name));
934  }
935  return 0;
936  }
937 
938  if (topic_descrs_.count(name)) {
939  if (DCPS_debug_level > 3) {
940  ACE_ERROR((LM_ERROR, ACE_TEXT("(%P|%t) ERROR: ")
941  ACE_TEXT("DomainParticipantImpl::create_multitopic, ")
942  ACE_TEXT("can't create a multi topic due to name \"%C\" ")
943  ACE_TEXT("already in use by a TopicDescription.\n"), name));
944  }
945  return 0;
946  }
947 
948  DDS::MultiTopic_var mt;
949  try {
950  mt = new MultiTopicImpl(name, type_name, subscription_expression,
951  expression_parameters, this);
952  } catch (const std::exception& e) {
953  if (DCPS_debug_level) {
954  ACE_ERROR((LM_ERROR, ACE_TEXT("(%P|%t) ERROR: ")
955  ACE_TEXT("DomainParticipantImpl::create_multitopic, ")
956  ACE_TEXT("can't create a multi topic due to runtime error: ")
957  ACE_TEXT("%C.\n"), e.what()));
958  }
959  return 0;
960  }
961  DDS::TopicDescription_var td = DDS::TopicDescription::_duplicate(mt);
962  topic_descrs_[name] = td;
963  return mt._retn();
964 }
TopicDescriptionMap topic_descrs_
Collection of TopicDescriptions which are not also Topics.
#define ACE_ERROR(X)
ACE_Recursive_Thread_Mutex topics_protector_
Protect the topic collection.
#define ACE_GUARD_RETURN(MUTEX, OBJ, LOCK, RETURN)
OpenDDS_Dcps_Export unsigned int DCPS_debug_level
Definition: debug.cpp:30
const char *const name
Definition: debug.cpp:60
TopicMap topics_
Collection of topics.
ACE_TEXT("TCP_Factory")

◆ create_new_topic()

DDS::Topic_ptr OpenDDS::DCPS::DomainParticipantImpl::create_new_topic ( const char *  topic_name,
const char *  type_name,
const DDS::TopicQos qos,
DDS::TopicListener_ptr  a_listener,
const DDS::StatusMask mask,
OpenDDS::DCPS::TypeSupport_ptr  type_support 
)
private

Definition at line 1942 of file DomainParticipantImpl.cpp.

References access(), ACE_ERROR, ACE_GUARD_RETURN, ACE_NEW_RETURN, ACE_TEXT(), DDS::EntityFactoryQosPolicy::autoenable_created_entities, DDS::Security::SecurityException::code, domain_id_, OpenDDS::DCPS::TopicImpl::enable(), OpenDDS::DCPS::EntityImpl::enabled_, DDS::DomainParticipantQos::entity_factory, DDS::Security::TopicSecurityAttributes::is_read_protected, DDS::Security::TopicSecurityAttributes::is_write_protected, LM_WARNING, DDS::Security::SecurityException::message, DDS::Security::SecurityException::minor_code, monitor_, OpenDDS::DCPS::Objref_Servant_Pair< T_impl, T, T_ptr, T_var >::obj_, OpenDDS::DCPS::DomainParticipantImpl::RefCounted_Topic::pair_, perm_handle_, qos_, DDS::RETCODE_OK, security_config_, OpenDDS::DCPS::security_debug, OpenDDS::DCPS::topicIsBIT(), topics_, and topics_protector_.

Referenced by create_topic_i(), and find_topic().

1949 {
1951  tao_mon,
1952  this->topics_protector_,
1953  DDS::Topic::_nil());
1954 
1955 #ifdef OPENDDS_SECURITY
1956  if (perm_handle_ && !topicIsBIT(topic_name, type_name)) {
1957  Security::AccessControl_var access = security_config_->get_access_control();
1958 
1960 
1962  if (!access->get_topic_sec_attributes(perm_handle_, topic_name, sec_attr, se)) {
1963  if (DCPS::security_debug.new_entity_warn) {
1964  ACE_ERROR((LM_WARNING,
1965  ACE_TEXT("(%P|%t) WARNING: ")
1966  ACE_TEXT("DomainParticipantImpl::create_new_topic, ")
1967  ACE_TEXT("Unable to get security attributes for topic '%C'. SecurityException[%d.%d]: %C\n"),
1968  topic_name, se.code, se.minor_code, se.message.in()));
1969  }
1970  return DDS::Topic::_nil();
1971  }
1972 
1973  if ((sec_attr.is_write_protected || sec_attr.is_read_protected) &&
1974  !access->check_create_topic(perm_handle_, domain_id_, topic_name, qos, se)) {
1975  if (DCPS::security_debug.new_entity_warn) {
1976  ACE_ERROR((LM_WARNING,
1977  ACE_TEXT("(%P|%t) WARNING: ")
1978  ACE_TEXT("DomainParticipantImpl::create_new_topic, ")
1979  ACE_TEXT("Permissions check failed to create new topic '%C'. SecurityException[%d.%d]: %C\n"),
1980  topic_name, se.code, se.minor_code, se.message.in()));
1981  }
1982  return DDS::Topic::_nil();
1983  }
1984  }
1985 #endif
1986 
1987  TopicImpl* topic_servant = 0;
1988 
1989  ACE_NEW_RETURN(topic_servant,
1990  TopicImpl(topic_name,
1991  type_name,
1992  type_support,
1993  qos,
1994  a_listener,
1995  mask,
1996  this),
1997  DDS::Topic::_nil());
1998 
2000  const DDS::ReturnCode_t ret = topic_servant->enable();
2001 
2002  if (ret != DDS::RETCODE_OK) {
2003  ACE_ERROR((LM_WARNING,
2004  ACE_TEXT("(%P|%t) WARNING: ")
2005  ACE_TEXT("DomainParticipantImpl::create_new_topic, ")
2006  ACE_TEXT("enable failed.\n")));
2007  return DDS::Topic::_nil();
2008  }
2009  }
2010 
2011  DDS::Topic_ptr obj(topic_servant);
2012 
2013  // this object will also act as a guard against leaking the new TopicImpl
2014  RefCounted_Topic refCounted_topic(Topic_Pair(topic_servant, obj, false));
2015  topics_.insert(std::make_pair(topic_name, refCounted_topic));
2016 
2017  if (this->monitor_) {
2018  this->monitor_->report();
2019  }
2020 
2021  // the topics_ map has one reference and we duplicate to give
2022  // the caller another reference.
2023  return DDS::Topic::_duplicate(refCounted_topic.pair_.obj_.in());
2024 }
#define ACE_ERROR(X)
int access(const char *path, int amode)
const ReturnCode_t RETCODE_OK
const DDS::DomainId_t domain_id_
The id of the domain that creates this participant.
ACE_Recursive_Thread_Mutex topics_protector_
Protect the topic collection.
Security::SecurityConfig_rch security_config_
#define ACE_GUARD_RETURN(MUTEX, OBJ, LOCK, RETURN)
Objref_Servant_Pair< TopicImpl, DDS::Topic, DDS::Topic_ptr, DDS::Topic_var > Topic_Pair
bool topicIsBIT(const char *name, const char *type)
EntityFactoryQosPolicy entity_factory
TopicMap topics_
Collection of topics.
ACE_TEXT("TCP_Factory")
DDS::Security::PermissionsHandle perm_handle_
This participant permissions handle given by access constrol.
#define ACE_NEW_RETURN(POINTER, CONSTRUCTOR, RET_VAL)
OpenDDS_Dcps_Export SecurityDebug security_debug
Definition: debug.cpp:32
AtomicBool enabled_
The flag indicates the entity is enabled.
Definition: EntityImpl.h:82
DDS::DomainParticipantQos qos_
The qos of this DomainParticipant.

◆ create_publisher()

DDS::Publisher_ptr OpenDDS::DCPS::DomainParticipantImpl::create_publisher ( const DDS::PublisherQos qos,
DDS::PublisherListener_ptr  a_listener,
DDS::StatusMask  mask 
)
virtual

Definition at line 153 of file DomainParticipantImpl.cpp.

References ACE_ERROR, ACE_GUARD_RETURN, ACE_NEW_RETURN, ACE_TEXT(), assign_handle(), DDS::EntityFactoryQosPolicy::autoenable_created_entities, OpenDDS::DCPS::DCPS_debug_level, OpenDDS::DCPS::PublisherImpl::enable(), OpenDDS::DCPS::EntityImpl::enabled_, DDS::DomainParticipantQos::entity_factory, OpenDDS::DCPS::insert(), LM_ERROR, OpenDDS::DCPS::DomainParticipantImpl::RepoIdSequence::next(), pub_id_gen_, publishers_, publishers_protector_, qos_, and validate_publisher_qos().

157 {
158  DDS::PublisherQos pub_qos = qos;
159 
160  if (! this->validate_publisher_qos(pub_qos))
161  return DDS::Publisher::_nil();
162 
163  // Although Publisher entities have GUIDs assigned (see pub_id_gen_),
164  // these are not GUIDs from the RTPS spec and
165  // so the handle doesn't need to correlate to the GUID.
166  const DDS::InstanceHandle_t handle = assign_handle();
167 
168  PublisherImpl* pub = 0;
169  ACE_NEW_RETURN(pub,
170  PublisherImpl(handle,
171  pub_id_gen_.next(),
172  pub_qos,
173  a_listener,
174  mask,
175  this),
176  DDS::Publisher::_nil());
177 
179  pub->enable();
180  }
181 
182  DDS::Publisher_ptr pub_obj(pub);
183 
184  // this object will also act as the guard for leaking Publisher Impl
185  Publisher_Pair pair(pub, pub_obj, false);
186 
188  tao_mon,
189  this->publishers_protector_,
190  DDS::Publisher::_nil());
191 
192  if (OpenDDS::DCPS::insert(publishers_, pair) == -1) {
193  if (DCPS_debug_level > 0) {
194  ACE_ERROR((LM_ERROR,
195  ACE_TEXT("(%P|%t) ERROR: DomainParticipantImpl::create_publisher, ")
196  ACE_TEXT("%p\n"),
197  ACE_TEXT("insert")));
198  }
199  return DDS::Publisher::_nil();
200  }
201 
202  return DDS::Publisher::_duplicate(pub_obj);
203 }
#define ACE_ERROR(X)
DDS::InstanceHandle_t assign_handle(const GUID_t &id=GUID_UNKNOWN)
int insert(Container &c, const ValueType &v)
Definition: Util.h:105
Objref_Servant_Pair< PublisherImpl, DDS::Publisher, DDS::Publisher_ptr, DDS::Publisher_var > Publisher_Pair
PublisherSet publishers_
Collection of publishers.
#define ACE_GUARD_RETURN(MUTEX, OBJ, LOCK, RETURN)
EntityFactoryQosPolicy entity_factory
OpenDDS_Dcps_Export unsigned int DCPS_debug_level
Definition: debug.cpp:30
ACE_TEXT("TCP_Factory")
ACE_Recursive_Thread_Mutex publishers_protector_
Protect the publisher collection.
HANDLE_TYPE_NATIVE InstanceHandle_t
Definition: DdsDcpsCore.idl:51
#define ACE_NEW_RETURN(POINTER, CONSTRUCTOR, RET_VAL)
RepoIdSequence pub_id_gen_
Publisher ID generator.
bool validate_publisher_qos(DDS::PublisherQos &publisher_qos)
AtomicBool enabled_
The flag indicates the entity is enabled.
Definition: EntityImpl.h:82
DDS::DomainParticipantQos qos_
The qos of this DomainParticipant.

◆ create_recorder()

Recorder_ptr OpenDDS::DCPS::DomainParticipantImpl::create_recorder ( DDS::Topic_ptr  a_topic,
const DDS::SubscriberQos subscriber_qos,
const DDS::DataReaderQos datareader_qos,
const RecorderListener_rch a_listener,
DDS::StatusMask  mask 
)

Definition at line 2192 of file DomainParticipantImpl.cpp.

References TAO_Objref_Var_T< T >::_retn(), ACE_ERROR, ACE_TEXT(), DDS::EntityFactoryQosPolicy::autoenable_created_entities, OpenDDS::DCPS::DCPS_debug_level, OpenDDS::DCPS::RecorderImpl::enable(), OpenDDS::DCPS::EntityImpl::enabled_, DDS::DomainParticipantQos::entity_factory, OpenDDS::DCPS::RecorderImpl::init(), CORBA::is_nil(), LM_ERROR, qos_, recorders_, recorders_protector_, TheServiceParticipant, OpenDDS::DCPS::SubscriberImpl::validate_datareader_qos(), and validate_subscriber_qos().

Referenced by OpenDDS::DCPS::Service_Participant::create_recorder().

2197 {
2198  if (CORBA::is_nil(a_topic)) {
2199  if (DCPS_debug_level > 0) {
2200  ACE_ERROR((LM_ERROR,
2201  ACE_TEXT("(%P|%t) ERROR: ")
2202  ACE_TEXT("DomainParticipantImpl::create_recorder, ")
2203  ACE_TEXT("topic desc is nil.\n")));
2204  }
2205  return 0;
2206  }
2207 
2208  DDS::SubscriberQos sub_qos = subscriber_qos;
2209  DDS::DataReaderQos dr_qos;
2210 
2211  if (! this->validate_subscriber_qos(sub_qos) ||
2212  ! SubscriberImpl::validate_datareader_qos(datareader_qos,
2213  TheServiceParticipant->initial_DataReaderQos(),
2214  a_topic,
2215  dr_qos, false) ) {
2216  return 0;
2217  }
2218 
2219  RecorderImpl* recorder(new RecorderImpl);
2220  Recorder_var result(recorder);
2221 
2222  recorder->init(dynamic_cast<TopicDescriptionImpl*>(a_topic),
2223  dr_qos, a_listener,
2224  mask, this, sub_qos);
2225 
2227  recorder->enable();
2228  }
2229 
2231  recorders_.insert(result);
2232 
2233  return result._retn();
2234 }
#define ACE_ERROR(X)
EntityFactoryQosPolicy entity_factory
OpenDDS_Dcps_Export unsigned int DCPS_debug_level
Definition: debug.cpp:30
ACE_TEXT("TCP_Factory")
static bool validate_datareader_qos(const DDS::DataReaderQos &qos, const DDS::DataReaderQos &default_qos, DDS::Topic_ptr a_topic, DDS::DataReaderQos &result_qos, bool mt)
ACE_Recursive_Thread_Mutex recorders_protector_
Protect the recorders collection.
bool validate_subscriber_qos(DDS::SubscriberQos &subscriber_qos)
TAO_Objref_Var_T< Recorder > Recorder_var
Definition: Recorder.h:59
#define TheServiceParticipant
AtomicBool enabled_
The flag indicates the entity is enabled.
Definition: EntityImpl.h:82
Boolean is_nil(T x)
DDS::DomainParticipantQos qos_
The qos of this DomainParticipant.

◆ create_replayer()

Replayer_ptr OpenDDS::DCPS::DomainParticipantImpl::create_replayer ( DDS::Topic_ptr  a_topic,
const DDS::PublisherQos publisher_qos,
const DDS::DataWriterQos datawriter_qos,
const ReplayerListener_rch a_listener,
DDS::StatusMask  mask 
)

Definition at line 2237 of file DomainParticipantImpl.cpp.

References TAO_Objref_Var_T< T >::_retn(), ACE_ERROR, ACE_TEXT(), DDS::EntityFactoryQosPolicy::autoenable_created_entities, OpenDDS::DCPS::DCPS_debug_level, OpenDDS::DCPS::ReplayerImpl::enable(), OpenDDS::DCPS::EntityImpl::enabled_, DDS::DomainParticipantQos::entity_factory, OpenDDS::DCPS::ReplayerImpl::init(), CORBA::is_nil(), LM_ERROR, qos_, replayers_, replayers_protector_, DDS::RETCODE_OK, TheServiceParticipant, OpenDDS::DCPS::PublisherImpl::validate_datawriter_qos(), and validate_publisher_qos().

Referenced by OpenDDS::DCPS::Service_Participant::create_replayer().

2242 {
2243  if (CORBA::is_nil(a_topic)) {
2244  if (DCPS_debug_level > 0) {
2245  ACE_ERROR((LM_ERROR,
2246  ACE_TEXT("(%P|%t) ERROR: ")
2247  ACE_TEXT("DomainParticipantImpl::create_replayer, ")
2248  ACE_TEXT("topic desc is nil.\n")));
2249  }
2250  return 0;
2251  }
2252 
2253  DDS::PublisherQos pub_qos = publisher_qos;
2254  DDS::DataWriterQos dw_qos;
2255 
2256  if (! this->validate_publisher_qos(pub_qos) ||
2257  ! PublisherImpl::validate_datawriter_qos(datawriter_qos,
2258  TheServiceParticipant->initial_DataWriterQos(),
2259  a_topic,
2260  dw_qos)) {
2261  return 0;
2262  }
2263 
2264  TopicImpl* topic_servant = dynamic_cast<TopicImpl*>(a_topic);
2265 
2266  ReplayerImpl* replayer(new ReplayerImpl);
2267  Replayer_var result(replayer);
2268 
2269  replayer->init(a_topic, topic_servant, dw_qos, a_listener, mask, this, pub_qos);
2270 
2272  const DDS::ReturnCode_t ret = replayer->enable();
2273 
2274  if (ret != DDS::RETCODE_OK) {
2275  if (DCPS_debug_level > 0) {
2276  ACE_ERROR((LM_ERROR,
2277  ACE_TEXT("(%P|%t) ERROR: ")
2278  ACE_TEXT("DomainParticipantImpl::create_replayer, ")
2279  ACE_TEXT("enable failed.\n")));
2280  }
2281  return 0;
2282  }
2283  }
2284 
2286  replayers_.insert(result);
2287  return result._retn();
2288 }
#define ACE_ERROR(X)
static bool validate_datawriter_qos(const DDS::DataWriterQos &qos, const DDS::DataWriterQos &default_qos, DDS::Topic_ptr a_topic, DDS::DataWriterQos &dw_qos)
const ReturnCode_t RETCODE_OK
ACE_Recursive_Thread_Mutex replayers_protector_
Protect the replayers collection.
TAO_Objref_Var_T< Replayer > Replayer_var
Definition: Replayer.h:50
EntityFactoryQosPolicy entity_factory
OpenDDS_Dcps_Export unsigned int DCPS_debug_level
Definition: debug.cpp:30
ACE_TEXT("TCP_Factory")
bool validate_publisher_qos(DDS::PublisherQos &publisher_qos)
#define TheServiceParticipant
AtomicBool enabled_
The flag indicates the entity is enabled.
Definition: EntityImpl.h:82
Boolean is_nil(T x)
DDS::DomainParticipantQos qos_
The qos of this DomainParticipant.

◆ create_subscriber()

DDS::Subscriber_ptr OpenDDS::DCPS::DomainParticipantImpl::create_subscriber ( const DDS::SubscriberQos qos,
DDS::SubscriberListener_ptr  a_listener,
DDS::StatusMask  mask 
)
virtual

Definition at line 270 of file DomainParticipantImpl.cpp.

References ACE_ERROR, ACE_GUARD_RETURN, ACE_NEW_RETURN, ACE_TEXT(), assign_handle(), DDS::EntityFactoryQosPolicy::autoenable_created_entities, OpenDDS::DCPS::DCPS_debug_level, OpenDDS::DCPS::SubscriberImpl::enable(), OpenDDS::DCPS::EntityImpl::enabled_, DDS::DomainParticipantQos::entity_factory, OpenDDS::DCPS::insert(), LM_ERROR, qos_, subscribers_, subscribers_protector_, and validate_subscriber_qos().

Referenced by OpenDDS::DCPS::InfoRepoDiscovery::init_bit(), OpenDDS::RTPS::RtpsDiscovery::init_bit(), and OpenDDS::DCPS::StaticDiscovery::init_bit().

274 {
275  DDS::SubscriberQos sub_qos = qos;
276 
277  if (! this->validate_subscriber_qos(sub_qos)) {
278  return DDS::Subscriber::_nil();
279  }
280 
281  const DDS::InstanceHandle_t handle = assign_handle();
282 
283  SubscriberImpl* sub = 0;
284  ACE_NEW_RETURN(sub,
285  SubscriberImpl(handle,
286  sub_qos,
287  a_listener,
288  mask,
289  this),
290  DDS::Subscriber::_nil());
291 
293  sub->enable();
294  }
295 
296  DDS::Subscriber_ptr sub_obj(sub);
297 
298  Subscriber_Pair pair(sub, sub_obj, false);
299 
301  tao_mon,
303  DDS::Subscriber::_nil());
304 
305  if (OpenDDS::DCPS::insert(subscribers_, pair) == -1) {
306  if (DCPS_debug_level > 0) {
307  ACE_ERROR((LM_ERROR,
308  ACE_TEXT("(%P|%t) ERROR: DomainParticipantImpl::create_subscriber, ")
309  ACE_TEXT("%p\n"),
310  ACE_TEXT("insert")));
311  }
312  return DDS::Subscriber::_nil();
313  }
314 
315  return DDS::Subscriber::_duplicate(sub_obj);
316 }
#define ACE_ERROR(X)
Objref_Servant_Pair< SubscriberImpl, DDS::Subscriber, DDS::Subscriber_ptr, DDS::Subscriber_var > Subscriber_Pair
DDS::InstanceHandle_t assign_handle(const GUID_t &id=GUID_UNKNOWN)
int insert(Container &c, const ValueType &v)
Definition: Util.h:105
SubscriberSet subscribers_
Collection of subscribers.
#define ACE_GUARD_RETURN(MUTEX, OBJ, LOCK, RETURN)
EntityFactoryQosPolicy entity_factory
OpenDDS_Dcps_Export unsigned int DCPS_debug_level
Definition: debug.cpp:30
ACE_TEXT("TCP_Factory")
ACE_Recursive_Thread_Mutex subscribers_protector_
Protect the subscriber collection.
HANDLE_TYPE_NATIVE InstanceHandle_t
Definition: DdsDcpsCore.idl:51
#define ACE_NEW_RETURN(POINTER, CONSTRUCTOR, RET_VAL)
bool validate_subscriber_qos(DDS::SubscriberQos &subscriber_qos)
AtomicBool enabled_
The flag indicates the entity is enabled.
Definition: EntityImpl.h:82
DDS::DomainParticipantQos qos_
The qos of this DomainParticipant.

◆ create_topic()

DDS::Topic_ptr OpenDDS::DCPS::DomainParticipantImpl::create_topic ( const char *  topic_name,
const char *  type_name,
const DDS::TopicQos qos,
DDS::TopicListener_ptr  a_listener,
DDS::StatusMask  mask 
)
virtual

Definition at line 395 of file DomainParticipantImpl.cpp.

References create_topic_i().

Referenced by OpenDDS::DCPS::Discovery::create_bit_topics().

401 {
402  return create_topic_i(topic_name,
403  type_name,
404  qos,
405  a_listener,
406  mask,
407  0);
408 }
DDS::Topic_ptr create_topic_i(const char *topic_name, const char *type_name, const DDS::TopicQos &qos, DDS::TopicListener_ptr a_listener, DDS::StatusMask mask, int topic_mask)

◆ create_topic_i()

DDS::Topic_ptr OpenDDS::DCPS::DomainParticipantImpl::create_topic_i ( const char *  topic_name,
const char *  type_name,
const DDS::TopicQos qos,
DDS::TopicListener_ptr  a_listener,
DDS::StatusMask  mask,
int  topic_mask 
)
private

Definition at line 431 of file DomainParticipantImpl.cpp.

References ACE_ERROR, ACE_GUARD_RETURN, ACE_TEXT(), DDS::EntityFactoryQosPolicy::autoenable_created_entities, OpenDDS::DCPS::Qos_Helper::consistent(), create_new_topic(), OpenDDS::DCPS::DCPS_debug_level, OpenDDS::DCPS::EntityImpl::enabled_, DDS::DomainParticipantQos::entity_factory, Util::find(), get_default_topic_qos(), TAO::String_var< charT >::in(), CORBA::is_nil(), LM_ERROR, LM_WARNING, OPENDDS_NO_DURABILITY_KIND_TRANSIENT_PERSISTENT_COMPATIBILITY_CHECK, OPENDDS_NO_DURABILITY_SERVICE_COMPATIBILITY_CHECK, OPENDDS_NO_OWNERSHIP_KIND_EXCLUSIVE_COMPATIBILITY_CHECK, OPENDDS_NO_OWNERSHIP_PROFILE_COMPATIBILITY_CHECK, qos_, Registered_Data_Types, DDS::RETCODE_OK, ACE_OS::strcmp(), topic_descrs_, TOPIC_QOS_DEFAULT, topics_, topics_protector_, and OpenDDS::DCPS::Qos_Helper::valid().

Referenced by create_topic(), and create_typeless_topic().

438 {
439  DDS::TopicQos topic_qos;
440 
441  if (qos == TOPIC_QOS_DEFAULT) {
442  this->get_default_topic_qos(topic_qos);
443 
444  } else {
445  topic_qos = qos;
446  }
447 
449  OPENDDS_NO_OWNERSHIP_PROFILE_COMPATIBILITY_CHECK(qos, DDS::Topic::_nil());
450  OPENDDS_NO_DURABILITY_SERVICE_COMPATIBILITY_CHECK(qos, DDS::Topic::_nil());
452 
453  if (!Qos_Helper::valid(topic_qos)) {
454  if (DCPS_debug_level > 0) {
455  ACE_ERROR((LM_ERROR,
456  ACE_TEXT("(%P|%t) ERROR: ")
457  ACE_TEXT("DomainParticipantImpl::create_topic, ")
458  ACE_TEXT("invalid qos.\n")));
459  }
460  return DDS::Topic::_nil();
461  }
462 
463  if (!Qos_Helper::consistent(topic_qos)) {
464  if (DCPS_debug_level > 0) {
465  ACE_ERROR((LM_ERROR,
466  ACE_TEXT("(%P|%t) ERROR: ")
467  ACE_TEXT("DomainParticipantImpl::create_topic, ")
468  ACE_TEXT("inconsistent qos.\n")));
469  }
470  return DDS::Topic::_nil();
471  }
472 
473  // See if there is a Topic with the same name.
474  TopicMap::mapped_type* entry = 0;
475  bool found = false;
476  {
478  tao_mon,
479  this->topics_protector_,
480  DDS::Topic::_nil());
481 
482 #if !defined(OPENDDS_NO_CONTENT_FILTERED_TOPIC) || !defined(OPENDDS_NO_MULTI_TOPIC)
483  if (topic_descrs_.count(topic_name)) {
484  if (DCPS_debug_level > 3) {
485  ACE_ERROR((LM_ERROR, ACE_TEXT("(%P|%t) ERROR: ")
486  ACE_TEXT("DomainParticipantImpl::create_topic, ")
487  ACE_TEXT("can't create a Topic due to name \"%C\" already in use ")
488  ACE_TEXT("by a TopicDescription.\n"), topic_name));
489  }
490  return 0;
491  }
492 #endif
493 
494  if (Util::find(topics_, topic_name, entry) == 0) {
495  found = true;
496  }
497  }
498 
499  /*
500  * If there is a topic with the same name, return the topic if it has the
501  * same type name and QoS, else it is an error.
502  */
503  if (found) {
504  CORBA::String_var found_type = entry->pair_.svt_->get_type_name();
505  if (ACE_OS::strcmp(type_name, found_type) == 0) {
506  DDS::TopicQos found_qos;
507  entry->pair_.svt_->get_qos(found_qos);
508 
509  if (topic_qos == found_qos) { // match type name, qos
510  {
512  tao_mon,
513  this->topics_protector_,
514  DDS::Topic::_nil());
515  ++entry->client_refs_;
516  }
517  return DDS::Topic::_duplicate(entry->pair_.obj_.in());
518 
519  } else { // Same Name and Type, Different QoS
520  if (DCPS_debug_level >= 1) {
521  ACE_ERROR((LM_ERROR,
522  ACE_TEXT("(%P|%t) ERROR: DomainParticipantImpl::create_topic: ")
523  ACE_TEXT("topic with name \"%C\" and type %C already exists, ")
524  ACE_TEXT("but the QoS doesn't match.\n"),
525  topic_name, type_name));
526  }
527 
528  return DDS::Topic::_nil();
529  }
530 
531  } else { // Same Name, Different Type
532  if (DCPS_debug_level >= 1) {
533  ACE_ERROR((LM_ERROR,
534  ACE_TEXT("(%P|%t) ERROR: DomainParticipantImpl::create_topic: ")
535  ACE_TEXT("topic with name \"%C\" already exists, but its type, %C ")
536  ACE_TEXT("is not the same as %C.\n"),
537  topic_name, found_type.in(), type_name));
538  }
539 
540  return DDS::Topic::_nil();
541  }
542 
543  } else {
544 
545  OpenDDS::DCPS::TypeSupport_var type_support;
546 
547  if (0 == topic_mask) {
548  // creating a topic with compile time type
549  type_support = Registered_Data_Types->lookup(this, type_name);
550  if (CORBA::is_nil(type_support)) {
551  if (DCPS_debug_level >= 1) {
552  ACE_ERROR((LM_ERROR, ACE_TEXT("(%P|%t) ERROR: ")
553  ACE_TEXT("DomainParticipantImpl::create_topic, ")
554  ACE_TEXT("can't create a topic=%C type_name=%C ")
555  ACE_TEXT("is not registered.\n"),
556  topic_name, type_name));
557  }
558  return DDS::Topic::_nil();
559  }
560  }
561 
562  DDS::Topic_var new_topic = create_new_topic(topic_name,
563  type_name,
564  topic_qos,
565  a_listener,
566  mask,
567  type_support);
568 
569  if (!new_topic) {
570  if (DCPS_debug_level > 0) {
571  ACE_ERROR((LM_WARNING,
572  ACE_TEXT("(%P|%t) WARNING: ")
573  ACE_TEXT("DomainParticipantImpl::create_topic, ")
574  ACE_TEXT("create_new_topic failed.\n")));
575  }
576  return DDS::Topic::_nil();
577  }
578 
580  if (new_topic->enable() != DDS::RETCODE_OK) {
581  if (DCPS_debug_level > 0) {
582  ACE_ERROR((LM_WARNING,
583  ACE_TEXT("(%P|%t) WARNING: ")
584  ACE_TEXT("DomainParticipantImpl::create_topic, ")
585  ACE_TEXT("enable failed.\n")));
586  }
587  return DDS::Topic::_nil();
588  }
589  }
590  return new_topic._retn();
591  }
592 }
TopicDescriptionMap topic_descrs_
Collection of TopicDescriptions which are not also Topics.
#define ACE_ERROR(X)
int find(OpenDDS::DCPS::DomainParticipantImpl::TopicMap &c, const Key &key, OpenDDS::DCPS::DomainParticipantImpl::TopicMap::mapped_type *&value)
const ReturnCode_t RETCODE_OK
#define OPENDDS_NO_DURABILITY_SERVICE_COMPATIBILITY_CHECK(qos, error_rtn_value)
DDS::Topic_ptr create_new_topic(const char *topic_name, const char *type_name, const DDS::TopicQos &qos, DDS::TopicListener_ptr a_listener, const DDS::StatusMask &mask, OpenDDS::DCPS::TypeSupport_ptr type_support)
static bool consistent(const DDS::ResourceLimitsQosPolicy &resource_limits, const DDS::HistoryQosPolicy &history)
Definition: Qos_Helper.inl:596
#define OPENDDS_NO_OWNERSHIP_KIND_EXCLUSIVE_COMPATIBILITY_CHECK(qos, error_rtn_value)
ACE_Recursive_Thread_Mutex topics_protector_
Protect the topic collection.
virtual DDS::ReturnCode_t get_default_topic_qos(DDS::TopicQos &qos)
#define OPENDDS_NO_OWNERSHIP_PROFILE_COMPATIBILITY_CHECK(qos, error_rtn_value)
#define Registered_Data_Types
#define ACE_GUARD_RETURN(MUTEX, OBJ, LOCK, RETURN)
static bool valid(const DDS::UserDataQosPolicy &qos)
Definition: Qos_Helper.inl:723
EntityFactoryQosPolicy entity_factory
OpenDDS_Dcps_Export unsigned int DCPS_debug_level
Definition: debug.cpp:30
int strcmp(const char *s, const char *t)
TopicMap topics_
Collection of topics.
ACE_TEXT("TCP_Factory")
const character_type * in(void) const
AtomicBool enabled_
The flag indicates the entity is enabled.
Definition: EntityImpl.h:82
#define OPENDDS_NO_DURABILITY_KIND_TRANSIENT_PERSISTENT_COMPATIBILITY_CHECK(qos, error_rtn_value)
Boolean is_nil(T x)
#define TOPIC_QOS_DEFAULT
DDS::DomainParticipantQos qos_
The qos of this DomainParticipant.

◆ create_typeless_topic()

DDS::Topic_ptr OpenDDS::DCPS::DomainParticipantImpl::create_typeless_topic ( const char *  topic_name,
const char *  type_name,
bool  type_has_keys,
const DDS::TopicQos qos,
DDS::TopicListener_ptr  a_listener,
DDS::StatusMask  mask 
)

Definition at line 411 of file DomainParticipantImpl.cpp.

References create_topic_i(), TOPIC_TYPE_HAS_KEYS, and TOPIC_TYPELESS.

Referenced by OpenDDS::DCPS::Service_Participant::create_typeless_topic().

418 {
419  int topic_mask = (type_has_keys ? TOPIC_TYPE_HAS_KEYS : 0 ) | TOPIC_TYPELESS;
420 
421  return create_topic_i(topic_name,
422  type_name,
423  qos,
424  a_listener,
425  mask,
426  topic_mask);
427 }
DDS::Topic_ptr create_topic_i(const char *topic_name, const char *type_name, const DDS::TopicQos &qos, DDS::TopicListener_ptr a_listener, DDS::StatusMask mask, int topic_mask)

◆ crypto_handle()

DDS::Security::ParticipantCryptoHandle OpenDDS::DCPS::DomainParticipantImpl::crypto_handle ( ) const
inline

Definition at line 413 of file DomainParticipantImpl.h.

414  {
415  return part_crypto_handle_;
416  }
DDS::Security::ParticipantCryptoHandle part_crypto_handle_
This participant crypto handle given by crypto.

◆ delete_contained_entities()

DDS::ReturnCode_t OpenDDS::DCPS::DomainParticipantImpl::delete_contained_entities ( )
virtual

Implements DDS::DomainParticipant.

Definition at line 1053 of file DomainParticipantImpl.cpp.

References ACE_Thread_Mutex::acquire(), bit_subscriber_, domain_id_, OpenDDS::DCPS::EntityImpl::get_deleted(), handle_exception(), prepare_to_delete_datawriters(), Registered_Data_Types, ACE_Thread_Mutex::release(), DDS::RETCODE_ERROR, ACE_Thread::self(), OpenDDS::DCPS::EntityImpl::set_deleted(), set_wait_pending_deadline(), shutdown_complete_, shutdown_condition_, shutdown_mutex_, shutdown_result_, TheServiceParticipant, ACE_OS::thr_equal(), and OpenDDS::DCPS::ConditionVariable< Mutex >::wait().

Referenced by OpenDDS::DCPS::DomainParticipantFactoryImpl::delete_all_participants(), and OpenDDS::DCPS::DomainParticipantFactoryImpl::delete_participant().

1054 {
1055  if (!get_deleted()) {
1056  // mark that the entity is being deleted
1057  set_deleted(true);
1058 
1060  return DDS::RETCODE_ERROR;
1061  }
1062  if (!set_wait_pending_deadline(TheServiceParticipant->new_pending_timeout_deadline())) {
1063  return DDS::RETCODE_ERROR;
1064  }
1065  }
1066 
1067  // BIT subscriber and data readers will be deleted with the
1068  // rest of the entities, so need to report to discovery that
1069  // BIT is no longer available
1070  Discovery_rch disc = TheServiceParticipant->get_discovery(this->domain_id_);
1071  if (disc)
1072  disc->fini_bit(this);
1073 
1074  if (ACE_OS::thr_equal(TheServiceParticipant->reactor_owner(),
1075  ACE_Thread::self())) {
1076  handle_exception(0);
1077 
1078  } else {
1079  TheServiceParticipant->reactor()->notify(this);
1080 
1082  ThreadStatusManager& thread_status_manager = TheServiceParticipant->get_thread_status_manager();
1083  while (!shutdown_complete_) {
1084  shutdown_condition_.wait(thread_status_manager);
1085  }
1086  shutdown_complete_ = false;
1088  }
1089 
1090  bit_subscriber_.reset();
1091 
1092  Registered_Data_Types->unregister_participant(this);
1093 
1094  // the participant can now start creating new contained entities
1095  set_deleted(false);
1096  return shutdown_result_;
1097 }
RcHandle< Discovery > Discovery_rch
Definition: Discovery.h:296
int acquire(void)
const DDS::DomainId_t domain_id_
The id of the domain that creates this participant.
int release(void)
#define Registered_Data_Types
static ACE_thread_t self(void)
const ReturnCode_t RETCODE_ERROR
int thr_equal(ACE_thread_t t1, ACE_thread_t t2)
CvStatus wait(ThreadStatusManager &thread_status_manager)
Block until thread is woken up.
void set_deleted(bool state)
Definition: EntityImpl.cpp:83
RcHandle< BitSubscriber > bit_subscriber_
The built in topic subscriber.
ConditionVariable< ACE_Thread_Mutex > shutdown_condition_
bool set_wait_pending_deadline(const MonotonicTimePoint &deadline)
#define TheServiceParticipant
ACE_Thread_Mutex shutdown_mutex_
Protect the shutdown.

◆ delete_contentfilteredtopic()

DDS::ReturnCode_t OpenDDS::DCPS::DomainParticipantImpl::delete_contentfilteredtopic ( DDS::ContentFilteredTopic_ptr  a_contentfilteredtopic)
virtual

Definition at line 873 of file DomainParticipantImpl.cpp.

References ACE_ERROR, ACE_GUARD_RETURN, ACE_TEXT(), OpenDDS::DCPS::DCPS_debug_level, OpenDDS::DCPS::TopicDescriptionImpl::has_entity_refs(), TAO::String_var< charT >::in(), LM_ERROR, name, DDS::RETCODE_ERROR, DDS::RETCODE_OK, DDS::RETCODE_OUT_OF_RESOURCES, DDS::RETCODE_PRECONDITION_NOT_MET, topic_descrs_, and topics_protector_.

875 {
878  DDS::ContentFilteredTopic_var cft =
879  DDS::ContentFilteredTopic::_duplicate(a_contentfilteredtopic);
880  CORBA::String_var name = cft->get_name();
881  TopicDescriptionMap::iterator iter = topic_descrs_.find(name.in());
882  if (iter == topic_descrs_.end()) {
883  if (DCPS_debug_level > 3) {
884  ACE_ERROR((LM_ERROR, ACE_TEXT("(%P|%t) ERROR: ")
885  ACE_TEXT("DomainParticipantImpl::delete_contentfilteredtopic, ")
886  ACE_TEXT("can't delete a content-filtered topic \"%C\" ")
887  ACE_TEXT("because it is not in the set.\n"), name.in ()));
888  }
890  }
891 
892  TopicDescriptionImpl* tdi = dynamic_cast<TopicDescriptionImpl*>(iter->second.in());
893 
894  if (!tdi) {
895  if (DCPS_debug_level > 3) {
896  ACE_ERROR((LM_ERROR, ACE_TEXT("(%P|%t) ERROR: ")
897  ACE_TEXT("DomainParticipantImpl::delete_contentfilteredtopic, ")
898  ACE_TEXT("can't delete a content-filtered topic \"%C\" ")
899  ACE_TEXT("failed to obtain TopicDescriptionImpl\n"), name.in()));
900  }
901  return DDS::RETCODE_ERROR;
902  }
903 
904  if (tdi->has_entity_refs()) {
905  if (DCPS_debug_level > 3) {
906  ACE_ERROR((LM_ERROR, ACE_TEXT("(%P|%t) ERROR: ")
907  ACE_TEXT("DomainParticipantImpl::delete_contentfilteredtopic, ")
908  ACE_TEXT("can't delete a content-filtered topic \"%C\" ")
909  ACE_TEXT("because it is used by a datareader\n"), name.in ()));
910  }
912  }
913  topic_descrs_.erase(iter);
914  return DDS::RETCODE_OK;
915 }
TopicDescriptionMap topic_descrs_
Collection of TopicDescriptions which are not also Topics.
#define ACE_ERROR(X)
const ReturnCode_t RETCODE_OK
ACE_Recursive_Thread_Mutex topics_protector_
Protect the topic collection.
const ReturnCode_t RETCODE_PRECONDITION_NOT_MET
#define ACE_GUARD_RETURN(MUTEX, OBJ, LOCK, RETURN)
const ReturnCode_t RETCODE_ERROR
OpenDDS_Dcps_Export unsigned int DCPS_debug_level
Definition: debug.cpp:30
const char *const name
Definition: debug.cpp:60
ACE_TEXT("TCP_Factory")
const ReturnCode_t RETCODE_OUT_OF_RESOURCES
const character_type * in(void) const

◆ delete_multitopic()

DDS::ReturnCode_t OpenDDS::DCPS::DomainParticipantImpl::delete_multitopic ( DDS::MultiTopic_ptr  a_multitopic)
virtual

Definition at line 966 of file DomainParticipantImpl.cpp.

References ACE_ERROR, ACE_GUARD_RETURN, ACE_TEXT(), OpenDDS::DCPS::DCPS_debug_level, OpenDDS::DCPS::TopicDescriptionImpl::has_entity_refs(), TAO::String_var< charT >::in(), LM_ERROR, DDS::RETCODE_ERROR, DDS::RETCODE_OK, DDS::RETCODE_OUT_OF_RESOURCES, DDS::RETCODE_PRECONDITION_NOT_MET, topic_descrs_, and topics_protector_.

968 {
971  DDS::MultiTopic_var mt = DDS::MultiTopic::_duplicate(a_multitopic);
972  CORBA::String_var mt_name = mt->get_name();
973  TopicDescriptionMap::iterator iter = topic_descrs_.find(mt_name.in());
974  if (iter == topic_descrs_.end()) {
975  if (DCPS_debug_level > 3) {
976  ACE_ERROR((LM_ERROR, ACE_TEXT("(%P|%t) ERROR: ")
977  ACE_TEXT("DomainParticipantImpl::delete_multitopic, ")
978  ACE_TEXT("can't delete a multitopic \"%C\" ")
979  ACE_TEXT("because it is not in the set.\n"), mt_name.in ()));
980  }
982  }
983 
984  TopicDescriptionImpl* tdi = dynamic_cast<TopicDescriptionImpl*>(iter->second.in());
985 
986  if (!tdi) {
987  if (DCPS_debug_level > 3) {
988  ACE_ERROR((LM_ERROR, ACE_TEXT("(%P|%t) ERROR: ")
989  ACE_TEXT("DomainParticipantImpl::delete_multitopic, ")
990  ACE_TEXT("can't delete a multitopic topic \"%C\" ")
991  ACE_TEXT("failed to obtain TopicDescriptionImpl.\n"),
992  mt_name.in()));
993  }
994  return DDS::RETCODE_ERROR;
995  }
996 
997  if (tdi->has_entity_refs()) {
998  if (DCPS_debug_level > 3) {
999  ACE_ERROR((LM_ERROR, ACE_TEXT("(%P|%t) ERROR: ")
1000  ACE_TEXT("DomainParticipantImpl::delete_multitopic, ")
1001  ACE_TEXT("can't delete a multitopic topic \"%C\" ")
1002  ACE_TEXT("because it is used by a datareader.\n"), mt_name.in ()));
1003  }
1005  }
1006  topic_descrs_.erase(iter);
1007  return DDS::RETCODE_OK;
1008 }
TopicDescriptionMap topic_descrs_
Collection of TopicDescriptions which are not also Topics.
#define ACE_ERROR(X)
const ReturnCode_t RETCODE_OK
ACE_Recursive_Thread_Mutex topics_protector_
Protect the topic collection.
const ReturnCode_t RETCODE_PRECONDITION_NOT_MET
#define ACE_GUARD_RETURN(MUTEX, OBJ, LOCK, RETURN)
const ReturnCode_t RETCODE_ERROR
OpenDDS_Dcps_Export unsigned int DCPS_debug_level
Definition: debug.cpp:30
ACE_TEXT("TCP_Factory")
const ReturnCode_t RETCODE_OUT_OF_RESOURCES
const character_type * in(void) const

◆ delete_publisher()

DDS::ReturnCode_t OpenDDS::DCPS::DomainParticipantImpl::delete_publisher ( DDS::Publisher_ptr  p)
virtual

Definition at line 206 of file DomainParticipantImpl.cpp.

References ACE_ERROR, ACE_GUARD_RETURN, OpenDDS::DCPS::PublisherImpl::delete_contained_entities(), OpenDDS::DCPS::PublisherImpl::is_clean(), LM_NOTICE, OpenDDS::DCPS::log_level, OpenDDS::DCPS::LogLevel::Notice, publishers_, publishers_protector_, DDS::RETCODE_ERROR, DDS::RETCODE_OK, DDS::RETCODE_PRECONDITION_NOT_MET, and OpenDDS::DCPS::retcode_to_string().

Referenced by handle_exception().

208 {
209  // The servant's ref count should be 2 at this point,
210  // one referenced by poa, one referenced by the publisher
211  // set.
212  PublisherImpl* the_servant = dynamic_cast<PublisherImpl*>(p);
213  if (!the_servant) {
214  if (log_level >= LogLevel::Notice) {
215  ACE_ERROR((LM_NOTICE, "(%P|%t) NOTICE: DomainParticipantImpl::delete_publisher: "
216  "Failed to obtain PublisherImpl\n"));
217  }
218  return DDS::RETCODE_ERROR;
219  }
220 
221  const Publisher_Pair pub_pair(the_servant, p, true);
222 
223  {
226  if (publishers_.count(pub_pair) == 0) {
227  if (log_level >= LogLevel::Notice) {
228  ACE_ERROR((LM_NOTICE, "(%P|%t) NOTICE: DomainParticipantImpl::delete_publisher: "
229  "This publisher doesn't belong to this participant\n"));
230  }
232  }
233  }
234 
235  String leftover_entities;
236  if (!the_servant->is_clean(&leftover_entities)) {
237  if (log_level >= LogLevel::Notice) {
238  ACE_ERROR((LM_NOTICE, "(%P|%t) NOTICE: DomainParticipantImpl::delete_publisher: "
239  "The publisher is not empty. %C leftover\n",
240  leftover_entities.c_str()));
241  }
243  }
244 
245  const DDS::ReturnCode_t ret = the_servant->delete_contained_entities();
246  if (ret != DDS::RETCODE_OK) {
247  if (log_level >= LogLevel::Notice) {
248  ACE_ERROR((LM_NOTICE, "(%P|%t) NOTICE: DomainParticipantImpl::delete_publisher: "
249  "Failed to delete contained entities: %C\n", retcode_to_string(ret)));
250  }
251  return ret;
252  }
253 
254  {
257  if (remove(publishers_, pub_pair) == -1) {
258  if (log_level >= LogLevel::Notice) {
259  ACE_ERROR((LM_NOTICE, "(%P|%t) NOTICE: DomainParticipantImpl::delete_publisher: "
260  "publisher not found\n"));
261  }
262  return DDS::RETCODE_ERROR;
263  }
264  }
265 
266  return DDS::RETCODE_OK;
267 }
OpenDDS_Dcps_Export LogLevel log_level
#define ACE_ERROR(X)
const char * retcode_to_string(DDS::ReturnCode_t value)
Definition: DCPS_Utils.cpp:29
const ReturnCode_t RETCODE_OK
const ReturnCode_t RETCODE_PRECONDITION_NOT_MET
Objref_Servant_Pair< PublisherImpl, DDS::Publisher, DDS::Publisher_ptr, DDS::Publisher_var > Publisher_Pair
PublisherSet publishers_
Collection of publishers.
#define ACE_GUARD_RETURN(MUTEX, OBJ, LOCK, RETURN)
const ReturnCode_t RETCODE_ERROR
ACE_Recursive_Thread_Mutex publishers_protector_
Protect the publisher collection.
std::string String

◆ delete_recorder()

void OpenDDS::DCPS::DomainParticipantImpl::delete_recorder ( Recorder_ptr  recorder)

Definition at line 2291 of file DomainParticipantImpl.cpp.

References OpenDDS::DCPS::Recorder::_duplicate(), recorders_, and recorders_protector_.

Referenced by OpenDDS::DCPS::Service_Participant::delete_recorder().

2292 {
2293  const Recorder_var recvar(Recorder::_duplicate(recorder));
2295  recorders_.erase(recvar);
2296 }
static Recorder_ptr _duplicate(Recorder_ptr obj)
Definition: Recorder.cpp:26
ACE_Recursive_Thread_Mutex recorders_protector_
Protect the recorders collection.
TAO_Objref_Var_T< Recorder > Recorder_var
Definition: Recorder.h:59

◆ delete_replayer()

void OpenDDS::DCPS::DomainParticipantImpl::delete_replayer ( Replayer_ptr  replayer)

Definition at line 2299 of file DomainParticipantImpl.cpp.

References OpenDDS::DCPS::Replayer::_duplicate(), replayers_, and replayers_protector_.

Referenced by OpenDDS::DCPS::Service_Participant::delete_replayer().

2300 {
2301  const Replayer_var repvar(Replayer::_duplicate(replayer));
2303  replayers_.erase(repvar);
2304 }
ACE_Recursive_Thread_Mutex replayers_protector_
Protect the replayers collection.
TAO_Objref_Var_T< Replayer > Replayer_var
Definition: Replayer.h:50
static Replayer_ptr _duplicate(Replayer_ptr obj)
Definition: Replayer.cpp:29

◆ delete_subscriber()

DDS::ReturnCode_t OpenDDS::DCPS::DomainParticipantImpl::delete_subscriber ( DDS::Subscriber_ptr  s)
virtual

Definition at line 319 of file DomainParticipantImpl.cpp.

References ACE_ERROR, ACE_GUARD_RETURN, OpenDDS::DCPS::SubscriberImpl::delete_contained_entities(), OpenDDS::DCPS::SubscriberImpl::is_clean(), LM_NOTICE, OpenDDS::DCPS::log_level, OpenDDS::DCPS::LogLevel::Notice, DDS::RETCODE_ERROR, DDS::RETCODE_OK, DDS::RETCODE_PRECONDITION_NOT_MET, OpenDDS::DCPS::retcode_to_string(), subscribers_, and subscribers_protector_.

Referenced by handle_exception().

321 {
322  // The servant's ref count should be 2 at this point,
323  // one referenced by poa, one referenced by the subscriber
324  // set.
325  SubscriberImpl* const the_servant = dynamic_cast<SubscriberImpl*>(s);
326  if (!the_servant) {
327  if (log_level >= LogLevel::Notice) {
328  ACE_ERROR((LM_NOTICE, "(%P|%t) NOTICE: DomainParticipantImpl::delete_subscriber: "
329  "Failed to obtain SubscriberImpl\n"));
330  }
331  return DDS::RETCODE_ERROR;
332  }
333 
334  const Subscriber_Pair sub_pair(the_servant, s, true);
335 
336  {
339  if (subscribers_.count(sub_pair) == 0) {
340  if (log_level >= LogLevel::Notice) {
341  ACE_ERROR((LM_NOTICE, "(%P|%t) NOTICE: DomainParticipantImpl::delete_subscriber: "
342  "This subscriber doesn't belong to this participant\n"));
343  }
345  }
346  }
347 
348  String leftover_entities;
349  if (!the_servant->is_clean(&leftover_entities)) {
350  if (log_level >= LogLevel::Notice) {
351  ACE_ERROR((LM_NOTICE, "(%P|%t) NOTICE: DomainParticipantImpl::delete_subscriber: "
352  "The subscriber is not empty. %C leftover\n",
353  leftover_entities.c_str()));
354  }
356  }
357 
358  const DDS::ReturnCode_t ret = the_servant->delete_contained_entities();
359  if (ret != DDS::RETCODE_OK) {
360  if (log_level >= LogLevel::Notice) {
361  ACE_ERROR((LM_NOTICE, "(%P|%t) NOTICE: DomainParticipantImpl::delete_subscriber: "
362  "Failed to delete contained entities: %C\n", retcode_to_string(ret)));
363  }
364  return ret;
365  }
366 
367  {
370  if (remove(subscribers_, sub_pair) == -1) {
371  if (log_level >= LogLevel::Notice) {
372  ACE_ERROR((LM_NOTICE, "(%P|%t) NOTICE: DomainParticipantImpl::delete_subscriber: "
373  "subscriber not found\n"));
374  }
375  return DDS::RETCODE_ERROR;
376  }
377  }
378 
379  return DDS::RETCODE_OK;
380 }
OpenDDS_Dcps_Export LogLevel log_level
#define ACE_ERROR(X)
const char * retcode_to_string(DDS::ReturnCode_t value)
Definition: DCPS_Utils.cpp:29
Objref_Servant_Pair< SubscriberImpl, DDS::Subscriber, DDS::Subscriber_ptr, DDS::Subscriber_var > Subscriber_Pair
const ReturnCode_t RETCODE_OK
SubscriberSet subscribers_
Collection of subscribers.
const ReturnCode_t RETCODE_PRECONDITION_NOT_MET
#define ACE_GUARD_RETURN(MUTEX, OBJ, LOCK, RETURN)
const ReturnCode_t RETCODE_ERROR
ACE_Recursive_Thread_Mutex subscribers_protector_
Protect the subscriber collection.
std::string String

◆ delete_topic()

DDS::ReturnCode_t OpenDDS::DCPS::DomainParticipantImpl::delete_topic ( DDS::Topic_ptr  a_topic)
virtual

Definition at line 595 of file DomainParticipantImpl.cpp.

References delete_topic_i().

597 {
598  return delete_topic_i(a_topic, false);
599 }
DDS::ReturnCode_t delete_topic_i(DDS::Topic_ptr a_topic, bool remove_objref)

◆ delete_topic_i()

DDS::ReturnCode_t OpenDDS::DCPS::DomainParticipantImpl::delete_topic_i ( DDS::Topic_ptr  a_topic,
bool  remove_objref 
)
private

Delete the topic with option of whether the topic object reference should be removed.

Definition at line 601 of file DomainParticipantImpl.cpp.

References ACE_DEBUG, ACE_ERROR, ACE_GUARD_RETURN, OpenDDS::DCPS::DCPS_debug_level, domain_id_, get_domain_id(), OpenDDS::DCPS::TopicImpl::get_id(), get_id(), OpenDDS::DCPS::TopicDescriptionImpl::get_name(), OpenDDS::DCPS::TopicDescriptionImpl::get_participant(), OpenDDS::DCPS::TopicDescriptionImpl::has_entity_refs(), TAO::String_var< charT >::in(), LM_DEBUG, LM_NOTICE, OpenDDS::DCPS::log_level, OpenDDS::DCPS::LogLevel::Notice, OpenDDS::DCPS::REMOVED, DDS::RETCODE_ERROR, DDS::RETCODE_OK, DDS::RETCODE_PRECONDITION_NOT_MET, TheServiceParticipant, topics_, topics_protector_, and OpenDDS::DCPS::topicstatus_to_string().

Referenced by delete_topic(), and handle_exception().

604 {
606 
607  try {
608  // The servant's ref count should be greater than 2 at this point,
609  // one referenced by poa, one referenced by the topic map and
610  // others referenced by the datareader/datawriter.
611  TopicImpl* the_topic_servant = dynamic_cast<TopicImpl*>(a_topic);
612 
613  if (!the_topic_servant) {
614  if (log_level >= LogLevel::Notice) {
615  ACE_ERROR((LM_NOTICE, "(%P|%t) NOTICE: DomainParticipantImpl::delete_topic_i: %p\n"
616  "failed to obtain TopicImpl."));
617  }
618  return DDS::RETCODE_ERROR;
619  }
620 
621  DDS::DomainParticipant_var dp = the_topic_servant->get_participant();
622 
623  DomainParticipantImpl* the_dp_servant =
624  dynamic_cast<DomainParticipantImpl*>(dp.in());
625 
626  if (the_dp_servant != this) {
627  if (log_level >= LogLevel::Notice) {
628  ACE_ERROR((LM_NOTICE, "(%P|%t) NOTICE: DomainParticipantImpl::delete_topic_i: "
629  "will return PRECONDITION_NOT_MET because this is not the "
630  "participant that owns this topic\n"));
631  }
633  }
634  if (!remove_objref && the_topic_servant->has_entity_refs()) {
635  // If entity_refs is true (nonzero), then some reader or writer is using
636  // this topic and the spec requires delete_topic() to fail with the error:
637  if (log_level >= LogLevel::Notice) {
638  ACE_ERROR((LM_NOTICE, "(%P|%t) NOTICE: DomainParticipantImpl::delete_topic_i: "
639  "will return PRECONDITION_NOT_MET because there are still "
640  "outstanding references to this topic\n"));
641  }
643  }
644 
645  {
647  tao_mon,
648  this->topics_protector_,
650 
651  CORBA::String_var topic_name = the_topic_servant->get_name();
652  TopicMap::mapped_type* entry = 0;
653 
654  TopicMapIteratorPair iters = topics_.equal_range(topic_name.in());
655  TopicMapIterator iter;
656  for (iter = iters.first; iter != iters.second; ++iter) {
657  if (iter->second.pair_.svt_ == the_topic_servant) {
658  entry = &iter->second;
659  break;
660  }
661  }
662  if (entry == 0) {
663  if (log_level >= LogLevel::Notice) {
664  ACE_ERROR((LM_NOTICE, "(%P|%t) NOTICE: DomainParticipantImpl::delete_topic_i: not found\n"));
665  }
666  return DDS::RETCODE_ERROR;
667  }
668 
669  const CORBA::ULong client_refs = --entry->client_refs_;
670 
671  if (remove_objref || 0 == client_refs) {
672  const GUID_t topicId = the_topic_servant->get_id();
673  topics_.erase(iter);
674 
675  Discovery_rch disco = TheServiceParticipant->get_discovery(domain_id_);
676  TopicStatus status = disco->remove_topic(
677  the_dp_servant->get_domain_id(), the_dp_servant->get_id(), topicId);
678 
679  if (status != REMOVED) {
680  if (log_level >= LogLevel::Notice) {
681  ACE_ERROR((LM_NOTICE, "(%P|%t) NOTICE: DomainParticipantImpl::delete_topic_i, "
682  "remove_topic failed with return value <%C>\n", topicstatus_to_string(status)));
683  }
684  return DDS::RETCODE_ERROR;
685  }
686 
687  return DDS::RETCODE_OK;
688 
689  } else {
690  if (DCPS_debug_level > 4) {
691  ACE_DEBUG((LM_DEBUG, "(%P|%t) DomainParticipantImpl::delete_topic_i: "
692  "Didn't remove topic from the map, remove_objref %d client_refs %d\n",
693  remove_objref, client_refs));
694  }
695  }
696  }
697 
698  } catch (...) {
699  if (log_level >= LogLevel::Notice) {
700  ACE_ERROR((LM_NOTICE, "(%P|%t) NOTICE: DomainParticipantImpl::delete_topic_i, "
701  " Caught Unknown Exception\n"));
702  }
703  ret = DDS::RETCODE_ERROR;
704  }
705 
706  return ret;
707 }
OpenDDS_Dcps_Export LogLevel log_level
#define ACE_DEBUG(X)
#define ACE_ERROR(X)
RcHandle< Discovery > Discovery_rch
Definition: Discovery.h:296
const ReturnCode_t RETCODE_OK
DomainParticipantImpl(InstanceHandleGenerator &handle_generator, const DDS::DomainId_t &domain_id, const DDS::DomainParticipantQos &qos, DDS::DomainParticipantListener_ptr a_listener, const DDS::StatusMask &mask)
const DDS::DomainId_t domain_id_
The id of the domain that creates this participant.
ACE_Recursive_Thread_Mutex topics_protector_
Protect the topic collection.
std::pair< TopicMapIterator, TopicMapIterator > TopicMapIteratorPair
const char * topicstatus_to_string(TopicStatus value)
Definition: DCPS_Utils.cpp:70
const ReturnCode_t RETCODE_PRECONDITION_NOT_MET
ACE_CDR::ULong ULong
#define ACE_GUARD_RETURN(MUTEX, OBJ, LOCK, RETURN)
const ReturnCode_t RETCODE_ERROR
OpenDDS_Dcps_Export unsigned int DCPS_debug_level
Definition: debug.cpp:30
TopicMap topics_
Collection of topics.
const character_type * in(void) const
#define TheServiceParticipant

◆ deref_filter_eval()

void OpenDDS::DCPS::DomainParticipantImpl::deref_filter_eval ( const char *  filter)

Definition at line 1038 of file DomainParticipantImpl.cpp.

References ACE_GUARD, and filter_cache_lock_.

1039 {
1041  typedef std::map<OPENDDS_STRING, RcHandle<FilterEvaluator> > Map;
1042  Map::iterator iter = filter_cache_.find(filter);
1043  if (iter != filter_cache_.end()) {
1044  if (iter->second->ref_count() == 1) {
1045  filter_cache_.erase(iter);
1046  }
1047  }
1048 }
#define ACE_GUARD(MUTEX, OBJ, LOCK)

◆ enable()

DDS::ReturnCode_t OpenDDS::DCPS::DomainParticipantImpl::enable ( )
virtual

Implements DDS::Entity.

Definition at line 1617 of file DomainParticipantImpl.cpp.

References access(), ACE_DEBUG, ACE_ERROR, ACE_TEXT(), DDS::Security::ParticipantSecurityAttributes::allow_unauthenticated_participants, DDS::EntityFactoryQosPolicy::autoenable_created_entities, bit_subscriber_, DDS::Security::SecurityException::code, OpenDDS::DCPS::DCPS_debug_level, domain_id_, dp_id_, DDS::DomainParticipantQos::entity_factory, OpenDDS::DCPS::AddDomainStatus::federated, federated_, Util::filter_properties(), OpenDDS::DCPS::GUID_UNKNOWN, DDS::HANDLE_NIL, OpenDDS::DCPS::AddDomainStatus::id, id_handle_, OpenDDS::DCPS::EntityImpl::is_enabled(), OpenDDS::DCPS::RcHandle< T >::is_nil(), DDS::Security::ParticipantSecurityAttributes::is_rtps_protected, LM_DEBUG, LM_ERROR, DDS::Security::SecurityException::message, DDS::Security::SecurityException::minor_code, monitor_, part_crypto_handle_, perm_handle_, DDS::DomainParticipantQos::property, publishers_, qos_, DDS::RETCODE_ERROR, DDS::Security::RETCODE_NOT_ALLOWED_BY_SECURITY, DDS::RETCODE_OK, security_config_, OpenDDS::DCPS::security_debug, OpenDDS::DCPS::EntityImpl::set_enabled(), subscribers_, TheSecurityRegistry, TheServiceParticipant, TheTransientKludge, topics_, type_lookup_service_, DDS::Security::VALIDATION_OK, value, and DDS::PropertyQosPolicy::value.

1618 {
1619  //According spec:
1620  // - Calling enable on an already enabled Entity returns OK and has no
1621  // effect.
1622  // - Calling enable on an Entity whose factory is not enabled will fail
1623  // and return PRECONDITION_NOT_MET.
1624 
1625  if (this->is_enabled()) {
1626  return DDS::RETCODE_OK;
1627  }
1628 
1629 #ifdef OPENDDS_SECURITY
1630  if (!security_config_ && TheServiceParticipant->get_security()) {
1631  security_config_ = TheSecurityRegistry->default_config();
1632  if (!security_config_) {
1633  security_config_ = TheSecurityRegistry->builtin_config();
1634  TheSecurityRegistry->default_config(security_config_);
1635  }
1636  }
1637 #endif
1638 
1639  Discovery_rch disco = TheServiceParticipant->get_discovery(domain_id_);
1640 
1641  if (disco.is_nil()) {
1642  if (DCPS_debug_level > 0) {
1643  ACE_ERROR((LM_ERROR,
1644  ACE_TEXT("(%P|%t) ERROR: DomainParticipantImpl::enable, ")
1645  ACE_TEXT("no discovery found for domain id: %d.\n"), domain_id_));
1646  }
1647  return DDS::RETCODE_ERROR;
1648  }
1649 
1650 #ifdef OPENDDS_SECURITY
1651  if (TheServiceParticipant->get_security() && !security_config_) {
1652  if (DCPS::security_debug.new_entity_error) {
1653  ACE_ERROR((LM_ERROR,
1654  ACE_TEXT("(%P|%t) ERROR: DomainParticipantImpl::enable, ")
1655  ACE_TEXT("DCPSSecurity flag is set, but unable to load security plugin configuration.\n")));
1656  }
1657  return DDS::RETCODE_ERROR;
1658  }
1659 #endif
1660 
1661  AddDomainStatus value = {GUID_UNKNOWN, false};
1662 
1663 #ifdef OPENDDS_SECURITY
1664  if (TheServiceParticipant->get_security() && security_config_->qos_implies_security(qos_)) {
1665  Security::Authentication_var auth = security_config_->get_authentication();
1666 
1669  auth->validate_local_identity(id_handle_, dp_id_, domain_id_, qos_, disco->generate_participant_guid(), se);
1670 
1671  /* TODO - Handle VALIDATION_PENDING_RETRY */
1672  if (val_res != DDS::Security::VALIDATION_OK) {
1673  if (DCPS::security_debug.new_entity_error) {
1674  ACE_ERROR((LM_ERROR,
1675  ACE_TEXT("(%P|%t) ERROR: DomainParticipantImpl::enable, ")
1676  ACE_TEXT("Unable to validate local identity. SecurityException[%d.%d]: %C\n"),
1677  se.code, se.minor_code, se.message.in()));
1678  }
1680  }
1681 
1682  Security::AccessControl_var access = security_config_->get_access_control();
1683 
1684  perm_handle_ = access->validate_local_permissions(auth, id_handle_, domain_id_, qos_, se);
1685 
1686  if (perm_handle_ == DDS::HANDLE_NIL) {
1687  if (DCPS::security_debug.new_entity_error) {
1688  ACE_ERROR((LM_ERROR,
1689  ACE_TEXT("(%P|%t) ERROR: DomainParticipantImpl::enable, ")
1690  ACE_TEXT("Unable to validate local permissions. SecurityException[%d.%d]: %C\n"),
1691  se.code, se.minor_code, se.message.in()));
1692  }
1694  }
1695 
1696  const bool check_create = access->check_create_participant(perm_handle_, domain_id_, qos_, se);
1697  if (!check_create) {
1698  if (DCPS::security_debug.new_entity_error) {
1699  ACE_ERROR((LM_ERROR,
1700  ACE_TEXT("(%P|%t) ERROR: DomainParticipantImpl::enable, ")
1701  ACE_TEXT("Unable to create participant. SecurityException[%d.%d]: %C\n"),
1702  se.code, se.minor_code, se.message.in()));
1703  }
1705  }
1706 
1708  const bool check_part_sec_attr = access->get_participant_sec_attributes(perm_handle_, part_sec_attr, se);
1709 
1710  if (!check_part_sec_attr) {
1711  if (DCPS::security_debug.new_entity_error) {
1712  ACE_ERROR((LM_ERROR,
1713  ACE_TEXT("(%P|%t) ERROR: DomainParticipantImpl::enable,")
1714  ACE_TEXT("Unable to get participant security attributes. SecurityException[%d.%d]: %C\n"),
1715  se.code, se.minor_code, se.message.in()));
1716  }
1717  return DDS::RETCODE_ERROR;
1718  }
1719 
1720  if (part_sec_attr.is_rtps_protected) { // DDS-Security v1.1 8.4.2.4 Table 27 is_rtps_protected
1721  if (part_sec_attr.allow_unauthenticated_participants) {
1722  if (DCPS::security_debug.new_entity_error) {
1723  ACE_ERROR((LM_ERROR,
1724  ACE_TEXT("(%P|%t) ERROR: DomainParticipantImpl::enable, ")
1725  ACE_TEXT("allow_unauthenticated_participants is not possible with is_rtps_protected\n")));
1726  }
1728  }
1729 
1730  const Security::CryptoKeyFactory_var crypto = security_config_->get_crypto_key_factory();
1731  part_crypto_handle_ = crypto->register_local_participant(id_handle_, perm_handle_,
1732  Util::filter_properties(qos_.property.value, "dds.sec.crypto."), part_sec_attr, se);
1734  if (DCPS::security_debug.new_entity_error) {
1735  ACE_ERROR((LM_ERROR,
1736  ACE_TEXT("(%P|%t) ERROR: DomainParticipantImpl::enable, ")
1737  ACE_TEXT("Unable to register local participant. SecurityException[%d.%d]: %C\n"),
1738  se.code, se.minor_code, se.message.in()));
1739  }
1740  return DDS::RETCODE_ERROR;
1741  }
1742 
1743  } else {
1745  }
1746 
1747  value = disco->add_domain_participant_secure(domain_id_, qos_, type_lookup_service_,
1749 
1750  if (value.id == GUID_UNKNOWN) {
1751  if (DCPS::security_debug.new_entity_error) {
1752  ACE_ERROR((LM_ERROR,
1753  ACE_TEXT("(%P|%t) ERROR: DomainParticipantImpl::enable, ")
1754  ACE_TEXT("add_domain_participant_secure returned invalid id.\n")));
1755  }
1756  return DDS::RETCODE_ERROR;
1757  }
1758 
1759  } else {
1760 #endif
1761 
1762  value = disco->add_domain_participant(domain_id_, qos_, type_lookup_service_);
1763 
1764  if (value.id == GUID_UNKNOWN) {
1765  if (DCPS_debug_level > 0) {
1766  ACE_ERROR((LM_ERROR,
1767  ACE_TEXT("(%P|%t) ERROR: DomainParticipantImpl::enable, ")
1768  ACE_TEXT("add_domain_participant returned invalid id.\n")));
1769  }
1770  return DDS::RETCODE_ERROR;
1771  }
1772 
1773 #ifdef OPENDDS_SECURITY
1774  }
1775 #endif
1776 
1777  dp_id_ = value.id;
1778  federated_ = value.federated;
1779 
1780  if (monitor_) {
1781  monitor_->report();
1782  }
1783 
1784  if (TheServiceParticipant->monitor_) {
1785  TheServiceParticipant->monitor_->report();
1786  }
1787 
1788  const DDS::ReturnCode_t ret = this->set_enabled();
1789 
1790  if (DCPS_debug_level > 1) {
1791  ACE_DEBUG((LM_DEBUG, ACE_TEXT("(%P|%t) DomainParticipantImpl::enable: ")
1792  ACE_TEXT("enabled participant %C in domain %d\n"),
1793  LogGuid(dp_id_).c_str(), domain_id_));
1794  }
1795 
1796  if (ret == DDS::RETCODE_OK && !TheTransientKludge->is_enabled()) {
1797  Discovery_rch disc = TheServiceParticipant->get_discovery(this->domain_id_);
1798  this->bit_subscriber_ = disc->init_bit(this);
1799  }
1800 
1801  if (ret != DDS::RETCODE_OK) {
1802  return ret;
1803  }
1804 
1806 
1807  for (TopicMap::iterator it = topics_.begin(); it != topics_.end(); ++it) {
1808  it->second.pair_.svt_->enable();
1809  }
1810 
1811  for (PublisherSet::iterator it = publishers_.begin(); it != publishers_.end(); ++it) {
1812  it->svt_->enable();
1813  }
1814 
1815  for (SubscriberSet::iterator it = subscribers_.begin(); it != subscribers_.end(); ++it) {
1816  it->svt_->enable();
1817  }
1818  }
1819 
1820  return DDS::RETCODE_OK;
1821 }
GUID_t dp_id_
This participant id given by discovery.
#define ACE_DEBUG(X)
#define ACE_ERROR(X)
RcHandle< Discovery > Discovery_rch
Definition: Discovery.h:296
const LogLevel::Value value
Definition: debug.cpp:61
int access(const char *path, int amode)
const ReturnCode_t RETCODE_OK
DDS::PropertySeq filter_properties(const DDS::PropertySeq &properties, const std::string &prefix)
const InstanceHandle_t HANDLE_NIL
SubscriberSet subscribers_
Collection of subscribers.
const GUID_t GUID_UNKNOWN
Nil value for GUID.
Definition: GuidUtils.h:59
const DDS::DomainId_t domain_id_
The id of the domain that creates this participant.
DDS::ReturnCode_t set_enabled()
Definition: EntityImpl.cpp:40
XTypes::TypeLookupService_rch type_lookup_service_
Security::SecurityConfig_rch security_config_
DDS::Security::ParticipantCryptoHandle part_crypto_handle_
This participant crypto handle given by crypto.
PublisherSet publishers_
Collection of publishers.
#define TheTransientKludge
const ReturnCode_t RETCODE_ERROR
#define TheSecurityRegistry
EntityFactoryQosPolicy entity_factory
OpenDDS_Dcps_Export unsigned int DCPS_debug_level
Definition: debug.cpp:30
RcHandle< BitSubscriber > bit_subscriber_
The built in topic subscriber.
DDS::Security::IdentityHandle id_handle_
This participant id handle given by authentication.
const ReturnCode_t RETCODE_NOT_ALLOWED_BY_SECURITY
TopicMap topics_
Collection of topics.
ACE_TEXT("TCP_Factory")
DDS::Security::PermissionsHandle perm_handle_
This participant permissions handle given by access constrol.
OpenDDS_Dcps_Export SecurityDebug security_debug
Definition: debug.cpp:32
#define TheServiceParticipant
PropertyQosPolicy property
DDS::DomainParticipantQos qos_
The qos of this DomainParticipant.

◆ federated()

bool OpenDDS::DCPS::DomainParticipantImpl::federated ( ) const
inline

Definition at line 371 of file DomainParticipantImpl.h.

Referenced by OpenDDS::DCPS::InfoRepoDiscovery::init_bit().

371  {
372  return this->federated_;
373  }

◆ find_topic()

DDS::Topic_ptr OpenDDS::DCPS::DomainParticipantImpl::find_topic ( const char *  topic_name,
const DDS::Duration_t timeout 
)
virtual

Definition at line 710 of file DomainParticipantImpl.cpp.

References ACE_DEBUG, ACE_ERROR, ACE_TEXT(), create_new_topic(), OpenDDS::DCPS::DCPS_debug_level, OpenDDS::DCPS::DEFAULT_STATUS_MASK, domain_id_, OpenDDS::DCPS::FOUND, get_id(), TAO::String_var< charT >::in(), OpenDDS::DCPS::INTERNAL_ERROR, CORBA::is_nil(), LM_DEBUG, LM_ERROR, OpenDDS::DCPS::TimePoint_T< MonotonicClock >::now(), TAO::String_var< charT >::out(), Registered_Data_Types, ACE_Time_Value::sec(), ACE_OS::sleep(), TheServiceParticipant, and OpenDDS::DCPS::TimeDuration::value().

713 {
714  const MonotonicTimePoint timeout_at(MonotonicTimePoint::now() + TimeDuration(timeout));
715 
716  bool first_time = true;
717  while (first_time || MonotonicTimePoint::now() < timeout_at) {
718  if (first_time) {
719  first_time = false;
720  }
721 
722  GUID_t topic_id;
723  CORBA::String_var type_name;
724  DDS::TopicQos_var qos;
725 
726  Discovery_rch disco = TheServiceParticipant->get_discovery(domain_id_);
727  TopicStatus status = disco->find_topic(domain_id_,
728  get_id(),
729  topic_name,
730  type_name.out(),
731  qos.out(),
732  topic_id);
733 
735  if (status == FOUND) {
736  OpenDDS::DCPS::TypeSupport_var type_support =
737  Registered_Data_Types->lookup(this, type_name.in());
738  if (CORBA::is_nil(type_support)) {
739  if (DCPS_debug_level) {
740  ACE_ERROR((LM_ERROR, ACE_TEXT("(%P|%t) ERROR: ")
741  ACE_TEXT("DomainParticipantImpl::find_topic, ")
742  ACE_TEXT("can't create a Topic: type_name \"%C\" ")
743  ACE_TEXT("is not registered.\n"), type_name.in()));
744  }
745 
746  return DDS::Topic::_nil();
747  }
748 
749  DDS::Topic_ptr new_topic = create_new_topic(topic_name,
750  type_name,
751  qos,
752  DDS::TopicListener::_nil(),
754  type_support);
755  return new_topic;
756 
757  } else if (status == INTERNAL_ERROR) {
758  if (DCPS_debug_level > 0) {
759  ACE_ERROR((LM_ERROR,
760  ACE_TEXT("(%P|%t) ERROR: DomainParticipantImpl::find_topic - ")
761  ACE_TEXT("topic not found, discovery returned INTERNAL_ERROR!\n")));
762  }
763  return DDS::Topic::_nil();
764  } else if (now < timeout_at) {
765  const TimeDuration remaining = timeout_at - now;
766 
767  if (remaining.value().sec() >= 1) {
768  ACE_OS::sleep(1);
769 
770  } else {
771  ACE_OS::sleep(remaining.value());
772  }
773  }
774  }
775 
776  if (DCPS_debug_level >= 1) {
777  // timed out
778  ACE_DEBUG((LM_DEBUG,
779  ACE_TEXT("(%P|%t) DomainParticipantImpl::find_topic, ")
780  ACE_TEXT("timed out.\n")));
781  }
782 
783  return DDS::Topic::_nil();
784 }
#define ACE_DEBUG(X)
#define ACE_ERROR(X)
RcHandle< Discovery > Discovery_rch
Definition: Discovery.h:296
character_type *& out(void)
static TimePoint_T< MonotonicClock > now()
Definition: TimePoint_T.inl:41
DDS::Topic_ptr create_new_topic(const char *topic_name, const char *type_name, const DDS::TopicQos &qos, DDS::TopicListener_ptr a_listener, const DDS::StatusMask &mask, OpenDDS::DCPS::TypeSupport_ptr type_support)
int sleep(u_int seconds)
const DDS::StatusMask DEFAULT_STATUS_MASK
const DDS::DomainId_t domain_id_
The id of the domain that creates this participant.
#define Registered_Data_Types
OpenDDS_Dcps_Export unsigned int DCPS_debug_level
Definition: debug.cpp:30
TimePoint_T< MonotonicClock > MonotonicTimePoint
Definition: TimeTypes.h:51
ACE_TEXT("TCP_Factory")
const character_type * in(void) const
#define TheServiceParticipant
Boolean is_nil(T x)

◆ get_builtin_subscriber()

DDS::Subscriber_ptr OpenDDS::DCPS::DomainParticipantImpl::get_builtin_subscriber ( )
virtual

Implements DDS::DomainParticipant.

Definition at line 383 of file DomainParticipantImpl.cpp.

References bit_subscriber_.

Referenced by OpenDDS::DCPS::instance_handle_to_bit_data().

384 {
385  return bit_subscriber_->get();
386 }
RcHandle< BitSubscriber > bit_subscriber_
The built in topic subscriber.

◆ get_builtin_subscriber_proxy()

RcHandle< BitSubscriber > OpenDDS::DCPS::DomainParticipantImpl::get_builtin_subscriber_proxy ( )

Definition at line 389 of file DomainParticipantImpl.cpp.

References bit_subscriber_.

390 {
391  return bit_subscriber_;
392 }
RcHandle< BitSubscriber > bit_subscriber_
The built in topic subscriber.

◆ get_current_time()

DDS::ReturnCode_t OpenDDS::DCPS::DomainParticipantImpl::get_current_time ( DDS::Time_t current_time)
virtual

Set Argument to Current System Time

Definition at line 1514 of file DomainParticipantImpl.cpp.

References OpenDDS::DCPS::TimePoint_T< SystemClock >::now(), DDS::RETCODE_OK, and OpenDDS::DCPS::TimePoint_T< AceClock >::to_dds_time().

1515 {
1516  current_time = SystemTimePoint::now().to_dds_time();
1517  return DDS::RETCODE_OK;
1518 }
const ReturnCode_t RETCODE_OK
static TimePoint_T< SystemClock > now()
Definition: TimePoint_T.inl:41
DDS::Time_t to_dds_time() const
Definition: TimePoint_T.inl:89

◆ get_default_publisher_qos()

DDS::ReturnCode_t OpenDDS::DCPS::DomainParticipantImpl::get_default_publisher_qos ( DDS::PublisherQos qos)
virtual

Definition at line 1464 of file DomainParticipantImpl.cpp.

References default_publisher_qos_, and DDS::RETCODE_OK.

Referenced by validate_publisher_qos().

1466 {
1467  qos = default_publisher_qos_;
1468  return DDS::RETCODE_OK;
1469 }
const ReturnCode_t RETCODE_OK
DDS::PublisherQos default_publisher_qos_
The default publisher qos.

◆ get_default_subscriber_qos()

DDS::ReturnCode_t OpenDDS::DCPS::DomainParticipantImpl::get_default_subscriber_qos ( DDS::SubscriberQos qos)
virtual

Definition at line 1485 of file DomainParticipantImpl.cpp.

References default_subscriber_qos_, and DDS::RETCODE_OK.

Referenced by validate_subscriber_qos().

1487 {
1489  return DDS::RETCODE_OK;
1490 }
const ReturnCode_t RETCODE_OK
DDS::SubscriberQos default_subscriber_qos_
The default subscriber qos.

◆ get_default_topic_qos()

DDS::ReturnCode_t OpenDDS::DCPS::DomainParticipantImpl::get_default_topic_qos ( DDS::TopicQos qos)
virtual

Definition at line 1506 of file DomainParticipantImpl.cpp.

References default_topic_qos_, and DDS::RETCODE_OK.

Referenced by create_topic_i().

1508 {
1509  qos = default_topic_qos_;
1510  return DDS::RETCODE_OK;
1511 }
const ReturnCode_t RETCODE_OK
DDS::TopicQos default_topic_qos_
The default topic qos.

◆ get_discovered_participant_data()

DDS::ReturnCode_t OpenDDS::DCPS::DomainParticipantImpl::get_discovered_participant_data ( DDS::ParticipantBuiltinTopicData participant_data,
DDS::InstanceHandle_t  participant_handle 
)
virtual

Definition at line 1545 of file DomainParticipantImpl.cpp.

References ACE_GUARD_RETURN, bit_subscriber_, OpenDDS::DCPS::GuidConverter::entityKind(), handle_protector_, handles_, OpenDDS::DCPS::KIND_PARTICIPANT, DDS::RETCODE_ERROR, and DDS::RETCODE_PRECONDITION_NOT_MET.

1547 {
1548  {
1550 
1551  bool found = false;
1552  const CountedHandleMap::const_iterator itEnd = handles_.end();
1553  for (CountedHandleMap::const_iterator iter = handles_.begin(); iter != itEnd; ++iter) {
1554  GuidConverter converter(iter->first);
1555 
1556  if (participant_handle == iter->second.first
1557  && converter.entityKind() == KIND_PARTICIPANT) {
1558  found = true;
1559  break;
1560  }
1561  }
1562 
1563  if (!found)
1565  }
1566 
1567  return bit_subscriber_->get_discovered_participant_data(participant_data, participant_handle);
1568 }
ENTITYKIND_BUILTIN_PARTICIPANT.
Definition: GuidUtils.h:68
const ReturnCode_t RETCODE_PRECONDITION_NOT_MET
#define ACE_GUARD_RETURN(MUTEX, OBJ, LOCK, RETURN)
const ReturnCode_t RETCODE_ERROR
RcHandle< BitSubscriber > bit_subscriber_
The built in topic subscriber.
CountedHandleMap handles_
Instance handles assigned which are mapped to GUIDs (use handle_protector_)
ACE_Thread_Mutex handle_protector_
Protect the handle collection.

◆ get_discovered_participants()

DDS::ReturnCode_t OpenDDS::DCPS::DomainParticipantImpl::get_discovered_participants ( DDS::InstanceHandleSeq participant_handles)
virtual

Definition at line 1523 of file DomainParticipantImpl.cpp.

References ACE_GUARD_RETURN, dp_id_, OpenDDS::DCPS::GuidConverter::entityKind(), handle_protector_, handles_, ignored_participants_, OpenDDS::DCPS::KIND_PARTICIPANT, OpenDDS::DCPS::push_back(), DDS::RETCODE_ERROR, and DDS::RETCODE_OK.

1524 {
1526 
1527  const CountedHandleMap::const_iterator itEnd = handles_.end();
1528  for (CountedHandleMap::const_iterator iter = handles_.begin(); iter != itEnd; ++iter) {
1529  GuidConverter converter(iter->first);
1530 
1531  if (converter.entityKind() == KIND_PARTICIPANT) {
1532  // skip itself and the ignored participant
1533  if (iter->first == dp_id_ || ignored_participants_.count(iter->first)) {
1534  continue;
1535  }
1536 
1537  push_back(participant_handles, iter->second.first);
1538  }
1539  }
1540 
1541  return DDS::RETCODE_OK;
1542 }
GUID_t dp_id_
This participant id given by discovery.
ENTITYKIND_BUILTIN_PARTICIPANT.
Definition: GuidUtils.h:68
const ReturnCode_t RETCODE_OK
HandleMap ignored_participants_
Collection of ignored participants.
#define ACE_GUARD_RETURN(MUTEX, OBJ, LOCK, RETURN)
const ReturnCode_t RETCODE_ERROR
void push_back(Seq &seq, const typename Seq::value_type &val)
std::vector-style push_back() for CORBA Sequences
Definition: Util.h:138
CountedHandleMap handles_
Instance handles assigned which are mapped to GUIDs (use handle_protector_)
ACE_Thread_Mutex handle_protector_
Protect the handle collection.

◆ get_discovered_topic_data()

DDS::ReturnCode_t OpenDDS::DCPS::DomainParticipantImpl::get_discovered_topic_data ( DDS::TopicBuiltinTopicData topic_data,
DDS::InstanceHandle_t  topic_handle 
)
virtual

Definition at line 1591 of file DomainParticipantImpl.cpp.

References ACE_GUARD_RETURN, bit_subscriber_, handle_protector_, handles_, OpenDDS::DCPS::GuidConverter::isTopic(), DDS::RETCODE_ERROR, and DDS::RETCODE_PRECONDITION_NOT_MET.

1593 {
1594  {
1596 
1597  bool found = false;
1598  const CountedHandleMap::const_iterator itEnd = handles_.end();
1599  for (CountedHandleMap::const_iterator iter = handles_.begin(); iter != itEnd; ++iter) {
1600  GuidConverter converter(iter->first);
1601  if (topic_handle == iter->second.first && converter.isTopic()) {
1602  found = true;
1603  break;
1604  }
1605  }
1606 
1607  if (!found)
1609  }
1610 
1611  return bit_subscriber_->get_discovered_topic_data(topic_data, topic_handle);
1612 }
const ReturnCode_t RETCODE_PRECONDITION_NOT_MET
#define ACE_GUARD_RETURN(MUTEX, OBJ, LOCK, RETURN)
const ReturnCode_t RETCODE_ERROR
RcHandle< BitSubscriber > bit_subscriber_
The built in topic subscriber.
CountedHandleMap handles_
Instance handles assigned which are mapped to GUIDs (use handle_protector_)
ACE_Thread_Mutex handle_protector_
Protect the handle collection.

◆ get_discovered_topics()

DDS::ReturnCode_t OpenDDS::DCPS::DomainParticipantImpl::get_discovered_topics ( DDS::InstanceHandleSeq topic_handles)
virtual

Definition at line 1571 of file DomainParticipantImpl.cpp.

References ACE_GUARD_RETURN, handle_protector_, handles_, ignored_topics_, OpenDDS::DCPS::GuidConverter::isTopic(), OpenDDS::DCPS::push_back(), DDS::RETCODE_ERROR, and DDS::RETCODE_OK.

1572 {
1574 
1575  const CountedHandleMap::const_iterator itEnd = handles_.end();
1576  for (CountedHandleMap::const_iterator iter = handles_.begin(); iter != itEnd; ++iter) {
1577  GuidConverter converter(iter->first);
1578  if (converter.isTopic()) {
1579  if (ignored_topics_.count(iter->first)) {
1580  continue;
1581  }
1582 
1583  push_back(topic_handles, iter->second.first);
1584  }
1585  }
1586 
1587  return DDS::RETCODE_OK;
1588 }
const ReturnCode_t RETCODE_OK
#define ACE_GUARD_RETURN(MUTEX, OBJ, LOCK, RETURN)
const ReturnCode_t RETCODE_ERROR
HandleMap ignored_topics_
Collection of ignored topics.
void push_back(Seq &seq, const typename Seq::value_type &val)
std::vector-style push_back() for CORBA Sequences
Definition: Util.h:138
CountedHandleMap handles_
Instance handles assigned which are mapped to GUIDs (use handle_protector_)
ACE_Thread_Mutex handle_protector_
Protect the handle collection.

◆ get_domain_id()

DDS::DomainId_t OpenDDS::DCPS::DomainParticipantImpl::get_domain_id ( )
virtual

◆ get_dynamic_type()

DDS::ReturnCode_t OpenDDS::DCPS::DomainParticipantImpl::get_dynamic_type ( DDS::DynamicType_var &  type,
const DDS::BuiltinTopicKey_t key 
)

Definition at line 2617 of file DomainParticipantImpl.cpp.

References ACE_DEBUG, ACE_ERROR, OpenDDS::DCPS::bit_key_to_guid(), OpenDDS::XTypes::TypeInformation::complete, OpenDDS::DCPS::DCPS_debug_level, domain_id_, dp_id_, OpenDDS::XTypes::dynamic_type_is_valid(), LM_DEBUG, LM_NOTICE, OpenDDS::DCPS::log_level, OpenDDS::XTypes::TypeInformation::minimal, OpenDDS::DCPS::LogLevel::Notice, OPENDDS_END_VERSIONED_NAMESPACE_DECL, DDS::RETCODE_ERROR, DDS::RETCODE_NO_DATA, DDS::RETCODE_OK, OpenDDS::DCPS::retcode_to_string(), DDS::RETCODE_UNSUPPORTED, OpenDDS::XTypes::DynamicTypeImpl::set_complete_type_identifier(), OpenDDS::XTypes::DynamicTypeImpl::set_minimal_type_identifier(), OpenDDS::XTypes::DynamicTypeImpl::set_preset_type_info(), TheServiceParticipant, OpenDDS::XTypes::TypeIdentifierWithSize::type_id, type_lookup_service_, OpenDDS::XTypes::TypeIdentifierWithDependencies::typeid_with_size, OpenDDS::XTypes::TypeIdentifierWithSize::typeobject_serialized_size, and OpenDDS::DCPS::TypeObjReqCond::wait().

2619 {
2620  if (!type_lookup_service_) {
2621  if (log_level >= LogLevel::Notice) {
2622  ACE_ERROR((LM_NOTICE, "(%P|%t) NOTICE: DomainParticipantImpl::get_dynamic_type: "
2623  "Can't get a DynamicType, no type lookup service\n"));
2624  }
2625  return DDS::RETCODE_UNSUPPORTED;
2626  }
2627 
2628  XTypes::TypeInformation ti = type_lookup_service_->get_type_info(key);
2629  if (ti.complete.typeid_with_size.typeobject_serialized_size == 0) {
2630  if (log_level >= LogLevel::Notice) {
2631  ACE_ERROR((LM_NOTICE, "(%P|%t) NOTICE: DomainParticipantImpl::get_dynamic_type: "
2632  "Can't get a DynamicType, type info is missing complete\n"));
2633  }
2634  return DDS::RETCODE_NO_DATA;
2635  }
2636 
2637  const XTypes::TypeIdentifier& ctid = ti.complete.typeid_with_size.type_id;
2638  const GUID_t entity = bit_key_to_guid(key);
2639  if (!type_lookup_service_->has_complete(ctid)) {
2640  // We don't have it, try to asking the remote for the complete
2641  // TypeObjects.
2642  if (DCPS_debug_level >= 4) {
2643  ACE_DEBUG((LM_DEBUG, "(%P|%t) DomainParticipantImpl::get_dynamic_type: "
2644  "requesting remote complete TypeObject from %C\n", LogGuid(entity).c_str()));
2645  }
2646  Discovery_rch disco = TheServiceParticipant->get_discovery(domain_id_);
2647  TypeObjReqCond cond;
2648  disco->request_remote_complete_type_objects(domain_id_, dp_id_, entity, ti, cond);
2649  const DDS::ReturnCode_t rc = cond.wait();
2650  if (rc != DDS::RETCODE_OK) {
2651  if (log_level >= LogLevel::Notice) {
2652  ACE_ERROR((LM_NOTICE, "(%P|%t) NOTICE: DomainParticipantImpl::get_dynamic_type: "
2653  "Couldn't get remote complete type object: %C\n", retcode_to_string(rc)));
2654  }
2655  return rc;
2656  }
2657 
2658  if (!type_lookup_service_->has_complete(ctid)) {
2659  if (log_level >= LogLevel::Notice) {
2660  ACE_ERROR((LM_NOTICE, "(%P|%t) NOTICE: DomainParticipantImpl::get_dynamic_type: "
2661  "request_remote_complete_type_objects succeeded, but type lookup service still says it "
2662  "doesn't have the complete TypeObject?\n"));
2663  }
2664  return DDS::RETCODE_ERROR;
2665  }
2666  }
2667 
2668  DDS::DynamicType_var got_type = type_lookup_service_->type_identifier_to_dynamic(ctid, entity);
2669  if (!XTypes::dynamic_type_is_valid(got_type)) {
2670  if (log_level >= LogLevel::Notice) {
2671  ACE_ERROR((LM_NOTICE, "(%P|%t) NOTICE: DomainParticipantImpl::get_dynamic_type: "
2672  "Got an invalid DynamicType\n"));
2673  }
2674  return DDS::RETCODE_ERROR;
2675  }
2676  type = got_type;
2677 
2678  XTypes::DynamicTypeImpl* impl = dynamic_cast<XTypes::DynamicTypeImpl*>(type.in());
2679  impl->set_complete_type_identifier(ctid);
2680  impl->set_minimal_type_identifier(ti.minimal.typeid_with_size.type_id);
2681  impl->set_preset_type_info(ti);
2682 
2683  return DDS::RETCODE_OK;
2684 }
GUID_t dp_id_
This participant id given by discovery.
OpenDDS_Dcps_Export LogLevel log_level
#define ACE_DEBUG(X)
#define ACE_ERROR(X)
const char * retcode_to_string(DDS::ReturnCode_t value)
Definition: DCPS_Utils.cpp:29
RcHandle< Discovery > Discovery_rch
Definition: Discovery.h:296
const ReturnCode_t RETCODE_OK
const ReturnCode_t RETCODE_NO_DATA
const DDS::DomainId_t domain_id_
The id of the domain that creates this participant.
XTypes::TypeLookupService_rch type_lookup_service_
const ReturnCode_t RETCODE_ERROR
OpenDDS_Dcps_Export GUID_t bit_key_to_guid(const DDS::BuiltinTopicKey_t &key)
Definition: GuidUtils.h:251
OpenDDS_Dcps_Export unsigned int DCPS_debug_level
Definition: debug.cpp:30
const ReturnCode_t RETCODE_UNSUPPORTED
#define TheServiceParticipant
bool dynamic_type_is_valid(DDS::DynamicType_ptr type)
Definition: XTypes/Utils.h:20

◆ get_filter_eval()

RcHandle< FilterEvaluator > OpenDDS::DCPS::DomainParticipantImpl::get_filter_eval ( const char *  filter)

Definition at line 1015 of file DomainParticipantImpl.cpp.

References ACE_ERROR, ACE_GUARD_RETURN, ACE_TEXT(), OpenDDS::DCPS::DCPS_debug_level, filter_cache_lock_, and LM_ERROR.

1016 {
1018  RcHandle<FilterEvaluator>());
1019 
1020  RcHandle<FilterEvaluator>& result = filter_cache_[filter];
1021  if (!result) {
1022  try {
1023  result = make_rch<FilterEvaluator>(filter, false);
1024  } catch (const std::exception& e) {
1025  filter_cache_.erase(filter);
1026  if (DCPS_debug_level) {
1027  ACE_ERROR((LM_ERROR, ACE_TEXT("(%P|%t) ERROR: ")
1028  ACE_TEXT("DomainParticipantImpl::get_filter_eval, ")
1029  ACE_TEXT("can't create a writer-side content filter due to ")
1030  ACE_TEXT("runtime error: %C.\n"), e.what()));
1031  }
1032  }
1033  }
1034  return result;
1035 }
#define ACE_ERROR(X)
#define ACE_GUARD_RETURN(MUTEX, OBJ, LOCK, RETURN)
OpenDDS_Dcps_Export unsigned int DCPS_debug_level
Definition: debug.cpp:30
ACE_TEXT("TCP_Factory")

◆ get_id()

GUID_t OpenDDS::DCPS::DomainParticipantImpl::get_id ( void  ) const
virtual

◆ get_instance_handle()

DDS::InstanceHandle_t OpenDDS::DCPS::DomainParticipantImpl::get_instance_handle ( )
virtual

Implements OpenDDS::DCPS::EntityImpl.

Definition at line 1837 of file DomainParticipantImpl.cpp.

References dp_id_, OpenDDS::DCPS::EntityImpl::get_entity_instance_handle(), and OpenDDS::DCPS::rchandle_from().

1838 {
1840 }
GUID_t dp_id_
This participant id given by discovery.
DDS::InstanceHandle_t get_entity_instance_handle(const GUID_t &id, const RcHandle< DomainParticipantImpl > &participant)
Definition: EntityImpl.cpp:142
RcHandle< T > rchandle_from(T *pointer)
Definition: RcHandle_T.h:310

◆ get_listener()

DDS::DomainParticipantListener_ptr OpenDDS::DCPS::DomainParticipantImpl::get_listener ( )
virtual

Implements DDS::DomainParticipant.

Definition at line 1219 of file DomainParticipantImpl.cpp.

References listener_, and listener_mutex_.

1220 {
1222  return DDS::DomainParticipantListener::_duplicate(listener_.in());
1223 }
DDS::DomainParticipantListener_var listener_
Used to notify the entity for relevant events.
ACE_Thread_Mutex listener_mutex_
Mutex to protect listener info.

◆ get_qos()

DDS::ReturnCode_t OpenDDS::DCPS::DomainParticipantImpl::get_qos ( DDS::DomainParticipantQos qos)
virtual

Definition at line 1199 of file DomainParticipantImpl.cpp.

References qos_, and DDS::RETCODE_OK.

1201 {
1202  qos = qos_;
1203  return DDS::RETCODE_OK;
1204 }
const ReturnCode_t RETCODE_OK
DDS::DomainParticipantQos qos_
The qos of this DomainParticipant.

◆ get_repoid()

GUID_t OpenDDS::DCPS::DomainParticipantImpl::get_repoid ( DDS::InstanceHandle_t  id) const

Obtain a GUID representing a local hande.

Returns
GUID_UNKNOWN if not found.

Definition at line 1934 of file DomainParticipantImpl.cpp.

References ACE_GUARD_RETURN, OpenDDS::DCPS::GUID_UNKNOWN, handle_protector_, and repoIds_.

Referenced by ignore_participant(), ignore_publication(), ignore_subscription(), ignore_topic(), OpenDDS::FaceTSS::populate_header_received(), and OpenDDS::DCPS::ReplayerImpl::write().

1935 {
1937  const RepoIdMap::const_iterator location = repoIds_.find(handle);
1938  return location == repoIds_.end() ? GUID_UNKNOWN : location->second;
1939 }
const GUID_t GUID_UNKNOWN
Nil value for GUID.
Definition: GuidUtils.h:59
#define ACE_GUARD_RETURN(MUTEX, OBJ, LOCK, RETURN)
RepoIdMap repoIds_
By-handle lookup of instance handles assigned to GUIDs (use handle_protector_)
ACE_Thread_Mutex handle_protector_
Protect the handle collection.

◆ get_security_config()

Security::SecurityConfig_rch OpenDDS::DCPS::DomainParticipantImpl::get_security_config ( ) const
inline

Definition at line 405 of file DomainParticipantImpl.h.

406  {
407  return security_config_;
408  }
Security::SecurityConfig_rch security_config_

◆ get_topic_ids()

void OpenDDS::DCPS::DomainParticipantImpl::get_topic_ids ( TopicIdVec &  topics)

Populates an std::vector with the GUID_t of the topics this participant has created/found.

Definition at line 2078 of file DomainParticipantImpl.cpp.

References ACE_GUARD, topics_, and topics_protector_.

Referenced by OpenDDS::DCPS::DPMonitorImpl::report().

2079 {
2081  guard,
2082  this->topics_protector_);
2083 
2084  topics.reserve(topics_.size());
2085  for (TopicMap::iterator it(topics_.begin());
2086  it != topics_.end(); ++it) {
2087  topics.push_back(it->second.pair_.svt_->get_id());
2088  }
2089 }
#define ACE_GUARD(MUTEX, OBJ, LOCK)
ACE_Recursive_Thread_Mutex topics_protector_
Protect the topic collection.
TopicMap topics_
Collection of topics.

◆ get_type_lookup_service()

XTypes::TypeLookupService_rch OpenDDS::DCPS::DomainParticipantImpl::get_type_lookup_service ( )
inline

◆ get_unique_id()

OPENDDS_STRING OpenDDS::DCPS::DomainParticipantImpl::get_unique_id ( void  )

Return a unique string based on repo ID.

Definition at line 1830 of file DomainParticipantImpl.cpp.

References dp_id_, and OpenDDS::DCPS::GuidConverter::uniqueParticipantId().

1831 {
1832  return GuidConverter(dp_id_).uniqueParticipantId();
1833 }
GUID_t dp_id_
This participant id given by discovery.

◆ handle_exception()

int OpenDDS::DCPS::DomainParticipantImpl::handle_exception ( ACE_HANDLE  fd)
privatevirtual

Reimplemented from ACE_Event_Handler.

Definition at line 2455 of file DomainParticipantImpl.cpp.

References ACE_GUARD_RETURN, ACE_Thread_Mutex::acquire(), automatic_liveliness_timer_, OpenDDS::DCPS::RecorderImpl::cleanup(), OpenDDS::DCPS::ReplayerImpl::cleanup(), delete_publisher(), delete_subscriber(), delete_topic_i(), OpenDDS::DCPS::ConditionVariable< Mutex >::notify_all(), participant_liveliness_timer_, publishers_, publishers_protector_, recorders_, recorders_protector_, ACE_Thread_Mutex::release(), replayers_, replayers_protector_, DDS::RETCODE_ERROR, DDS::RETCODE_OK, shutdown_complete_, shutdown_condition_, shutdown_mutex_, shutdown_result_, subscribers_, subscribers_protector_, TheServiceParticipant, topics_, and topics_protector_.

Referenced by delete_contained_entities().

2456 {
2457  ThreadStatusManager::Event ev(TheServiceParticipant->get_thread_status_manager());
2458 
2460 
2461  automatic_liveliness_timer_->cancel();
2463 
2464  // delete publishers
2465  {
2467  tao_mon,
2468  this->publishers_protector_,
2470 
2471  PublisherSet::iterator pubIter = publishers_.begin();
2472  DDS::Publisher_ptr pubPtr;
2473  size_t pubsize = publishers_.size();
2474 
2475  while (pubsize > 0) {
2476  pubPtr = (*pubIter).obj_.in();
2477  ++pubIter;
2478 
2479  DDS::ReturnCode_t result = pubPtr->delete_contained_entities();
2480  if (result != DDS::RETCODE_OK) {
2481  ret = result;
2482  }
2483 
2484  result = delete_publisher(pubPtr);
2485 
2486  if (result != DDS::RETCODE_OK) {
2487  ret = result;
2488  }
2489 
2490  --pubsize;
2491  }
2492 
2493  }
2494 
2495  // delete subscribers
2496  {
2498  tao_mon,
2499  this->subscribers_protector_,
2501 
2502  SubscriberSet::iterator subIter = subscribers_.begin();
2503  DDS::Subscriber_ptr subPtr;
2504  size_t subsize = subscribers_.size();
2505 
2506  while (subsize > 0) {
2507  subPtr = (*subIter).obj_.in();
2508  ++subIter;
2509 
2510  DDS::ReturnCode_t result = subPtr->delete_contained_entities();
2511 
2512  if (result != DDS::RETCODE_OK) {
2513  ret = result;
2514  }
2515 
2516  result = delete_subscriber(subPtr);
2517 
2518  if (result != DDS::RETCODE_OK) {
2519  ret = result;
2520  }
2521 
2522  --subsize;
2523  }
2524  }
2525 
2526  {
2528  tao_mon,
2529  this->recorders_protector_,
2531 
2532  RecorderSet::iterator it = recorders_.begin();
2533  for (; it != recorders_.end(); ++it ){
2534  RecorderImpl* impl = dynamic_cast<RecorderImpl* >(it->in());
2536  if (impl) result = impl->cleanup();
2537  if (result != DDS::RETCODE_OK) ret = result;
2538  }
2539  recorders_.clear();
2540  }
2541 
2542  {
2544  tao_mon,
2545  this->replayers_protector_,
2547 
2548  ReplayerSet::iterator it = replayers_.begin();
2549  for (; it != replayers_.end(); ++it ){
2550  ReplayerImpl* impl = static_cast<ReplayerImpl* >(it->in());
2552  if (impl) result = impl->cleanup();
2553  if (result != DDS::RETCODE_OK) ret = result;
2554 
2555  }
2556 
2557  replayers_.clear();
2558  }
2559 
2560  // delete topics
2561  {
2563  tao_mon,
2564  this->topics_protector_,
2566 
2567  TopicMap::iterator topicIter = topics_.begin();
2568  DDS::Topic_ptr topicPtr;
2569  size_t topicsize = topics_.size();
2570 
2571  while (topicsize > 0) {
2572  topicPtr = topicIter->second.pair_.obj_.in();
2573  ++topicIter;
2574 
2575  // Delete the topic the reference count.
2576  const DDS::ReturnCode_t result = this->delete_topic_i(topicPtr, true);
2577 
2578  if (result != DDS::RETCODE_OK) {
2579  ret = result;
2580  }
2581  --topicsize;
2582  }
2583  }
2584 
2586  shutdown_result_ = ret;
2587  shutdown_complete_ = true;
2590 
2591  return 0;
2592 }
RcHandle< AutomaticLivelinessTimer > automatic_liveliness_timer_
const ReturnCode_t RETCODE_OK
SubscriberSet subscribers_
Collection of subscribers.
int acquire(void)
ACE_Recursive_Thread_Mutex topics_protector_
Protect the topic collection.
bool notify_all()
Unblock all of the threads waiting on this condition.
int release(void)
ACE_Recursive_Thread_Mutex replayers_protector_
Protect the replayers collection.
RcHandle< ParticipantLivelinessTimer > participant_liveliness_timer_
PublisherSet publishers_
Collection of publishers.
#define ACE_GUARD_RETURN(MUTEX, OBJ, LOCK, RETURN)
const ReturnCode_t RETCODE_ERROR
virtual DDS::ReturnCode_t delete_publisher(DDS::Publisher_ptr p)
TopicMap topics_
Collection of topics.
ConditionVariable< ACE_Thread_Mutex > shutdown_condition_
ACE_Recursive_Thread_Mutex publishers_protector_
Protect the publisher collection.
ACE_Recursive_Thread_Mutex subscribers_protector_
Protect the subscriber collection.
ACE_Recursive_Thread_Mutex recorders_protector_
Protect the recorders collection.
virtual DDS::ReturnCode_t delete_subscriber(DDS::Subscriber_ptr s)
#define TheServiceParticipant
ACE_Thread_Mutex shutdown_mutex_
Protect the shutdown.
DDS::ReturnCode_t delete_topic_i(DDS::Topic_ptr a_topic, bool remove_objref)

◆ ignore_participant()

DDS::ReturnCode_t OpenDDS::DCPS::DomainParticipantImpl::ignore_participant ( DDS::InstanceHandle_t  handle)
virtual

Definition at line 1226 of file DomainParticipantImpl.cpp.

References ACE_DEBUG, ACE_ERROR, ACE_TEXT(), OpenDDS::DCPS::DCPS_debug_level, domain_id_, dp_id_, OpenDDS::DCPS::EntityImpl::enabled_, get_repoid(), ignored_participants_, LM_DEBUG, LM_ERROR, DDS::RETCODE_ERROR, DDS::RETCODE_NOT_ENABLED, DDS::RETCODE_OK, DDS::RETCODE_UNSUPPORTED, and TheServiceParticipant.

1228 {
1229 #ifndef DDS_HAS_MINIMUM_BIT
1230  if (!enabled_) {
1231  if (DCPS_debug_level > 0) {
1232  ACE_ERROR((LM_ERROR,
1233  ACE_TEXT("(%P|%t) ERROR: DomainParticipantImpl::ignore_participant, ")
1234  ACE_TEXT("Entity is not enabled.\n")));
1235  }
1236  return DDS::RETCODE_NOT_ENABLED;
1237  }
1238 
1239  GUID_t ignoreId = get_repoid(handle);
1240  HandleMap::const_iterator location = this->ignored_participants_.find(ignoreId);
1241 
1242  if (location == this->ignored_participants_.end()) {
1243  this->ignored_participants_[ ignoreId] = handle;
1244  }
1245  else {// ignore same participant again, just return ok.
1246  return DDS::RETCODE_OK;
1247  }
1248 
1249  if (DCPS_debug_level >= 4) {
1250  ACE_DEBUG((LM_DEBUG,
1251  ACE_TEXT("(%P|%t) DomainParticipantImpl::ignore_participant: ")
1252  ACE_TEXT("%C ignoring handle %x.\n"),
1253  LogGuid(dp_id_).c_str(),
1254  handle));
1255  }
1256 
1257  Discovery_rch disco = TheServiceParticipant->get_discovery(domain_id_);
1258  if (!disco->ignore_domain_participant(domain_id_,
1259  dp_id_,
1260  ignoreId)) {
1261  if (DCPS_debug_level > 0) {
1262  ACE_ERROR((LM_ERROR,
1263  ACE_TEXT("(%P|%t) ERROR: DomainParticipantImpl::ignore_participant, ")
1264  ACE_TEXT("Could not ignore domain participant.\n")));
1265  }
1266  return DDS::RETCODE_ERROR;
1267  }
1268 
1269 
1270  if (DCPS_debug_level >= 4) {
1271  ACE_DEBUG((LM_DEBUG,
1272  ACE_TEXT("(%P|%t) DomainParticipantImpl::ignore_participant: ")
1273  ACE_TEXT("%C repo call returned.\n"),
1274  LogGuid(dp_id_).c_str()));
1275  }
1276 
1277  return DDS::RETCODE_OK;
1278 #else
1279  ACE_UNUSED_ARG(handle);
1280  return DDS::RETCODE_UNSUPPORTED;
1281 #endif // !defined (DDS_HAS_MINIMUM_BIT)
1282 }
GUID_t dp_id_
This participant id given by discovery.
#define ACE_DEBUG(X)
#define ACE_ERROR(X)
GUID_t get_repoid(DDS::InstanceHandle_t id) const
RcHandle< Discovery > Discovery_rch
Definition: Discovery.h:296
const ReturnCode_t RETCODE_OK
HandleMap ignored_participants_
Collection of ignored participants.
const DDS::DomainId_t domain_id_
The id of the domain that creates this participant.
const ReturnCode_t RETCODE_ERROR
OpenDDS_Dcps_Export unsigned int DCPS_debug_level
Definition: debug.cpp:30
ACE_TEXT("TCP_Factory")
const ReturnCode_t RETCODE_UNSUPPORTED
#define TheServiceParticipant
AtomicBool enabled_
The flag indicates the entity is enabled.
Definition: EntityImpl.h:82
const ReturnCode_t RETCODE_NOT_ENABLED

◆ ignore_publication()

DDS::ReturnCode_t OpenDDS::DCPS::DomainParticipantImpl::ignore_publication ( DDS::InstanceHandle_t  handle)
virtual

Definition at line 1335 of file DomainParticipantImpl.cpp.

References ACE_DEBUG, ACE_ERROR, ACE_TEXT(), OpenDDS::DCPS::DCPS_debug_level, domain_id_, dp_id_, OpenDDS::DCPS::EntityImpl::enabled_, get_repoid(), LM_DEBUG, LM_ERROR, DDS::RETCODE_ERROR, DDS::RETCODE_NOT_ENABLED, DDS::RETCODE_OK, DDS::RETCODE_UNSUPPORTED, and TheServiceParticipant.

1337 {
1338 #ifndef DDS_HAS_MINIMUM_BIT
1339  if (!enabled_) {
1340  if (DCPS_debug_level > 0) {
1341  ACE_ERROR((LM_ERROR,
1342  ACE_TEXT("(%P|%t) ERROR: DomainParticipantImpl::ignore_publication, ")
1343  ACE_TEXT(" Entity is not enabled.\n")));
1344  }
1345  return DDS::RETCODE_NOT_ENABLED;
1346  }
1347 
1348  if (DCPS_debug_level >= 4) {
1349  ACE_DEBUG((LM_DEBUG,
1350  ACE_TEXT("(%P|%t) DomainParticipantImpl::ignore_publication: ")
1351  ACE_TEXT("%C ignoring handle %x.\n"),
1352  LogGuid(dp_id_).c_str(),
1353  handle));
1354  }
1355 
1356  GUID_t ignoreId = get_repoid(handle);
1357  Discovery_rch disco = TheServiceParticipant->get_discovery(domain_id_);
1358  if (!disco->ignore_publication(domain_id_,
1359  dp_id_,
1360  ignoreId)) {
1361  if (DCPS_debug_level > 0) {
1362  ACE_ERROR((LM_ERROR,
1363  ACE_TEXT("(%P|%t) ERROR: DomainParticipantImpl::ignore_publication, ")
1364  ACE_TEXT(" could not ignore publication in discovery.\n")));
1365  }
1366  return DDS::RETCODE_ERROR;
1367  }
1368 
1369  return DDS::RETCODE_OK;
1370 #else
1371  ACE_UNUSED_ARG(handle);
1372  return DDS::RETCODE_UNSUPPORTED;
1373 #endif // !defined (DDS_HAS_MINIMUM_BIT)
1374 }
GUID_t dp_id_
This participant id given by discovery.
#define ACE_DEBUG(X)
#define ACE_ERROR(X)
GUID_t get_repoid(DDS::InstanceHandle_t id) const
RcHandle< Discovery > Discovery_rch
Definition: Discovery.h:296
const ReturnCode_t RETCODE_OK
const DDS::DomainId_t domain_id_
The id of the domain that creates this participant.
const ReturnCode_t RETCODE_ERROR
OpenDDS_Dcps_Export unsigned int DCPS_debug_level
Definition: debug.cpp:30
ACE_TEXT("TCP_Factory")
const ReturnCode_t RETCODE_UNSUPPORTED
#define TheServiceParticipant
AtomicBool enabled_
The flag indicates the entity is enabled.
Definition: EntityImpl.h:82
const ReturnCode_t RETCODE_NOT_ENABLED

◆ ignore_subscription()

DDS::ReturnCode_t OpenDDS::DCPS::DomainParticipantImpl::ignore_subscription ( DDS::InstanceHandle_t  handle)
virtual

Definition at line 1377 of file DomainParticipantImpl.cpp.

References ACE_DEBUG, ACE_ERROR, ACE_TEXT(), OpenDDS::DCPS::DCPS_debug_level, domain_id_, dp_id_, OpenDDS::DCPS::EntityImpl::enabled_, get_repoid(), LM_DEBUG, LM_ERROR, DDS::RETCODE_ERROR, DDS::RETCODE_NOT_ENABLED, DDS::RETCODE_OK, DDS::RETCODE_UNSUPPORTED, and TheServiceParticipant.

1379 {
1380 #ifndef DDS_HAS_MINIMUM_BIT
1381  if (!enabled_) {
1382  if (DCPS_debug_level > 0) {
1383  ACE_ERROR((LM_ERROR,
1384  ACE_TEXT("(%P|%t) ERROR: DomainParticipantImpl::ignore_subscription, ")
1385  ACE_TEXT(" Entity is not enabled.\n")));
1386  }
1387  return DDS::RETCODE_NOT_ENABLED;
1388  }
1389 
1390  if (DCPS_debug_level >= 4) {
1391  ACE_DEBUG((LM_DEBUG,
1392  ACE_TEXT("(%P|%t) DomainParticipantImpl::ignore_subscription: ")
1393  ACE_TEXT("%C ignoring handle %d.\n"),
1394  LogGuid(dp_id_).c_str(),
1395  handle));
1396  }
1397 
1398  GUID_t ignoreId = get_repoid(handle);
1399  Discovery_rch disco = TheServiceParticipant->get_discovery(domain_id_);
1400  if (!disco->ignore_subscription(domain_id_,
1401  dp_id_,
1402  ignoreId)) {
1403  if (DCPS_debug_level > 0) {
1404  ACE_ERROR((LM_ERROR,
1405  ACE_TEXT("(%P|%t) ERROR: DomainParticipantImpl::ignore_subscription, ")
1406  ACE_TEXT(" could not ignore subscription in discovery.\n")));
1407  }
1408  return DDS::RETCODE_ERROR;
1409  }
1410 
1411  return DDS::RETCODE_OK;
1412 #else
1413  ACE_UNUSED_ARG(handle);
1414  return DDS::RETCODE_UNSUPPORTED;
1415 #endif // !defined (DDS_HAS_MINIMUM_BIT)
1416 }
GUID_t dp_id_
This participant id given by discovery.
#define ACE_DEBUG(X)
#define ACE_ERROR(X)
GUID_t get_repoid(DDS::InstanceHandle_t id) const
RcHandle< Discovery > Discovery_rch
Definition: Discovery.h:296
const ReturnCode_t RETCODE_OK
const DDS::DomainId_t domain_id_
The id of the domain that creates this participant.
const ReturnCode_t RETCODE_ERROR
OpenDDS_Dcps_Export unsigned int DCPS_debug_level
Definition: debug.cpp:30
ACE_TEXT("TCP_Factory")
const ReturnCode_t RETCODE_UNSUPPORTED
#define TheServiceParticipant
AtomicBool enabled_
The flag indicates the entity is enabled.
Definition: EntityImpl.h:82
const ReturnCode_t RETCODE_NOT_ENABLED

◆ ignore_topic()

DDS::ReturnCode_t OpenDDS::DCPS::DomainParticipantImpl::ignore_topic ( DDS::InstanceHandle_t  handle)
virtual

Definition at line 1285 of file DomainParticipantImpl.cpp.

References ACE_DEBUG, ACE_ERROR, ACE_TEXT(), OpenDDS::DCPS::DCPS_debug_level, domain_id_, dp_id_, OpenDDS::DCPS::EntityImpl::enabled_, get_repoid(), ignored_topics_, LM_DEBUG, LM_ERROR, DDS::RETCODE_NOT_ENABLED, DDS::RETCODE_OK, DDS::RETCODE_UNSUPPORTED, and TheServiceParticipant.

1287 {
1288 #ifndef DDS_HAS_MINIMUM_BIT
1289  if (!enabled_) {
1290  if (DCPS_debug_level > 0) {
1291  ACE_ERROR((LM_ERROR,
1292  ACE_TEXT("(%P|%t) ERROR: DomainParticipantImpl::ignore_topic, ")
1293  ACE_TEXT(" Entity is not enabled.\n")));
1294  }
1295  return DDS::RETCODE_NOT_ENABLED;
1296  }
1297 
1298  GUID_t ignoreId = get_repoid(handle);
1299  HandleMap::const_iterator location = this->ignored_topics_.find(ignoreId);
1300 
1301  if (location == this->ignored_topics_.end()) {
1302  this->ignored_topics_[ ignoreId] = handle;
1303  }
1304  else { // ignore same topic again, just return ok.
1305  return DDS::RETCODE_OK;
1306  }
1307 
1308  if (DCPS_debug_level >= 4) {
1309  ACE_DEBUG((LM_DEBUG,
1310  ACE_TEXT("(%P|%t) DomainParticipantImpl::ignore_topic: ")
1311  ACE_TEXT("%C ignoring handle %x.\n"),
1312  LogGuid(dp_id_).c_str(),
1313  handle));
1314  }
1315 
1316  Discovery_rch disco = TheServiceParticipant->get_discovery(domain_id_);
1317  if (!disco->ignore_topic(domain_id_,
1318  dp_id_,
1319  ignoreId)) {
1320  if (DCPS_debug_level > 0) {
1321  ACE_ERROR((LM_ERROR,
1322  ACE_TEXT("(%P|%t) ERROR: DomainParticipantImpl::ignore_topic, ")
1323  ACE_TEXT(" Could not ignore topic.\n")));
1324  }
1325  }
1326 
1327  return DDS::RETCODE_OK;
1328 #else
1329  ACE_UNUSED_ARG(handle);
1330  return DDS::RETCODE_UNSUPPORTED;
1331 #endif // !defined (DDS_HAS_MINIMUM_BIT)
1332 }
GUID_t dp_id_
This participant id given by discovery.
#define ACE_DEBUG(X)
#define ACE_ERROR(X)
GUID_t get_repoid(DDS::InstanceHandle_t id) const
RcHandle< Discovery > Discovery_rch
Definition: Discovery.h:296
const ReturnCode_t RETCODE_OK
const DDS::DomainId_t domain_id_
The id of the domain that creates this participant.
HandleMap ignored_topics_
Collection of ignored topics.
OpenDDS_Dcps_Export unsigned int DCPS_debug_level
Definition: debug.cpp:30
ACE_TEXT("TCP_Factory")
const ReturnCode_t RETCODE_UNSUPPORTED
#define TheServiceParticipant
AtomicBool enabled_
The flag indicates the entity is enabled.
Definition: EntityImpl.h:82
const ReturnCode_t RETCODE_NOT_ENABLED

◆ is_clean()

bool OpenDDS::DCPS::DomainParticipantImpl::is_clean ( String leftover_entities = 0) const

Check to see if the Participant has any entities left in it. leftover_entities will be set with a description of what is left.

Definition at line 2026 of file DomainParticipantImpl.cpp.

References publishers_, subscribers_, TheTransientKludge, OpenDDS::DCPS::to_dds_string(), OpenDDS::DCPS::topicIsBIT(), and topics_.

Referenced by OpenDDS::DCPS::DomainParticipantFactoryImpl::delete_participant().

2027 {
2028  if (leftover_entities) {
2029  leftover_entities->clear();
2030  }
2031 
2032  // check that the only remaining topics are built-in topics
2033  size_t topic_count = 0;
2034  for (TopicMap::const_iterator it = topics_.begin(); it != topics_.end(); ++it) {
2035  if (!topicIsBIT(it->second.pair_.svt_->topic_name(), it->second.pair_.svt_->type_name())) {
2036  ++topic_count;
2037  }
2038  }
2039  if (topic_count) {
2040  *leftover_entities += to_dds_string(topic_count) + " topic(s)";
2041  }
2042 
2043  size_t sub_count = subscribers_.size();
2044  if (!TheTransientKludge->is_enabled()) {
2045  // There are built-in topics and built-in topic subscribers left.
2046  sub_count = sub_count <= 1 ? 0 : sub_count;
2047  }
2048  if (leftover_entities && sub_count) {
2049  if (leftover_entities->size()) {
2050  *leftover_entities += ", ";
2051  }
2052  *leftover_entities += to_dds_string(sub_count) + " subscriber(s)";
2053  }
2054 
2055  const size_t pub_count = publishers_.size();
2056  if (leftover_entities && pub_count) {
2057  if (leftover_entities->size()) {
2058  *leftover_entities += ", ";
2059  }
2060  *leftover_entities += to_dds_string(pub_count) + " publisher(s)";
2061  }
2062 
2063  return topic_count == 0 && sub_count == 0 && pub_count == 0;
2064 }
SubscriberSet subscribers_
Collection of subscribers.
PublisherSet publishers_
Collection of publishers.
#define TheTransientKludge
bool topicIsBIT(const char *name, const char *type)
TopicMap topics_
Collection of topics.
String to_dds_string(unsigned short to_convert)

◆ listener_for()

DDS::DomainParticipantListener_ptr OpenDDS::DCPS::DomainParticipantImpl::listener_for ( DDS::StatusKind  kind)

This is used to retrieve the listener for a certain status change. If this DomainParticipant has a registered listener and the status kind is in the listener mask then the listener is returned. Otherwise, return nil.

Definition at line 2067 of file DomainParticipantImpl.cpp.

References CORBA::is_nil(), listener_, listener_mask_, and listener_mutex_.

Referenced by OpenDDS::DCPS::TopicImpl::inconsistent_topic().

2068 {
2070  if (CORBA::is_nil(listener_.in()) || (listener_mask_ & kind) == 0) {
2071  return DDS::DomainParticipantListener::_nil ();
2072  } else {
2073  return DDS::DomainParticipantListener::_duplicate(listener_.in());
2074  }
2075 }
DDS::DomainParticipantListener_var listener_
Used to notify the entity for relevant events.
Boolean is_nil(T x)
ACE_Thread_Mutex listener_mutex_
Mutex to protect listener info.

◆ liveliness_check_interval()

TimeDuration OpenDDS::DCPS::DomainParticipantImpl::liveliness_check_interval ( DDS::LivelinessQosPolicyKind  kind)
private

Definition at line 2413 of file DomainParticipantImpl.cpp.

References ACE_GUARD_RETURN, OpenDDS::DCPS::TimeDuration::max_value, publishers_, and publishers_protector_.

Referenced by OpenDDS::DCPS::DomainParticipantImpl::LivelinessTimer::execute().

2414 {
2415  TimeDuration tv(TimeDuration::max_value);
2416 
2418  tao_mon,
2420  tv);
2421 
2422  for (PublisherSet::iterator it = publishers_.begin(); it != publishers_.end(); ++it) {
2423  tv = std::min(tv, it->svt_->liveliness_check_interval(kind));
2424  }
2425 
2426  return tv;
2427 }
static const TimeDuration max_value
Definition: TimeDuration.h:32
PublisherSet publishers_
Collection of publishers.
#define ACE_GUARD_RETURN(MUTEX, OBJ, LOCK, RETURN)
ACE_Recursive_Thread_Mutex publishers_protector_
Protect the publisher collection.

◆ lookup_handle()

DDS::InstanceHandle_t OpenDDS::DCPS::DomainParticipantImpl::lookup_handle ( const GUID_t id) const

Get a handle that was previously mapped to a GUID or HANDLE_NIL if none exists.

Handles returned from this method should not be passed to return_handle.

Definition at line 1895 of file DomainParticipantImpl.cpp.

References ACE_GUARD_RETURN, DDS::HANDLE_NIL, handle_protector_, and handles_.

Referenced by OpenDDS::DCPS::RecorderImpl::lookup_instance_handles(), OpenDDS::DCPS::ReplayerImpl::lookup_instance_handles(), and OpenDDS::DCPS::RecorderImpl::repoid_to_bit_key().

1896 {
1898  const CountedHandleMap::const_iterator iter = handles_.find(id);
1899  return iter == handles_.end() ? DDS::HANDLE_NIL : iter->second.first;
1900 }
const InstanceHandle_t HANDLE_NIL
#define ACE_GUARD_RETURN(MUTEX, OBJ, LOCK, RETURN)
CountedHandleMap handles_
Instance handles assigned which are mapped to GUIDs (use handle_protector_)
ACE_Thread_Mutex handle_protector_
Protect the handle collection.

◆ lookup_topicdescription()

DDS::TopicDescription_ptr OpenDDS::DCPS::DomainParticipantImpl::lookup_topicdescription ( const char *  name)
virtual

Definition at line 787 of file DomainParticipantImpl.cpp.

References ACE_GUARD_RETURN, Util::find(), topic_descrs_, topics_, and topics_protector_.

Referenced by OpenDDS::DCPS::InfoRepoDiscovery::init_bit(), OpenDDS::RTPS::RtpsDiscovery::init_bit(), and OpenDDS::DCPS::StaticDiscovery::init_bit().

788 {
790  tao_mon,
791  this->topics_protector_,
792  DDS::Topic::_nil());
793 
794  TopicMap::mapped_type* entry = 0;
795 
796  if (Util::find(topics_, name, entry) == -1) {
797 #if !defined(OPENDDS_NO_CONTENT_FILTERED_TOPIC) || !defined(OPENDDS_NO_MULTI_TOPIC)
798  TopicDescriptionMap::iterator iter = topic_descrs_.find(name);
799  if (iter != topic_descrs_.end()) {
800  return DDS::TopicDescription::_duplicate(iter->second);
801  }
802 #endif
803  return DDS::TopicDescription::_nil();
804 
805  } else {
806  return DDS::TopicDescription::_duplicate(entry->pair_.obj_.in());
807  }
808 }
TopicDescriptionMap topic_descrs_
Collection of TopicDescriptions which are not also Topics.
int find(OpenDDS::DCPS::DomainParticipantImpl::TopicMap &c, const Key &key, OpenDDS::DCPS::DomainParticipantImpl::TopicMap::mapped_type *&value)
ACE_Recursive_Thread_Mutex topics_protector_
Protect the topic collection.
#define ACE_GUARD_RETURN(MUTEX, OBJ, LOCK, RETURN)
const char *const name
Definition: debug.cpp:60
TopicMap topics_
Collection of topics.

◆ OPENDDS_MAP() [1/3]

typedef OpenDDS::DCPS::DomainParticipantImpl::OPENDDS_MAP ( OPENDDS_STRING  ,
DDS::TopicDescription_var   
)

◆ OPENDDS_MAP() [2/3]

typedef OpenDDS::DCPS::DomainParticipantImpl::OPENDDS_MAP ( DDS::InstanceHandle_t  ,
GUID_t   
)
private

◆ OPENDDS_MAP() [3/3]

OpenDDS::DCPS::DomainParticipantImpl::OPENDDS_MAP ( OPENDDS_STRING  ,
RcHandle< FilterEvaluator  
)
private

◆ OPENDDS_MAP_CMP() [1/2]

typedef OpenDDS::DCPS::DomainParticipantImpl::OPENDDS_MAP_CMP ( GUID_t  ,
HandleWithCounter  ,
GUID_tKeyLessThan   
)
private

◆ OPENDDS_MAP_CMP() [2/2]

typedef OpenDDS::DCPS::DomainParticipantImpl::OPENDDS_MAP_CMP ( GUID_t  ,
DDS::InstanceHandle_t  ,
GUID_tKeyLessThan   
)
private

◆ OPENDDS_MULTIMAP()

typedef OpenDDS::DCPS::DomainParticipantImpl::OPENDDS_MULTIMAP ( OPENDDS_STRING  ,
RefCounted_Topic   
)

◆ OPENDDS_SET() [1/2]

typedef OpenDDS::DCPS::DomainParticipantImpl::OPENDDS_SET ( Subscriber_Pair  )

◆ OPENDDS_SET() [2/2]

typedef OpenDDS::DCPS::DomainParticipantImpl::OPENDDS_SET ( Publisher_Pair  )

◆ OPENDDS_SET_CMP() [1/2]

typedef OpenDDS::DCPS::DomainParticipantImpl::OPENDDS_SET_CMP ( Recorder_var  ,
VarLess< Recorder  
)
private

◆ OPENDDS_SET_CMP() [2/2]

typedef OpenDDS::DCPS::DomainParticipantImpl::OPENDDS_SET_CMP ( Replayer_var  ,
VarLess< Replayer  
)
private

◆ OPENDDS_VECTOR()

typedef OpenDDS::DCPS::DomainParticipantImpl::OPENDDS_VECTOR ( GUID_t  )

◆ ownership_manager()

OwnershipManager * OpenDDS::DCPS::DomainParticipantImpl::ownership_manager ( )

Accessor for ownership manager.

Definition at line 2094 of file DomainParticipantImpl.cpp.

References ACE_ERROR, bit_subscriber_, LM_WARNING, OpenDDS::DCPS::log_level, owner_man_, and OpenDDS::DCPS::LogLevel::Warning.

Referenced by OpenDDS::DCPS::RecorderImpl::init().

2095 {
2096 #if !defined (DDS_HAS_MINIMUM_BIT)
2097  if (bit_subscriber_) {
2098  bit_subscriber_->bit_pub_listener_hack(this);
2099  } else {
2100  if (log_level >= LogLevel::Warning) {
2101  ACE_ERROR((LM_WARNING,
2102  "(%P|%t) WARNING: DomainParticipantImpl::ownership_manager: bit_subscriber_ is null"));
2103  }
2104  }
2105 #endif
2106  return &owner_man_;
2107 }
OpenDDS_Dcps_Export LogLevel log_level
#define ACE_ERROR(X)
RcHandle< BitSubscriber > bit_subscriber_
The built in topic subscriber.

◆ participant_liveliness_activity_after()

bool OpenDDS::DCPS::DomainParticipantImpl::participant_liveliness_activity_after ( const MonotonicTimePoint tv)
private

Definition at line 2430 of file DomainParticipantImpl.cpp.

References ACE_GUARD_RETURN, OpenDDS::DCPS::TimePoint_T< AceClock >::is_zero(), last_liveliness_activity_, publishers_, and publishers_protector_.

Referenced by OpenDDS::DCPS::DomainParticipantImpl::ParticipantLivelinessTimer::dispatch().

2431 {
2432  if (last_liveliness_activity_ > tv) {
2433  return true;
2434  }
2435 
2436  ACE_GUARD_RETURN(ACE_Recursive_Thread_Mutex, tao_mon, this->publishers_protector_, !tv.is_zero());
2437 
2438  for (PublisherSet::iterator it(publishers_.begin());
2439  it != publishers_.end(); ++it) {
2440  if (it->svt_->participant_liveliness_activity_after(tv)) {
2441  return true;
2442  }
2443  }
2444 
2445  return false;
2446 }
PublisherSet publishers_
Collection of publishers.
#define ACE_GUARD_RETURN(MUTEX, OBJ, LOCK, RETURN)
ACE_Recursive_Thread_Mutex publishers_protector_
Protect the publisher collection.

◆ permissions_handle()

DDS::Security::PermissionsHandle OpenDDS::DCPS::DomainParticipantImpl::permissions_handle ( ) const
inline

Definition at line 409 of file DomainParticipantImpl.h.

410  {
411  return perm_handle_;
412  }
DDS::Security::PermissionsHandle perm_handle_
This participant permissions handle given by access constrol.

◆ prepare_to_delete_datawriters()

bool OpenDDS::DCPS::DomainParticipantImpl::prepare_to_delete_datawriters ( )

Definition at line 2594 of file DomainParticipantImpl.cpp.

References ACE_GUARD_RETURN, publishers_, and publishers_protector_.

Referenced by delete_contained_entities().

2595 {
2597  bool result = true;
2598  const PublisherSet::iterator end = publishers_.end();
2599  for (PublisherSet::iterator i = publishers_.begin(); i != end; ++i) {
2600  result &= i->svt_->prepare_to_delete_datawriters();
2601  }
2602  return result;
2603 }
PublisherSet publishers_
Collection of publishers.
#define ACE_GUARD_RETURN(MUTEX, OBJ, LOCK, RETURN)
ACE_Recursive_Thread_Mutex publishers_protector_
Protect the publisher collection.

◆ remove_adjust_liveliness_timers()

void OpenDDS::DCPS::DomainParticipantImpl::remove_adjust_liveliness_timers ( )

Definition at line 2314 of file DomainParticipantImpl.cpp.

References automatic_liveliness_timer_, and participant_liveliness_timer_.

2315 {
2316  automatic_liveliness_timer_->remove_adjust();
2317  participant_liveliness_timer_->remove_adjust();
2318 }
RcHandle< AutomaticLivelinessTimer > automatic_liveliness_timer_
RcHandle< ParticipantLivelinessTimer > participant_liveliness_timer_

◆ return_handle()

void OpenDDS::DCPS::DomainParticipantImpl::return_handle ( DDS::InstanceHandle_t  handle)

Return a previously-assigned handle.

Definition at line 1902 of file DomainParticipantImpl.cpp.

References ACE_DEBUG, ACE_GUARD, OpenDDS::DCPS::DisjointSequence::OrderedRanges< T >::add(), OpenDDS::DCPS::DCPS_debug_level, handle_protector_, handles_, LM_DEBUG, repoIds_, and reusable_handles_.

Referenced by OpenDDS::DCPS::ReplayerImpl::remove_associations(), and OpenDDS::DCPS::RecorderImpl::remove_associations_i().

1903 {
1905  const RepoIdMap::iterator r_iter = repoIds_.find(handle);
1906  if (r_iter == repoIds_.end()) {
1907  reusable_handles_.add(handle);
1908  if (DCPS_debug_level > 5) {
1909  ACE_DEBUG((LM_DEBUG, "(%P|%t) DomainParticipantImpl::return_handle: "
1910  "Returned unmapped InstanceHandle %d\n", handle));
1911  }
1912  return;
1913  }
1914 
1915  const CountedHandleMap::iterator h_iter = handles_.find(r_iter->second);
1916  if (h_iter == handles_.end()) {
1917  return;
1918  }
1919 
1920  if (DCPS_debug_level > 5) {
1921  ACE_DEBUG((LM_DEBUG, "(%P|%t) DomainParticipantImpl::return_handle: "
1922  "Returned mapped InstanceHandle %d refcount %d\n",
1923  handle, h_iter->second.second));
1924  }
1925 
1926  HandleWithCounter& mapped = h_iter->second;
1927  if (--mapped.second == 0) {
1928  handles_.erase(h_iter);
1929  repoIds_.erase(r_iter);
1930  reusable_handles_.add(handle);
1931  }
1932 }
#define ACE_DEBUG(X)
#define ACE_GUARD(MUTEX, OBJ, LOCK)
std::pair< DDS::InstanceHandle_t, unsigned int > HandleWithCounter
DisjointSequence::OrderedRanges< DDS::InstanceHandle_t > reusable_handles_
Keep track of handles that can be reused (use handle_protector_)
OpenDDS_Dcps_Export unsigned int DCPS_debug_level
Definition: debug.cpp:30
RepoIdMap repoIds_
By-handle lookup of instance handles assigned to GUIDs (use handle_protector_)
CountedHandleMap handles_
Instance handles assigned which are mapped to GUIDs (use handle_protector_)
ACE_Thread_Mutex handle_protector_
Protect the handle collection.

◆ set_default_publisher_qos()

DDS::ReturnCode_t OpenDDS::DCPS::DomainParticipantImpl::set_default_publisher_qos ( const DDS::PublisherQos qos)
virtual

Definition at line 1451 of file DomainParticipantImpl.cpp.

References OpenDDS::DCPS::Qos_Helper::consistent(), default_publisher_qos_, DDS::RETCODE_INCONSISTENT_POLICY, DDS::RETCODE_OK, and OpenDDS::DCPS::Qos_Helper::valid().

1453 {
1454  if (Qos_Helper::valid(qos) && Qos_Helper::consistent(qos)) {
1455  default_publisher_qos_ = qos;
1456  return DDS::RETCODE_OK;
1457 
1458  } else {
1460  }
1461 }
const ReturnCode_t RETCODE_OK
static bool consistent(const DDS::ResourceLimitsQosPolicy &resource_limits, const DDS::HistoryQosPolicy &history)
Definition: Qos_Helper.inl:596
const ReturnCode_t RETCODE_INCONSISTENT_POLICY
static bool valid(const DDS::UserDataQosPolicy &qos)
Definition: Qos_Helper.inl:723
DDS::PublisherQos default_publisher_qos_
The default publisher qos.

◆ set_default_subscriber_qos()

DDS::ReturnCode_t OpenDDS::DCPS::DomainParticipantImpl::set_default_subscriber_qos ( const DDS::SubscriberQos qos)
virtual

Definition at line 1472 of file DomainParticipantImpl.cpp.

References OpenDDS::DCPS::Qos_Helper::consistent(), default_subscriber_qos_, DDS::RETCODE_INCONSISTENT_POLICY, DDS::RETCODE_OK, and OpenDDS::DCPS::Qos_Helper::valid().

1474 {
1475  if (Qos_Helper::valid(qos) && Qos_Helper::consistent(qos)) {
1477  return DDS::RETCODE_OK;
1478 
1479  } else {
1481  }
1482 }
const ReturnCode_t RETCODE_OK
static bool consistent(const DDS::ResourceLimitsQosPolicy &resource_limits, const DDS::HistoryQosPolicy &history)
Definition: Qos_Helper.inl:596
const ReturnCode_t RETCODE_INCONSISTENT_POLICY
static bool valid(const DDS::UserDataQosPolicy &qos)
Definition: Qos_Helper.inl:723
DDS::SubscriberQos default_subscriber_qos_
The default subscriber qos.

◆ set_default_topic_qos()

DDS::ReturnCode_t OpenDDS::DCPS::DomainParticipantImpl::set_default_topic_qos ( const DDS::TopicQos qos)
virtual

Definition at line 1493 of file DomainParticipantImpl.cpp.

References OpenDDS::DCPS::Qos_Helper::consistent(), default_topic_qos_, DDS::RETCODE_INCONSISTENT_POLICY, DDS::RETCODE_OK, and OpenDDS::DCPS::Qos_Helper::valid().

1495 {
1496  if (Qos_Helper::valid(qos) && Qos_Helper::consistent(qos)) {
1497  default_topic_qos_ = qos;
1498  return DDS::RETCODE_OK;
1499 
1500  } else {
1502  }
1503 }
const ReturnCode_t RETCODE_OK
static bool consistent(const DDS::ResourceLimitsQosPolicy &resource_limits, const DDS::HistoryQosPolicy &history)
Definition: Qos_Helper.inl:596
DDS::TopicQos default_topic_qos_
The default topic qos.
const ReturnCode_t RETCODE_INCONSISTENT_POLICY
static bool valid(const DDS::UserDataQosPolicy &qos)
Definition: Qos_Helper.inl:723

◆ set_listener()

DDS::ReturnCode_t OpenDDS::DCPS::DomainParticipantImpl::set_listener ( DDS::DomainParticipantListener_ptr  a_listener,
DDS::StatusMask  mask 
)
virtual

Definition at line 1207 of file DomainParticipantImpl.cpp.

References listener_, listener_mask_, listener_mutex_, and DDS::RETCODE_OK.

Referenced by DomainParticipantImpl().

1210 {
1212  listener_mask_ = mask;
1213  //note: OK to duplicate a nil object ref
1214  listener_ = DDS::DomainParticipantListener::_duplicate(a_listener);
1215  return DDS::RETCODE_OK;
1216 }
const ReturnCode_t RETCODE_OK
DDS::DomainParticipantListener_var listener_
Used to notify the entity for relevant events.
ACE_Thread_Mutex listener_mutex_
Mutex to protect listener info.

◆ set_qos()

DDS::ReturnCode_t OpenDDS::DCPS::DomainParticipantImpl::set_qos ( const DDS::DomainParticipantQos qos)
virtual

Definition at line 1161 of file DomainParticipantImpl.cpp.

References ACE_ERROR, ACE_TEXT(), OpenDDS::DCPS::Qos_Helper::changeable(), OpenDDS::DCPS::Qos_Helper::consistent(), OpenDDS::DCPS::DCPS_debug_level, domain_id_, dp_id_, OpenDDS::DCPS::EntityImpl::enabled_, LM_ERROR, qos_, DDS::RETCODE_ERROR, DDS::RETCODE_IMMUTABLE_POLICY, DDS::RETCODE_INCONSISTENT_POLICY, DDS::RETCODE_OK, TheServiceParticipant, and OpenDDS::DCPS::Qos_Helper::valid().

1163 {
1164  if (Qos_Helper::valid(qos) && Qos_Helper::consistent(qos)) {
1165  if (qos_ == qos)
1166  return DDS::RETCODE_OK;
1167 
1168  // for the not changeable qos, it can be changed before enable
1169  if (!Qos_Helper::changeable(qos_, qos) && enabled_) {
1171 
1172  } else {
1173  qos_ = qos;
1174 
1175  Discovery_rch disco = TheServiceParticipant->get_discovery(domain_id_);
1176  const bool status =
1177  disco->update_domain_participant_qos(domain_id_,
1178  dp_id_,
1179  qos_);
1180 
1181  if (!status) {
1182  if (DCPS_debug_level > 0) {
1183  ACE_ERROR((LM_ERROR,
1184  ACE_TEXT("(%P|%t) DomainParticipantImpl::set_qos, ")
1185  ACE_TEXT("failed on compatibility check.\n")));
1186  }
1187  return DDS::RETCODE_ERROR;
1188  }
1189  }
1190 
1191  return DDS::RETCODE_OK;
1192 
1193  } else {
1195  }
1196 }
GUID_t dp_id_
This participant id given by discovery.
#define ACE_ERROR(X)
RcHandle< Discovery > Discovery_rch
Definition: Discovery.h:296
const ReturnCode_t RETCODE_OK
static bool consistent(const DDS::ResourceLimitsQosPolicy &resource_limits, const DDS::HistoryQosPolicy &history)
Definition: Qos_Helper.inl:596
const DDS::DomainId_t domain_id_
The id of the domain that creates this participant.
const ReturnCode_t RETCODE_INCONSISTENT_POLICY
const ReturnCode_t RETCODE_ERROR
static bool valid(const DDS::UserDataQosPolicy &qos)
Definition: Qos_Helper.inl:723
const ReturnCode_t RETCODE_IMMUTABLE_POLICY
OpenDDS_Dcps_Export unsigned int DCPS_debug_level
Definition: debug.cpp:30
ACE_TEXT("TCP_Factory")
static bool changeable(const DDS::UserDataQosPolicy &qos1, const DDS::UserDataQosPolicy &qos2)
Definition: Qos_Helper.inl:948
#define TheServiceParticipant
AtomicBool enabled_
The flag indicates the entity is enabled.
Definition: EntityImpl.h:82
DDS::DomainParticipantQos qos_
The qos of this DomainParticipant.

◆ set_wait_pending_deadline()

bool OpenDDS::DCPS::DomainParticipantImpl::set_wait_pending_deadline ( const MonotonicTimePoint deadline)

Definition at line 2605 of file DomainParticipantImpl.cpp.

References ACE_GUARD_RETURN, publishers_, and publishers_protector_.

Referenced by delete_contained_entities().

2606 {
2608  bool result = true;
2609  const PublisherSet::iterator end = publishers_.end();
2610  for (PublisherSet::iterator i = publishers_.begin(); i != end; ++i) {
2611  result &= i->svt_->set_wait_pending_deadline(deadline);
2612  }
2613  return result;
2614 }
PublisherSet publishers_
Collection of publishers.
#define ACE_GUARD_RETURN(MUTEX, OBJ, LOCK, RETURN)
ACE_Recursive_Thread_Mutex publishers_protector_
Protect the publisher collection.

◆ signal_liveliness()

void OpenDDS::DCPS::DomainParticipantImpl::signal_liveliness ( DDS::LivelinessQosPolicyKind  kind)
private

Definition at line 2449 of file DomainParticipantImpl.cpp.

References domain_id_, get_id(), and TheServiceParticipant.

Referenced by OpenDDS::DCPS::DomainParticipantImpl::AutomaticLivelinessTimer::dispatch(), and OpenDDS::DCPS::DomainParticipantImpl::ParticipantLivelinessTimer::dispatch().

2450 {
2451  TheServiceParticipant->get_discovery(domain_id_)->signal_liveliness (domain_id_, get_id(), kind);
2452 }
const DDS::DomainId_t domain_id_
The id of the domain that creates this participant.
#define TheServiceParticipant

◆ update_ownership_strength()

void OpenDDS::DCPS::DomainParticipantImpl::update_ownership_strength ( const GUID_t pub_id,
const CORBA::Long ownership_strength 
)

Called upon receiving new BIT publication data to update the ownership strength of a publication.

Definition at line 2110 of file DomainParticipantImpl.cpp.

References ACE_GUARD, OpenDDS::DCPS::EntityImpl::get_deleted(), subscribers_, and subscribers_protector_.

Referenced by OpenDDS::DCPS::BitPubListenerImpl::on_data_available().

2112 {
2114  tao_mon,
2115  this->subscribers_protector_);
2116 
2117  if (this->get_deleted ())
2118  return;
2119 
2120  for (SubscriberSet::iterator it(this->subscribers_.begin());
2121  it != this->subscribers_.end(); ++it) {
2122  it->svt_->update_ownership_strength(pub_id, ownership_strength);
2123  }
2124 }
#define ACE_GUARD(MUTEX, OBJ, LOCK)
SubscriberSet subscribers_
Collection of subscribers.
ACE_Recursive_Thread_Mutex subscribers_protector_
Protect the subscriber collection.

◆ validate_publisher_qos()

bool OpenDDS::DCPS::DomainParticipantImpl::validate_publisher_qos ( DDS::PublisherQos publisher_qos)
private

Definition at line 2147 of file DomainParticipantImpl.cpp.

References ACE_ERROR, ACE_TEXT(), OpenDDS::DCPS::Qos_Helper::consistent(), OpenDDS::DCPS::DCPS_debug_level, get_default_publisher_qos(), LM_ERROR, OPENDDS_NO_OBJECT_MODEL_PROFILE_COMPATIBILITY_CHECK, PUBLISHER_QOS_DEFAULT, and OpenDDS::DCPS::Qos_Helper::valid().

Referenced by create_publisher(), and create_replayer().

2148 {
2149  if (pub_qos == PUBLISHER_QOS_DEFAULT) {
2150  this->get_default_publisher_qos(pub_qos);
2151  }
2152 
2154 
2155  if (!Qos_Helper::valid(pub_qos) || !Qos_Helper::consistent(pub_qos)) {
2156  if (DCPS_debug_level > 0) {
2157  ACE_ERROR((LM_ERROR,
2158  ACE_TEXT("(%P|%t) ERROR: ")
2159  ACE_TEXT("DomainParticipantImpl::validate_publisher_qos, ")
2160  ACE_TEXT("invalid qos.\n")));
2161  }
2162  return false;
2163  }
2164 
2165  return true;
2166 }
#define ACE_ERROR(X)
static bool consistent(const DDS::ResourceLimitsQosPolicy &resource_limits, const DDS::HistoryQosPolicy &history)
Definition: Qos_Helper.inl:596
virtual DDS::ReturnCode_t get_default_publisher_qos(DDS::PublisherQos &qos)
static bool valid(const DDS::UserDataQosPolicy &qos)
Definition: Qos_Helper.inl:723
#define PUBLISHER_QOS_DEFAULT
OpenDDS_Dcps_Export unsigned int DCPS_debug_level
Definition: debug.cpp:30
ACE_TEXT("TCP_Factory")
#define OPENDDS_NO_OBJECT_MODEL_PROFILE_COMPATIBILITY_CHECK(qos, error_rtn_value)

◆ validate_subscriber_qos()

bool OpenDDS::DCPS::DomainParticipantImpl::validate_subscriber_qos ( DDS::SubscriberQos subscriber_qos)
private

Definition at line 2169 of file DomainParticipantImpl.cpp.

References ACE_ERROR, ACE_TEXT(), OpenDDS::DCPS::Qos_Helper::consistent(), OpenDDS::DCPS::DCPS_debug_level, get_default_subscriber_qos(), LM_ERROR, OPENDDS_NO_OBJECT_MODEL_PROFILE_COMPATIBILITY_CHECK, SUBSCRIBER_QOS_DEFAULT, and OpenDDS::DCPS::Qos_Helper::valid().

Referenced by create_recorder(), and create_subscriber().

2170 {
2171  if (subscriber_qos == SUBSCRIBER_QOS_DEFAULT) {
2172  this->get_default_subscriber_qos(subscriber_qos);
2173  }
2174 
2176 
2177  if (!Qos_Helper::valid(subscriber_qos) || !Qos_Helper::consistent(subscriber_qos)) {
2178  if (DCPS_debug_level > 0) {
2179  ACE_ERROR((LM_ERROR,
2180  ACE_TEXT("(%P|%t) ERROR: ")
2181  ACE_TEXT("DomainParticipantImpl::validate_subscriber_qos, ")
2182  ACE_TEXT("invalid qos.\n")));
2183  }
2184  return false;
2185  }
2186 
2187 
2188  return true;
2189 }
#define ACE_ERROR(X)
static bool consistent(const DDS::ResourceLimitsQosPolicy &resource_limits, const DDS::HistoryQosPolicy &history)
Definition: Qos_Helper.inl:596
virtual DDS::ReturnCode_t get_default_subscriber_qos(DDS::SubscriberQos &qos)
static bool valid(const DDS::UserDataQosPolicy &qos)
Definition: Qos_Helper.inl:723
OpenDDS_Dcps_Export unsigned int DCPS_debug_level
Definition: debug.cpp:30
ACE_TEXT("TCP_Factory")
#define SUBSCRIBER_QOS_DEFAULT
#define OPENDDS_NO_OBJECT_MODEL_PROFILE_COMPATIBILITY_CHECK(qos, error_rtn_value)

Member Data Documentation

◆ automatic_liveliness_task_

RcHandle<AutomaticLivelinessTask> OpenDDS::DCPS::DomainParticipantImpl::automatic_liveliness_task_
private

Definition at line 623 of file DomainParticipantImpl.h.

◆ automatic_liveliness_timer_

RcHandle<AutomaticLivelinessTimer> OpenDDS::DCPS::DomainParticipantImpl::automatic_liveliness_timer_
private

◆ bit_subscriber_

RcHandle<BitSubscriber> OpenDDS::DCPS::DomainParticipantImpl::bit_subscriber_
private

◆ default_publisher_qos_

DDS::PublisherQos OpenDDS::DCPS::DomainParticipantImpl::default_publisher_qos_
private

The default publisher qos.

Definition at line 466 of file DomainParticipantImpl.h.

Referenced by get_default_publisher_qos(), and set_default_publisher_qos().

◆ default_subscriber_qos_

DDS::SubscriberQos OpenDDS::DCPS::DomainParticipantImpl::default_subscriber_qos_
private

The default subscriber qos.

Definition at line 468 of file DomainParticipantImpl.h.

Referenced by get_default_subscriber_qos(), and set_default_subscriber_qos().

◆ default_topic_qos_

DDS::TopicQos OpenDDS::DCPS::DomainParticipantImpl::default_topic_qos_
private

The default topic qos.

Definition at line 464 of file DomainParticipantImpl.h.

Referenced by get_default_topic_qos(), and set_default_topic_qos().

◆ domain_id_

const DDS::DomainId_t OpenDDS::DCPS::DomainParticipantImpl::domain_id_
private

◆ dp_id_

GUID_t OpenDDS::DCPS::DomainParticipantImpl::dp_id_
private

◆ federated_

bool OpenDDS::DCPS::DomainParticipantImpl::federated_
private

Whether this DomainParticipant is attached to a federated repository.

Definition at line 496 of file DomainParticipantImpl.h.

Referenced by enable().

◆ filter_cache_lock_

ACE_Thread_Mutex OpenDDS::DCPS::DomainParticipantImpl::filter_cache_lock_
private

Definition at line 560 of file DomainParticipantImpl.h.

Referenced by deref_filter_eval(), and get_filter_eval().

◆ handle_protector_

ACE_Thread_Mutex OpenDDS::DCPS::DomainParticipantImpl::handle_protector_
mutableprivate

◆ handle_waiters_

ConditionVariable<ACE_Thread_Mutex> OpenDDS::DCPS::DomainParticipantImpl::handle_waiters_
mutableprivate

Definition at line 533 of file DomainParticipantImpl.h.

Referenced by assign_handle(), and await_handle().

◆ handles_

CountedHandleMap OpenDDS::DCPS::DomainParticipantImpl::handles_
private

Instance handles assigned which are mapped to GUIDs (use handle_protector_)

Definition at line 514 of file DomainParticipantImpl.h.

Referenced by assign_handle(), await_handle(), get_discovered_participant_data(), get_discovered_participants(), get_discovered_topic_data(), get_discovered_topics(), lookup_handle(), and return_handle().

◆ id_handle_

DDS::Security::IdentityHandle OpenDDS::DCPS::DomainParticipantImpl::id_handle_
private

This participant id handle given by authentication.

Definition at line 482 of file DomainParticipantImpl.h.

Referenced by enable().

◆ ignored_participants_

HandleMap OpenDDS::DCPS::DomainParticipantImpl::ignored_participants_
private

Collection of ignored participants.

Definition at line 521 of file DomainParticipantImpl.h.

Referenced by get_discovered_participants(), and ignore_participant().

◆ ignored_topics_

HandleMap OpenDDS::DCPS::DomainParticipantImpl::ignored_topics_
private

Collection of ignored topics.

Definition at line 523 of file DomainParticipantImpl.h.

Referenced by get_discovered_topics(), and ignore_topic().

◆ last_liveliness_activity_

MonotonicTimePoint OpenDDS::DCPS::DomainParticipantImpl::last_liveliness_activity_
private

◆ listener_

DDS::DomainParticipantListener_var OpenDDS::DCPS::DomainParticipantImpl::listener_
private

Used to notify the entity for relevant events.

Definition at line 475 of file DomainParticipantImpl.h.

Referenced by get_listener(), listener_for(), and set_listener().

◆ listener_mask_

DDS::StatusMask OpenDDS::DCPS::DomainParticipantImpl::listener_mask_
private

The StatusKind bit mask indicates which status condition change can be notified by the listener of this entity.

Definition at line 478 of file DomainParticipantImpl.h.

Referenced by listener_for(), and set_listener().

◆ listener_mutex_

ACE_Thread_Mutex OpenDDS::DCPS::DomainParticipantImpl::listener_mutex_
private

Mutex to protect listener info.

Definition at line 473 of file DomainParticipantImpl.h.

Referenced by get_listener(), listener_for(), and set_listener().

◆ monitor_

unique_ptr<Monitor> OpenDDS::DCPS::DomainParticipantImpl::monitor_
private

Definition at line 550 of file DomainParticipantImpl.h.

Referenced by create_new_topic(), DomainParticipantImpl(), and enable().

◆ owner_man_

OwnershipManager OpenDDS::DCPS::DomainParticipantImpl::owner_man_
private

Definition at line 553 of file DomainParticipantImpl.h.

Referenced by ownership_manager().

◆ part_crypto_handle_

DDS::Security::ParticipantCryptoHandle OpenDDS::DCPS::DomainParticipantImpl::part_crypto_handle_
private

This participant crypto handle given by crypto.

Definition at line 486 of file DomainParticipantImpl.h.

Referenced by enable().

◆ participant_handles_

InstanceHandleGenerator& OpenDDS::DCPS::DomainParticipantImpl::participant_handles_
private

Get instances handles from DomainParticipantFactory (use handle_protector_)

Definition at line 545 of file DomainParticipantImpl.h.

Referenced by assign_handle().

◆ participant_liveliness_task_

RcHandle<ParticipantLivelinessTask> OpenDDS::DCPS::DomainParticipantImpl::participant_liveliness_task_
private

Definition at line 643 of file DomainParticipantImpl.h.

◆ participant_liveliness_timer_

RcHandle<ParticipantLivelinessTimer> OpenDDS::DCPS::DomainParticipantImpl::participant_liveliness_timer_
private

◆ perm_handle_

DDS::Security::PermissionsHandle OpenDDS::DCPS::DomainParticipantImpl::perm_handle_
private

This participant permissions handle given by access constrol.

Definition at line 484 of file DomainParticipantImpl.h.

Referenced by create_new_topic(), enable(), and ~DomainParticipantImpl().

◆ pub_id_gen_

RepoIdSequence OpenDDS::DCPS::DomainParticipantImpl::pub_id_gen_
private

Publisher ID generator.

Definition at line 557 of file DomainParticipantImpl.h.

Referenced by create_publisher().

◆ publishers_

PublisherSet OpenDDS::DCPS::DomainParticipantImpl::publishers_
private

◆ publishers_protector_

ACE_Recursive_Thread_Mutex OpenDDS::DCPS::DomainParticipantImpl::publishers_protector_
private

◆ qos_

DDS::DomainParticipantQos OpenDDS::DCPS::DomainParticipantImpl::qos_
private

◆ recorders_

RecorderSet OpenDDS::DCPS::DomainParticipantImpl::recorders_
private

Definition at line 567 of file DomainParticipantImpl.h.

Referenced by create_recorder(), delete_recorder(), and handle_exception().

◆ recorders_protector_

ACE_Recursive_Thread_Mutex OpenDDS::DCPS::DomainParticipantImpl::recorders_protector_
private

Protect the recorders collection.

Definition at line 575 of file DomainParticipantImpl.h.

Referenced by create_recorder(), delete_recorder(), and handle_exception().

◆ replayers_

ReplayerSet OpenDDS::DCPS::DomainParticipantImpl::replayers_
private

Definition at line 568 of file DomainParticipantImpl.h.

Referenced by create_replayer(), delete_replayer(), and handle_exception().

◆ replayers_protector_

ACE_Recursive_Thread_Mutex OpenDDS::DCPS::DomainParticipantImpl::replayers_protector_
private

Protect the replayers collection.

Definition at line 577 of file DomainParticipantImpl.h.

Referenced by create_replayer(), delete_replayer(), and handle_exception().

◆ repoIds_

RepoIdMap OpenDDS::DCPS::DomainParticipantImpl::repoIds_
private

By-handle lookup of instance handles assigned to GUIDs (use handle_protector_)

Definition at line 516 of file DomainParticipantImpl.h.

Referenced by assign_handle(), get_repoid(), and return_handle().

◆ reusable_handles_

DisjointSequence::OrderedRanges<DDS::InstanceHandle_t> OpenDDS::DCPS::DomainParticipantImpl::reusable_handles_
private

Keep track of handles that can be reused (use handle_protector_)

Definition at line 548 of file DomainParticipantImpl.h.

Referenced by assign_handle(), and return_handle().

◆ security_config_

Security::SecurityConfig_rch OpenDDS::DCPS::DomainParticipantImpl::security_config_
private

Definition at line 571 of file DomainParticipantImpl.h.

Referenced by create_new_topic(), enable(), and ~DomainParticipantImpl().

◆ shutdown_complete_

bool OpenDDS::DCPS::DomainParticipantImpl::shutdown_complete_
private

Definition at line 539 of file DomainParticipantImpl.h.

Referenced by delete_contained_entities(), and handle_exception().

◆ shutdown_condition_

ConditionVariable<ACE_Thread_Mutex> OpenDDS::DCPS::DomainParticipantImpl::shutdown_condition_
private

Definition at line 537 of file DomainParticipantImpl.h.

Referenced by delete_contained_entities(), and handle_exception().

◆ shutdown_mutex_

ACE_Thread_Mutex OpenDDS::DCPS::DomainParticipantImpl::shutdown_mutex_
private

Protect the shutdown.

Definition at line 536 of file DomainParticipantImpl.h.

Referenced by delete_contained_entities(), and handle_exception().

◆ shutdown_result_

DDS::ReturnCode_t OpenDDS::DCPS::DomainParticipantImpl::shutdown_result_
private

Definition at line 538 of file DomainParticipantImpl.h.

Referenced by delete_contained_entities(), and handle_exception().

◆ subscribers_

SubscriberSet OpenDDS::DCPS::DomainParticipantImpl::subscribers_
private

◆ subscribers_protector_

ACE_Recursive_Thread_Mutex OpenDDS::DCPS::DomainParticipantImpl::subscribers_protector_
private

Protect the subscriber collection.

Definition at line 527 of file DomainParticipantImpl.h.

Referenced by contains_entity(), create_subscriber(), delete_subscriber(), handle_exception(), and update_ownership_strength().

◆ topic_descrs_

TopicDescriptionMap OpenDDS::DCPS::DomainParticipantImpl::topic_descrs_
private

Collection of TopicDescriptions which are not also Topics.

Definition at line 506 of file DomainParticipantImpl.h.

Referenced by create_contentfilteredtopic(), create_multitopic(), create_topic_i(), delete_contentfilteredtopic(), delete_multitopic(), and lookup_topicdescription().

◆ TOPIC_TYPE_HAS_KEYS

const int OpenDDS::DCPS::DomainParticipantImpl::TOPIC_TYPE_HAS_KEYS = 1
staticprivate

The implementation of create_topic.{@ constants for the topic_mask argument to create_topic_i

Definition at line 436 of file DomainParticipantImpl.h.

Referenced by create_typeless_topic().

◆ TOPIC_TYPELESS

const int OpenDDS::DCPS::DomainParticipantImpl::TOPIC_TYPELESS = 2
staticprivate

Definition at line 437 of file DomainParticipantImpl.h.

Referenced by create_typeless_topic().

◆ topics_

TopicMap OpenDDS::DCPS::DomainParticipantImpl::topics_
private

◆ topics_protector_

ACE_Recursive_Thread_Mutex OpenDDS::DCPS::DomainParticipantImpl::topics_protector_
private

◆ type_lookup_service_

XTypes::TypeLookupService_rch OpenDDS::DCPS::DomainParticipantImpl::type_lookup_service_
private

Definition at line 653 of file DomainParticipantImpl.h.

Referenced by DomainParticipantImpl(), enable(), and get_dynamic_type().


The documentation for this class was generated from the following files: