Line data Source code
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 : 12 : OPENDDS_BEGIN_VERSIONED_NAMESPACE_DECL 13 : 14 : namespace OpenDDS { 15 : namespace DCPS { 16 : 17 : ACE_INLINE 18 9 : TransportRegistry::~TransportRegistry() 19 : { 20 : DBG_ENTRY_LVL("TransportRegistry", "~TransportRegistry", 6); 21 9 : } 22 : 23 : ACE_INLINE 24 : TransportConfig_rch 25 0 : TransportRegistry::global_config() const 26 : { 27 : DBG_ENTRY_LVL("TransportRegistry", "global_config()", 6); 28 0 : GuardType guard(this->lock_); 29 0 : return this->global_config_; 30 0 : } 31 : 32 : ACE_INLINE 33 : void 34 0 : TransportRegistry::global_config(const TransportConfig_rch& cfg) 35 : { 36 : DBG_ENTRY_LVL("TransportRegistry", "global_config(cfg)", 6); 37 0 : GuardType guard(this->lock_); 38 0 : this->global_config_ = cfg; 39 0 : } 40 : 41 : ACE_INLINE 42 : void 43 0 : TransportRegistry::domain_default_config(DDS::DomainId_t domain, 44 : const TransportConfig_rch& cfg) 45 : { 46 0 : GuardType guard(this->lock_); 47 0 : domain_default_config_map_[domain] = cfg; 48 0 : } 49 : 50 : ACE_INLINE 51 : TransportConfig_rch 52 0 : TransportRegistry::domain_default_config(DDS::DomainId_t domain) const 53 : { 54 0 : GuardType guard(this->lock_); 55 : const DomainConfigMap::const_iterator iter = 56 0 : domain_default_config_map_.find(domain); 57 0 : return (iter == domain_default_config_map_.end()) 58 0 : ? TransportConfig_rch() : iter->second; 59 0 : } 60 : 61 : ACE_INLINE 62 : void 63 : TransportRegistry::remove_inst(const TransportInst_rch& inst) 64 : { 65 : remove_inst(inst->name()); 66 : } 67 : 68 : ACE_INLINE 69 : void 70 0 : TransportRegistry::remove_inst(const OPENDDS_STRING& inst_name) 71 : { 72 0 : TransportInst_rch inst; 73 : { 74 0 : GuardType guard(this->lock_); 75 0 : InstMap::iterator iter = inst_map_.find(inst_name); 76 0 : if (iter == inst_map_.end()) { 77 0 : return; 78 : } 79 0 : inst = iter->second; 80 0 : inst_map_.erase(iter); 81 0 : } 82 : 83 0 : if (inst) { 84 0 : inst->shutdown(); 85 : } 86 0 : } 87 : 88 : ACE_INLINE 89 : void 90 : TransportRegistry::remove_config(const TransportConfig_rch& cfg) 91 : { 92 : remove_config(cfg->name()); 93 : } 94 : 95 : ACE_INLINE 96 : void 97 0 : TransportRegistry::remove_config(const OPENDDS_STRING& config_name) 98 : { 99 0 : GuardType guard(this->lock_); 100 0 : config_map_.erase(config_name); 101 0 : } 102 : 103 : ACE_INLINE 104 : void 105 0 : TransportRegistry::bind_config(const OPENDDS_STRING& name, 106 : DDS::Entity_ptr entity) 107 : { 108 0 : this->bind_config(this->get_config(name), entity); 109 0 : } 110 : 111 : } 112 : } 113 : 114 : OPENDDS_END_VERSIONED_NAMESPACE_DECL