OpenDDS  Snapshot(2023/04/28-20:55)
TransportConfig.cpp
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 "DCPS/DdsDcps_pch.h" //Only the _pch include should start with DCPS/
9 #include "TransportConfig.h"
10 #include "TransportInst.h"
11 
13 
14 namespace OpenDDS {
15 namespace DCPS {
16 
17 #if !defined _MSC_VER || _MSC_VER >= 1900
19 #endif
20 
22  : swap_bytes_(false)
23  , passive_connect_duration_(DEFAULT_PASSIVE_CONNECT_DURATION)
24  , name_(name)
25 {}
26 
28 {}
29 
30 void
32 {
33  const OPENDDS_STRING name = inst->name();
34  InstancesType::iterator it = instances_.begin();
35  while (it != instances_.end() && (*it)->name() < name) {
36  ++it;
37  }
38  instances_.insert(it, inst);
39 }
40 
41 void
43 {
44  for (InstancesType::const_iterator pos = instances_.begin(), limit = instances_.end();
45  pos != limit;
46  ++pos) {
47  const CORBA::ULong idx = DCPS::grow(trans_info) - 1;
48  if ((*pos)->populate_locator(trans_info[idx], CONNINFO_ALL) == 0) {
49  trans_info.length(idx);
50  }
51  }
52 }
53 
54 }
55 }
56 
const OPENDDS_STRING & name() const
Definition: TransportInst.h:70
static const ConnectionInfoFlags CONNINFO_ALL
sequence< TransportLocator > TransportLocatorSeq
#define OPENDDS_STRING
ACE_CDR::ULong ULong
void populate_locators(OpenDDS::DCPS::TransportLocatorSeq &trans_info) const
Seq::size_type grow(Seq &seq)
Definition: Util.h:151
OPENDDS_STRING name() const
const char *const name
Definition: debug.cpp:60
static const unsigned long DEFAULT_PASSIVE_CONNECT_DURATION
void sorted_insert(const TransportInst_rch &inst)
#define OPENDDS_END_VERSIONED_NAMESPACE_DECL
TransportConfig(const OPENDDS_STRING &name)
The Internal API and Implementation of OpenDDS.
Definition: AddressCache.h:28