TransportConfig.cpp

Go to the documentation of this file.
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 #if !defined (__ACE_INLINE__)
00013 # include "TransportConfig.inl"
00014 #endif /* !__ACE_INLINE__ */
00015 
00016 namespace OpenDDS {
00017 namespace DCPS {
00018 
00019 TransportConfig::TransportConfig(const OPENDDS_STRING& name)
00020   : swap_bytes_(false)
00021   , passive_connect_duration_(DEFAULT_PASSIVE_CONNECT_DURATION)
00022   , name_(name)
00023 {}
00024 
00025 TransportConfig::~TransportConfig()
00026 {}
00027 
00028 void
00029 TransportConfig::sorted_insert(const TransportInst_rch& inst)
00030 {
00031   const OPENDDS_STRING name = inst->name();
00032   InstancesType::iterator it = instances_.begin();
00033   while (it != instances_.end() && (*it)->name() < name) {
00034     ++it;
00035   }
00036   instances_.insert(it, inst);
00037 }
00038 
00039 void
00040 TransportConfig::populate_locators(TransportLocatorSeq& trans_info) const
00041 {
00042   for (InstancesType::const_iterator pos = instances_.begin(), limit = instances_.end();
00043        pos != limit;
00044        ++pos) {
00045     const CORBA::ULong idx = trans_info.length();
00046     trans_info.length(idx + 1);
00047     if ((*pos)->populate_locator(trans_info[idx]) == 0) {
00048       trans_info.length(idx);
00049     }
00050   }
00051 }
00052 
00053 }
00054 }

Generated on Fri Feb 12 20:05:28 2016 for OpenDDS by  doxygen 1.4.7