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 "DCPS/DdsDcps_pch.h" //Only the _pch include should start with DCPS/ 9 : #include "TransportConfig.h" 10 : #include "TransportInst.h" 11 : 12 : OPENDDS_BEGIN_VERSIONED_NAMESPACE_DECL 13 : 14 : namespace OpenDDS { 15 : namespace DCPS { 16 : 17 : #if !defined _MSC_VER || _MSC_VER >= 1900 18 : const unsigned long TransportConfig::DEFAULT_PASSIVE_CONNECT_DURATION; 19 : #endif 20 : 21 9 : TransportConfig::TransportConfig(const OPENDDS_STRING& name) 22 9 : : swap_bytes_(false) 23 9 : , passive_connect_duration_(DEFAULT_PASSIVE_CONNECT_DURATION) 24 9 : , name_(name) 25 9 : {} 26 : 27 18 : TransportConfig::~TransportConfig() 28 18 : {} 29 : 30 : void 31 0 : TransportConfig::sorted_insert(const TransportInst_rch& inst) 32 : { 33 0 : const OPENDDS_STRING name = inst->name(); 34 0 : InstancesType::iterator it = instances_.begin(); 35 0 : while (it != instances_.end() && (*it)->name() < name) { 36 0 : ++it; 37 : } 38 0 : instances_.insert(it, inst); 39 0 : } 40 : 41 : void 42 0 : TransportConfig::populate_locators(TransportLocatorSeq& trans_info) const 43 : { 44 0 : for (InstancesType::const_iterator pos = instances_.begin(), limit = instances_.end(); 45 0 : pos != limit; 46 0 : ++pos) { 47 0 : const CORBA::ULong idx = DCPS::grow(trans_info) - 1; 48 0 : if ((*pos)->populate_locator(trans_info[idx], CONNINFO_ALL) == 0) { 49 0 : trans_info.length(idx); 50 : } 51 : } 52 0 : } 53 : 54 : } 55 : } 56 : 57 : OPENDDS_END_VERSIONED_NAMESPACE_DECL