00001 /* 00002 * 00003 * 00004 * Distributed under the OpenDDS License. 00005 * See: http://www.opendds.org/license.html 00006 */ 00007 00008 #include "DCPS/DdsDcps_pch.h" //Only the _pch include should start with DCPS/ 00009 #include "TransportConfig.h" 00010 #include "TransportInst.h" 00011 00012 OPENDDS_BEGIN_VERSIONED_NAMESPACE_DECL 00013 00014 namespace OpenDDS { 00015 namespace DCPS { 00016 00017 TransportConfig::TransportConfig(const OPENDDS_STRING& name) 00018 : swap_bytes_(false) 00019 , passive_connect_duration_(DEFAULT_PASSIVE_CONNECT_DURATION) 00020 , name_(name) 00021 {} 00022 00023 TransportConfig::~TransportConfig() 00024 {} 00025 00026 void 00027 TransportConfig::sorted_insert(const TransportInst_rch& inst) 00028 { 00029 const OPENDDS_STRING name = inst->name(); 00030 InstancesType::iterator it = instances_.begin(); 00031 while (it != instances_.end() && (*it)->name() < name) { 00032 ++it; 00033 } 00034 instances_.insert(it, inst); 00035 } 00036 00037 void 00038 TransportConfig::populate_locators(TransportLocatorSeq& trans_info) const 00039 { 00040 for (InstancesType::const_iterator pos = instances_.begin(), limit = instances_.end(); 00041 pos != limit; 00042 ++pos) { 00043 const CORBA::ULong idx = trans_info.length(); 00044 trans_info.length(idx + 1); 00045 if ((*pos)->populate_locator(trans_info[idx]) == 0) { 00046 trans_info.length(idx); 00047 } 00048 } 00049 } 00050 00051 } 00052 } 00053 00054 OPENDDS_END_VERSIONED_NAMESPACE_DECL