OpenDDS  Snapshot(2023/04/28-20:55)
TransportRegistry.inl
Go to the documentation of this file.
1 /*
2  *
3  *
4  * Distributed under the OpenDDS License.
5  * See: http://www.opendds.org/license.html
6  */
7 
8 #include "EntryExit.h"
9 #include "TransportInst.h"
10 #include "TransportType.h"
11 
13 
14 namespace OpenDDS {
15 namespace DCPS {
16 
19 {
20  DBG_ENTRY_LVL("TransportRegistry", "~TransportRegistry", 6);
21 }
22 
26 {
27  DBG_ENTRY_LVL("TransportRegistry", "global_config()", 6);
28  GuardType guard(this->lock_);
29  return this->global_config_;
30 }
31 
33 void
35 {
36  DBG_ENTRY_LVL("TransportRegistry", "global_config(cfg)", 6);
37  GuardType guard(this->lock_);
38  this->global_config_ = cfg;
39 }
40 
42 void
44  const TransportConfig_rch& cfg)
45 {
46  GuardType guard(this->lock_);
47  domain_default_config_map_[domain] = cfg;
48 }
49 
53 {
54  GuardType guard(this->lock_);
55  const DomainConfigMap::const_iterator iter =
56  domain_default_config_map_.find(domain);
57  return (iter == domain_default_config_map_.end())
58  ? TransportConfig_rch() : iter->second;
59 }
60 
62 void
64 {
65  remove_inst(inst->name());
66 }
67 
69 void
71 {
72  TransportInst_rch inst;
73  {
74  GuardType guard(this->lock_);
75  InstMap::iterator iter = inst_map_.find(inst_name);
76  if (iter == inst_map_.end()) {
77  return;
78  }
79  inst = iter->second;
80  inst_map_.erase(iter);
81  }
82 
83  if (inst) {
84  inst->shutdown();
85  }
86 }
87 
89 void
91 {
92  remove_config(cfg->name());
93 }
94 
96 void
98 {
99  GuardType guard(this->lock_);
100  config_map_.erase(config_name);
101 }
102 
104 void
106  DDS::Entity_ptr entity)
107 {
108  this->bind_config(this->get_config(name), entity);
109 }
110 
111 }
112 }
113 
void remove_inst(const TransportInst_rch &inst)
const OPENDDS_STRING & name() const
Definition: TransportInst.h:70
RcHandle< TransportConfig > TransportConfig_rch
void domain_default_config(DDS::DomainId_t domain, const TransportConfig_rch &cfg)
void bind_config(const OPENDDS_STRING &name, DDS::Entity_ptr entity)
TransportConfig_rch global_config() const
#define OPENDDS_STRING
DOMAINID_TYPE_NATIVE DomainId_t
TransportConfig_rch get_config(const OPENDDS_STRING &name) const
void remove_config(const TransportConfig_rch &cfg)
OPENDDS_STRING name() const
const char *const name
Definition: debug.cpp:60
#define DBG_ENTRY_LVL(CNAME, MNAME, DBG_LVL)
Definition: EntryExit.h:68
#define OPENDDS_END_VERSIONED_NAMESPACE_DECL
#define ACE_INLINE
The Internal API and Implementation of OpenDDS.
Definition: AddressCache.h:28