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

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

#include <DomainParticipantFactoryImpl.h>

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

Public Member Functions

typedef OPENDDS_SET (RcHandle< DomainParticipantImpl >) DPSet
 
typedef OPENDDS_MAP (DDS::DomainId_t, DPSet) DPMap
 
 DomainParticipantFactoryImpl ()
 
virtual ~DomainParticipantFactoryImpl ()
 
virtual DDS::DomainParticipant_ptr create_participant (DDS::DomainId_t domainId, const DDS::DomainParticipantQos &qos, DDS::DomainParticipantListener_ptr a_listener, DDS::StatusMask mask)
 
virtual DDS::ReturnCode_t delete_participant (DDS::DomainParticipant_ptr a_participant)
 
virtual DDS::DomainParticipant_ptr lookup_participant (DDS::DomainId_t domainId)
 
virtual DDS::ReturnCode_t set_default_participant_qos (const DDS::DomainParticipantQos &qos)
 
virtual DDS::ReturnCode_t get_default_participant_qos (DDS::DomainParticipantQos &qos)
 
virtual DDS::DomainParticipantFactory_ptr get_instance ()
 
virtual DDS::ReturnCode_t set_qos (const DDS::DomainParticipantFactoryQos &qos)
 
virtual DDS::ReturnCode_t get_qos (DDS::DomainParticipantFactoryQos &qos)
 
DPMap participants () const
 Make a copy of the participants map for reading. More...
 
DDS::ReturnCode_t delete_all_participants ()
 
size_t participant_count () const
 
- Public Member Functions inherited from DDS::DomainParticipantFactory
DomainParticipant create_participant (in DomainId_t domainId, in DomainParticipantQos qos, in DomainParticipantListener a_listener, in StatusMask mask)
 
ReturnCode_t delete_participant (in DomainParticipant a_participant)
 
DomainParticipant lookup_participant (in DomainId_t domainId)
 
ReturnCode_t set_default_participant_qos (in DomainParticipantQos qos)
 
ReturnCode_t get_default_participant_qos (inout DomainParticipantQos qos)
 
ReturnCode_t set_qos (in DomainParticipantFactoryQos qos)
 
ReturnCode_t get_qos (inout DomainParticipantFactoryQos qos)
 
- 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
 

Private Attributes

DDS::DomainParticipantFactoryQos qos_
 
DDS::DomainParticipantQos default_participant_qos_
 The default qos value of DomainParticipant. More...
 
DPMap participants_
 The collection of domain participants. More...
 
ACE_Recursive_Thread_Mutex participants_protector_
 Protect the participant collection. More...
 
InstanceHandleGenerator participant_handles_
 

Additional Inherited Members

- Public Types inherited from OpenDDS::DCPS::LocalObject< DDS::DomainParticipantFactory >
typedef DDS::DomainParticipantFactory ::_ptr_type _ptr_type
 
typedef DDS::DomainParticipantFactory ::_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
 
- Static Public Member Functions inherited from OpenDDS::DCPS::LocalObject< DDS::DomainParticipantFactory >
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)
 
- 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 Attributes inherited from CORBA::Object
ACE_Atomic_Op< TAO_SYNCH_MUTEX, unsigned long > refcount_
 

Detailed Description

Implements the OpenDDS::DCPS::DomainParticipantFactory interfaces.

This class acts as factory of the DomainParticipant.

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

Definition at line 41 of file DomainParticipantFactoryImpl.h.

Constructor & Destructor Documentation

◆ DomainParticipantFactoryImpl()

OpenDDS::DCPS::DomainParticipantFactoryImpl::DomainParticipantFactoryImpl ( )

Definition at line 26 of file DomainParticipantFactoryImpl.cpp.

27  : qos_(TheServiceParticipant->initial_DomainParticipantFactoryQos()),
28  default_participant_qos_(TheServiceParticipant->initial_DomainParticipantQos())
29 {
30 }
DDS::DomainParticipantQos default_participant_qos_
The default qos value of DomainParticipant.
#define TheServiceParticipant

◆ ~DomainParticipantFactoryImpl()

OpenDDS::DCPS::DomainParticipantFactoryImpl::~DomainParticipantFactoryImpl ( )
virtual

Definition at line 32 of file DomainParticipantFactoryImpl.cpp.

References ACE_DEBUG, OpenDDS::DCPS::DCPS_debug_level, and LM_DEBUG.

33 {
34  if (DCPS_debug_level > 0) {
35  ACE_DEBUG((LM_DEBUG,
36  "(%P|%t) DomainParticipantFactoryImpl::"
37  "~DomainParticipantFactoryImpl()\n"));
38  }
39 }
#define ACE_DEBUG(X)
OpenDDS_Dcps_Export unsigned int DCPS_debug_level
Definition: debug.cpp:30

Member Function Documentation

◆ create_participant()

DDS::DomainParticipant_ptr OpenDDS::DCPS::DomainParticipantFactoryImpl::create_participant ( DDS::DomainId_t  domainId,
const DDS::DomainParticipantQos qos,
DDS::DomainParticipantListener_ptr  a_listener,
DDS::StatusMask  mask 
)
virtual

Definition at line 42 of file DomainParticipantFactoryImpl.cpp.

References OpenDDS::DCPS::RcHandle< T >::_retn(), ACE_ERROR, ACE_GUARD_RETURN, ACE_TEXT(), ACE_TEXT_ALWAYS_CHAR, DDS::EntityFactoryQosPolicy::autoenable_created_entities, ACE_String_Base< char >::c_str(), OpenDDS::DCPS::Qos_Helper::consistent(), OpenDDS::DCPS::DCPS_debug_level, DDS::DomainParticipantFactoryQos::entity_factory, get_default_participant_qos(), OpenDDS::DCPS::RcHandle< T >::in(), LM_ERROR, OPENDDS_STRING, participant_handles_, PARTICIPANT_QOS_DEFAULT, participants_, participants_protector_, qos_, OpenDDS::DCPS::ref(), DDS::RETCODE_OK, TheServiceParticipant, TheTransportRegistry, and OpenDDS::DCPS::Qos_Helper::valid().

47 {
48  DDS::DomainParticipantQos par_qos = qos;
49 
50  if (par_qos == PARTICIPANT_QOS_DEFAULT) {
52  }
53 
54  if (!Qos_Helper::valid(par_qos)) {
55  if (DCPS_debug_level > 0) {
56  ACE_ERROR((LM_ERROR,
57  ACE_TEXT("(%P|%t) ERROR: ")
58  ACE_TEXT("DomainParticipantFactoryImpl::create_participant, ")
59  ACE_TEXT("invalid qos.\n")));
60  }
61  return DDS::DomainParticipant::_nil();
62  }
63 
64  if (!Qos_Helper::consistent(par_qos)) {
65  if (DCPS_debug_level > 0) {
66  ACE_ERROR((LM_ERROR,
67  ACE_TEXT("(%P|%t) ERROR: ")
68  ACE_TEXT("DomainParticipantFactoryImpl::create_participant, ")
69  ACE_TEXT("inconsistent qos.\n")));
70  }
71  return DDS::DomainParticipant::_nil();
72  }
73 
74  RcHandle<DomainParticipantImpl> dp =
75  make_rch<DomainParticipantImpl>(ref(participant_handles_), domainId, par_qos, a_listener, mask);
76 
78  if (dp->enable() != DDS::RETCODE_OK) {
79  if (DCPS_debug_level > 0) {
80  ACE_ERROR((LM_ERROR,
81  ACE_TEXT("(%P|%t) ERROR: ")
82  ACE_TEXT("DomainParticipantFactoryImpl::create_participant, ")
83  ACE_TEXT("unable to enable DomainParticipant.\n")));
84  }
85  return DDS::DomainParticipant::_nil();
86  }
87  }
88 
89  // if the specified transport is a transport template then create a new transport
90  // instance for the new participant if per_participant is set (checked before creating instance).
91  ACE_TString transport_base_config_name;
92  TheServiceParticipant->get_transport_base_config_name(domainId, transport_base_config_name);
93 
94  if (TheTransportRegistry->config_has_transport_template(transport_base_config_name)) {
95  OPENDDS_STRING transport_config_name = ACE_TEXT_ALWAYS_CHAR(transport_base_config_name.c_str());
96  OPENDDS_STRING transport_instance_name = dp->get_unique_id();
97 
98  // unique config and instance names are returned in transport_config_name and transport_instance_name
99  const bool ret = TheTransportRegistry->create_new_transport_instance_for_participant(domainId, transport_config_name, transport_instance_name);
100 
101  if (ret) {
102  TheTransportRegistry->bind_config(transport_config_name, dp.in());
103  TheTransportRegistry->update_config_template_instance_info(transport_config_name, transport_instance_name);
104  } else {
105  if (DCPS_debug_level > 0) {
106  ACE_ERROR((LM_ERROR,
107  ACE_TEXT("(%P|%t) ERROR: ")
108  ACE_TEXT("DomainParticipantFactoryImpl::create_participant, ")
109  ACE_TEXT("could not create new transport instance for participant.\n")));
110  }
111  return DDS::DomainParticipant::_nil();
112  }
113  }
114 
116  guard,
118  DDS::DomainParticipant::_nil());
119 
120  participants_[domainId].insert(dp);
121  return dp._retn();
122 }
#define TheTransportRegistry
#define PARTICIPANT_QOS_DEFAULT
virtual DDS::ReturnCode_t get_default_participant_qos(DDS::DomainParticipantQos &qos)
#define ACE_ERROR(X)
const char * c_str(void) const
const ReturnCode_t RETCODE_OK
reference_wrapper< T > ref(T &r)
Definition: RcHandle_T.h:237
#define ACE_TEXT_ALWAYS_CHAR(STRING)
static bool consistent(const DDS::ResourceLimitsQosPolicy &resource_limits, const DDS::HistoryQosPolicy &history)
Definition: Qos_Helper.inl:596
EntityFactoryQosPolicy entity_factory
ACE_Recursive_Thread_Mutex participants_protector_
Protect the participant collection.
DPMap participants_
The collection of domain participants.
#define OPENDDS_STRING
#define ACE_GUARD_RETURN(MUTEX, OBJ, LOCK, RETURN)
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 TheServiceParticipant

◆ delete_all_participants()

DDS::ReturnCode_t OpenDDS::DCPS::DomainParticipantFactoryImpl::delete_all_participants ( )

Definition at line 326 of file DomainParticipantFactoryImpl.cpp.

References ACE_ERROR, ACE_GUARD_RETURN, copy(), OpenDDS::DCPS::DomainParticipantImpl::delete_contained_entities(), delete_participant(), LM_NOTICE, OpenDDS::DCPS::log_level, OpenDDS::DCPS::LogLevel::Notice, participants(), participants_, participants_protector_, DDS::RETCODE_ERROR, DDS::RETCODE_OK, DDS::RETCODE_OUT_OF_RESOURCES, and OpenDDS::DCPS::retcode_to_string().

327 {
330 
331  /*
332  * Create a copy of the participants because we need to run
333  * delete_participants on them, but delete_participants removes them from the
334  * object's map.
335  */
336  DPMap copy = participants();
337 
339  DPMap::iterator itr;
340  for (itr = copy.begin(); itr != copy.end(); ++itr) {
341  DPSet& dp_set = itr->second;
342  DPSet::iterator dp_set_itr;
343  for (dp_set_itr = dp_set.begin(); dp_set_itr != dp_set.end(); ++dp_set_itr) {
344  DomainParticipantImpl* const dp = &**dp_set_itr;
345  DDS::ReturnCode_t tmp = dp->delete_contained_entities();
346  if (tmp) {
347  if (log_level >= LogLevel::Notice) {
348  ACE_ERROR((LM_NOTICE, "(%P|%t) NOTICE: "
349  "DomainParticipantFactoryImpl::delete_all_participants: "
350  "delete_contained_entities returned %C\n",
351  retcode_to_string(tmp)));
352  }
353  rv = DDS::RETCODE_ERROR;
354  }
355 
356  tmp = delete_participant(dp);
357  if (tmp) {
358  if (log_level >= LogLevel::Notice) {
359  ACE_ERROR((LM_NOTICE, "(%P|%t) NOTICE: "
360  "DomainParticipantFactoryImpl::delete_all_participants: "
361  "delete_participant returned %C\n",
362  retcode_to_string(tmp)));
363  }
364  rv = DDS::RETCODE_ERROR;
365  }
366  }
367  }
368 
369  // Remove Empty Domain Id Sets
370  participants_.clear();
371 
372  return rv;
373 }
OpenDDS_Dcps_Export LogLevel log_level
#define ACE_ERROR(X)
DPMap participants() const
Make a copy of the participants map for reading.
const char * retcode_to_string(DDS::ReturnCode_t value)
Definition: DCPS_Utils.cpp:29
const ReturnCode_t RETCODE_OK
ACE_Recursive_Thread_Mutex participants_protector_
Protect the participant collection.
DPMap participants_
The collection of domain participants.
#define ACE_GUARD_RETURN(MUTEX, OBJ, LOCK, RETURN)
const ReturnCode_t RETCODE_ERROR
virtual DDS::ReturnCode_t delete_participant(DDS::DomainParticipant_ptr a_participant)
const ReturnCode_t RETCODE_OUT_OF_RESOURCES
T * copy(T const &st)

◆ delete_participant()

DDS::ReturnCode_t OpenDDS::DCPS::DomainParticipantFactoryImpl::delete_participant ( DDS::DomainParticipant_ptr  a_participant)
virtual

Definition at line 125 of file DomainParticipantFactoryImpl.cpp.

References ACE_ERROR, ACE_GUARD_RETURN, ACE_TEXT(), OpenDDS::DCPS::LogGuid::c_str(), OpenDDS::DCPS::DCPS_debug_level, OpenDDS::DCPS::DomainParticipantImpl::delete_contained_entities(), OpenDDS::DCPS::DomainParticipantImpl::get_domain_id(), OpenDDS::DCPS::DomainParticipantImpl::get_id(), OpenDDS::DCPS::DomainParticipantImpl::is_clean(), CORBA::is_nil(), LM_ERROR, LM_NOTICE, OpenDDS::DCPS::log_level, OpenDDS::DCPS::TransportConfig::name(), OpenDDS::DCPS::LogLevel::Notice, participants_, participants_protector_, OpenDDS::DCPS::rchandle_from(), DDS::RETCODE_BAD_PARAMETER, DDS::RETCODE_ERROR, DDS::RETCODE_OK, DDS::RETCODE_PRECONDITION_NOT_MET, TheServiceParticipant, and TheTransportRegistry.

Referenced by delete_all_participants().

127 {
128  if (CORBA::is_nil(a_participant)) {
129  if (DCPS_debug_level > 0) {
130  ACE_ERROR((LM_ERROR,
131  ACE_TEXT("(%P|%t) ERROR: ")
132  ACE_TEXT("DomainParticipantFactoryImpl::delete_participant, ")
133  ACE_TEXT("Nil participant.\n")));
134  }
136  }
137 
138  // The servant's ref count should be 2 at this point, one referenced
139  // by the poa and the other referenced by the map.
140  DomainParticipantImpl* the_servant = dynamic_cast<DomainParticipantImpl*>(a_participant);
141  if (!the_servant) {
142  if (DCPS_debug_level > 0) {
143  ACE_ERROR((LM_ERROR, ACE_TEXT("(%P|%t) ERROR: ")
144  ACE_TEXT("DomainParticipantFactoryImpl::delete_participant: ")
145  ACE_TEXT("failed to obtain the DomainParticipantImpl.\n")));
146  }
147  return DDS::RETCODE_ERROR;
148  }
149 
150  RcHandle<DomainParticipantImpl> servant_rch = rchandle_from(the_servant);
151 
152  TransportConfig_rch tr_cfg = servant_rch->transport_config();
153  if (tr_cfg) {
154  // check for and remove tranport template instance
155  TheTransportRegistry->remove_transport_template_instance(tr_cfg->name());
156  }
157 
158  //xxx servant rc = 4 (servant::DP::Entity::ServantBase::ref_count_
159  String leftover_entities;
160  if (!the_servant->is_clean(&leftover_entities)) {
161  if (log_level >= LogLevel::Notice) {
162  ACE_ERROR((LM_NOTICE, "(%P|%t) NOTICE: "
163  "DomainParticipantFactoryImpl::delete_participant: "
164  "the participant %C is not empty. %C leftover\n",
165  LogGuid(the_servant->get_id()).c_str(), leftover_entities.c_str()));
166  }
168  }
169 
170  const DDS::DomainId_t domain_id = the_servant->get_domain_id();
171  const GUID_t dp_id = the_servant->get_id();
172 
173  {
175  guard,
178 
179  DPMap::iterator pos = participants_.find(domain_id);
180  if (pos == participants_.end()) {
181  if (DCPS_debug_level > 0) {
182  ACE_ERROR((LM_ERROR,
183  ACE_TEXT("(%P|%t) ERROR: ")
184  ACE_TEXT("DomainParticipantFactoryImpl::delete_participant: ")
185  ACE_TEXT("%p domain_id=%d dp_id=%C.\n"),
186  ACE_TEXT("find"),
187  domain_id,
188  LogGuid(dp_id).c_str()));
189  }
190  return DDS::RETCODE_ERROR;
191  }
192 
193  if (pos->second.erase(servant_rch) == 0) {
194  if (DCPS_debug_level > 0) {
195  ACE_ERROR((LM_ERROR,
196  ACE_TEXT("(%P|%t) ERROR: ")
197  ACE_TEXT("DomainParticipantFactoryImpl::delete_participant, ")
198  ACE_TEXT(" %p.\n"),
199  ACE_TEXT("remove")));
200  }
201  return DDS::RETCODE_ERROR;
202  }
203 
204  if (pos->second.empty() && participants_.erase(domain_id) == 0) {
205  if (DCPS_debug_level > 0) {
206  ACE_ERROR((LM_ERROR,
207  ACE_TEXT("(%P|%t) ERROR: ")
208  ACE_TEXT("DomainParticipantFactoryImpl::delete_participant, ")
209  ACE_TEXT(" %p.\n"),
210  ACE_TEXT("unbind")));
211  }
212  return DDS::RETCODE_ERROR;
213  }
214 
215  guard.release();
216 
217  const DDS::ReturnCode_t result = the_servant->delete_contained_entities();
218  if (result != DDS::RETCODE_OK) {
219  return result;
220  }
221  }
222 
223  Discovery_rch disco = TheServiceParticipant->get_discovery(domain_id);
224  if (disco) {
225  if (!disco->remove_domain_participant(domain_id, dp_id)) {
226  if (DCPS_debug_level > 0) {
227  ACE_ERROR((LM_ERROR,
228  ACE_TEXT("(%P|%t) ERROR: ")
229  ACE_TEXT("could not remove domain participant.\n")));
230  }
231  return DDS::RETCODE_ERROR;
232  }
233  }
234  return DDS::RETCODE_OK;
235 }
#define TheTransportRegistry
OpenDDS_Dcps_Export LogLevel log_level
#define ACE_ERROR(X)
RcHandle< Discovery > Discovery_rch
Definition: Discovery.h:296
const ReturnCode_t RETCODE_OK
const ReturnCode_t RETCODE_BAD_PARAMETER
ACE_Recursive_Thread_Mutex participants_protector_
Protect the participant collection.
DOMAINID_TYPE_NATIVE DomainId_t
DPMap participants_
The collection of domain participants.
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")
RcHandle< T > rchandle_from(T *pointer)
Definition: RcHandle_T.h:310
std::string String
#define TheServiceParticipant
Boolean is_nil(T x)
RcHandle< TransportConfig > TransportConfig_rch

◆ get_default_participant_qos()

DDS::ReturnCode_t OpenDDS::DCPS::DomainParticipantFactoryImpl::get_default_participant_qos ( DDS::DomainParticipantQos qos)
virtual

Definition at line 282 of file DomainParticipantFactoryImpl.cpp.

References default_participant_qos_, and DDS::RETCODE_OK.

Referenced by create_participant().

284 {
286  return DDS::RETCODE_OK;
287 }
const ReturnCode_t RETCODE_OK
DDS::DomainParticipantQos default_participant_qos_
The default qos value of DomainParticipant.

◆ get_instance()

DDS::DomainParticipantFactory_ptr OpenDDS::DCPS::DomainParticipantFactoryImpl::get_instance ( )
virtual

Implements DDS::DomainParticipantFactory.

Definition at line 290 of file DomainParticipantFactoryImpl.cpp.

References TheParticipantFactory.

291 {
292  return TheParticipantFactory;
293 }
#define TheParticipantFactory

◆ get_qos()

DDS::ReturnCode_t OpenDDS::DCPS::DomainParticipantFactoryImpl::get_qos ( DDS::DomainParticipantFactoryQos qos)
virtual

Definition at line 311 of file DomainParticipantFactoryImpl.cpp.

References qos_, and DDS::RETCODE_OK.

313 {
314  qos = this->qos_;
315  return DDS::RETCODE_OK;
316 }
const ReturnCode_t RETCODE_OK

◆ lookup_participant()

DDS::DomainParticipant_ptr OpenDDS::DCPS::DomainParticipantFactoryImpl::lookup_participant ( DDS::DomainId_t  domainId)
virtual

Definition at line 238 of file DomainParticipantFactoryImpl.cpp.

References ACE_DEBUG, ACE_GUARD_RETURN, ACE_TEXT(), OpenDDS::DCPS::DCPS_debug_level, OpenDDS::DCPS::find(), LM_DEBUG, participants_, and participants_protector_.

240 {
242  guard,
244  DDS::DomainParticipant::_nil());
245 
246  DPSet* entry = 0;
247 
248  if (find(participants_, domainId, entry) == -1) {
249  if (DCPS_debug_level >= 1) {
250  ACE_DEBUG((LM_DEBUG,
251  ACE_TEXT("(%P|%t) ")
252  ACE_TEXT("DomainParticipantFactoryImpl::lookup_participant, ")
253  ACE_TEXT(" not found for domain %d.\n"),
254  domainId));
255  }
256 
257  return DDS::DomainParticipant::_nil();
258 
259  } else {
260  // No specification about which participant will return. We just return the first
261  // object.
262  // Note: We are not duplicate the object ref, so a delete call is not needed.
263  return DDS::DomainParticipant::_duplicate(entry->begin()->in());
264  }
265 }
#define ACE_DEBUG(X)
ACE_Recursive_Thread_Mutex participants_protector_
Protect the participant collection.
DPMap participants_
The collection of domain participants.
#define ACE_GUARD_RETURN(MUTEX, OBJ, LOCK, RETURN)
OpenDDS_Dcps_Export unsigned int DCPS_debug_level
Definition: debug.cpp:30
ACE_TEXT("TCP_Factory")
int find(Container &c, const Key &key, typename Container::mapped_type *&value)
Definition: Util.h:71

◆ OPENDDS_MAP()

typedef OpenDDS::DCPS::DomainParticipantFactoryImpl::OPENDDS_MAP ( DDS::DomainId_t  ,
DPSet   
)

◆ OPENDDS_SET()

typedef OpenDDS::DCPS::DomainParticipantFactoryImpl::OPENDDS_SET ( RcHandle< DomainParticipantImpl )

◆ participant_count()

size_t OpenDDS::DCPS::DomainParticipantFactoryImpl::participant_count ( ) const

Definition at line 375 of file DomainParticipantFactoryImpl.cpp.

References ACE_GUARD_RETURN, OPENDDS_END_VERSIONED_NAMESPACE_DECL, participants_, and participants_protector_.

376 {
378  size_t count = 0;
379  for (DPMap::const_iterator it = participants_.begin(); it != participants_.end(); ++it) {
380  count += it->second.size();
381  }
382  return count;
383 }
ACE_Recursive_Thread_Mutex participants_protector_
Protect the participant collection.
DPMap participants_
The collection of domain participants.
#define ACE_GUARD_RETURN(MUTEX, OBJ, LOCK, RETURN)

◆ participants()

DomainParticipantFactoryImpl::DPMap OpenDDS::DCPS::DomainParticipantFactoryImpl::participants ( ) const

Make a copy of the participants map for reading.

Definition at line 319 of file DomainParticipantFactoryImpl.cpp.

References ACE_GUARD_RETURN, participants_, and participants_protector_.

Referenced by delete_all_participants(), and OpenDDS::DCPS::SPMonitorImpl::report().

320 {
322 
323  return participants_;
324 }
ACE_Recursive_Thread_Mutex participants_protector_
Protect the participant collection.
DPMap participants_
The collection of domain participants.
#define ACE_GUARD_RETURN(MUTEX, OBJ, LOCK, RETURN)

◆ set_default_participant_qos()

DDS::ReturnCode_t OpenDDS::DCPS::DomainParticipantFactoryImpl::set_default_participant_qos ( const DDS::DomainParticipantQos qos)
virtual

Definition at line 268 of file DomainParticipantFactoryImpl.cpp.

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

270 {
271  if (Qos_Helper::valid(qos)
272  && Qos_Helper::consistent(qos)) {
274  return DDS::RETCODE_OK;
275 
276  } else {
278  }
279 }
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::DomainParticipantQos default_participant_qos_
The default qos value of DomainParticipant.

◆ set_qos()

DDS::ReturnCode_t OpenDDS::DCPS::DomainParticipantFactoryImpl::set_qos ( const DDS::DomainParticipantFactoryQos qos)
virtual

Definition at line 296 of file DomainParticipantFactoryImpl.cpp.

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

298 {
299  if (Qos_Helper::valid(qos) && Qos_Helper::consistent(qos)) {
300  if (!(qos_ == qos) && Qos_Helper::changeable(qos_, qos))
301  qos_ = qos;
302 
303  return DDS::RETCODE_OK;
304 
305  } else {
307  }
308 }
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
static bool changeable(const DDS::UserDataQosPolicy &qos1, const DDS::UserDataQosPolicy &qos2)
Definition: Qos_Helper.inl:948

Member Data Documentation

◆ default_participant_qos_

DDS::DomainParticipantQos OpenDDS::DCPS::DomainParticipantFactoryImpl::default_participant_qos_
private

The default qos value of DomainParticipant.

Definition at line 89 of file DomainParticipantFactoryImpl.h.

Referenced by get_default_participant_qos(), and set_default_participant_qos().

◆ participant_handles_

InstanceHandleGenerator OpenDDS::DCPS::DomainParticipantFactoryImpl::participant_handles_
private

Instance handle generators for non-repo backed entities (i.e. subscribers and publishers).

Definition at line 99 of file DomainParticipantFactoryImpl.h.

Referenced by create_participant().

◆ participants_

DPMap OpenDDS::DCPS::DomainParticipantFactoryImpl::participants_
private

The collection of domain participants.

Definition at line 92 of file DomainParticipantFactoryImpl.h.

Referenced by create_participant(), delete_all_participants(), delete_participant(), lookup_participant(), participant_count(), and participants().

◆ participants_protector_

ACE_Recursive_Thread_Mutex OpenDDS::DCPS::DomainParticipantFactoryImpl::participants_protector_
mutableprivate

◆ qos_

DDS::DomainParticipantFactoryQos OpenDDS::DCPS::DomainParticipantFactoryImpl::qos_
private

Definition at line 86 of file DomainParticipantFactoryImpl.h.

Referenced by create_participant(), get_qos(), and set_qos().


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