Classes | |
class | ArgCopier |
Define an argument copying functor. More... | |
Functions | |
int | random_id () |
void | hash_endpoint (::CORBA::Long &hash, const char *const endpoint, const size_t len) |
void | hash_endpoints (::CORBA::Long &hash, const ACE_TCHAR *const endpoints_str) |
::CORBA::Long | hash_endpoints (int argc, ACE_TCHAR **argv) |
void | assign (Update::BinSeq &to, const Update::BinSeq &from, Update::PersistenceUpdater::ALLOCATOR *allocator) |
void | assign (ACE_CString &to, const char *from, Update::PersistenceUpdater::ALLOCATOR *allocator) |
Variables | |
const ACE_TCHAR | FEDERATION_DOMAIN_KEY [] = ACE_TEXT("FederationDomain") |
const ACE_TCHAR | FEDERATION_ID_KEY [] = ACE_TEXT("FederationId") |
const ACE_TCHAR | FEDERATION_PORT_KEY [] = ACE_TEXT("FederationPort") |
void OPENDDS_BEGIN_VERSIONED_NAMESPACE_DECL::assign | ( | ACE_CString & | to, | |
const char * | from, | |||
Update::PersistenceUpdater::ALLOCATOR * | allocator | |||
) |
Definition at line 39 of file PersistenceUpdater.cpp.
References len, ACE_Allocator_Adapter< class >::malloc(), ACE_OS::memcpy(), ACE_String_Base< ACE_CHAR_T >::set(), and ACE_OS::strlen().
00041 { 00042 const size_t len = ACE_OS::strlen (from) + 1; 00043 void* out_buf; 00044 ACE_ALLOCATOR(out_buf, allocator->malloc(len)); 00045 ACE_OS::memcpy(out_buf, from, len); 00046 to.set(static_cast<char*>(out_buf), len - 1, false); 00047 }
void OPENDDS_BEGIN_VERSIONED_NAMESPACE_DECL::assign | ( | Update::BinSeq & | to, | |
const Update::BinSeq & | from, | |||
Update::PersistenceUpdater::ALLOCATOR * | allocator | |||
) |
Definition at line 29 of file PersistenceUpdater.cpp.
References len, ACE_Allocator_Adapter< class >::malloc(), and ACE_OS::memcpy().
00031 { 00032 const size_t len = from.first; 00033 void* out_buf; 00034 ACE_ALLOCATOR(out_buf, allocator->malloc(len)); 00035 ACE_OS::memcpy(out_buf, from.second, len); 00036 to = std::make_pair(len, static_cast<char*>(out_buf)); 00037 }
void OPENDDS_BEGIN_VERSIONED_NAMESPACE_DECL::hash_endpoint | ( | ::CORBA::Long & | hash, | |
const char *const | endpoint, | |||
const size_t | len | |||
) |
Definition at line 121 of file FederatorConfig.cpp.
Referenced by hash_endpoints().
00122 { 00123 std::string toprint(endpoint, len); 00124 if (len > 0) 00125 { 00126 for (size_t i = 0; i < len; i++) 00127 { 00128 hash = 31 * hash + endpoint[i]; 00129 } 00130 } 00131 }
::CORBA::Long OPENDDS_BEGIN_VERSIONED_NAMESPACE_DECL::hash_endpoints | ( | int | argc, | |
ACE_TCHAR ** | argv | |||
) |
Definition at line 155 of file FederatorConfig.cpp.
References ACE_TEXT(), hash_endpoints(), random_id(), ACE_OS::strcasecmp(), ACE_OS::strlen(), and ACE_OS::strncasecmp().
00156 { 00157 ::CORBA::Long hash = 0; 00158 bool found = false; 00159 for (int i = 0; i < argc - 1; ++i) { 00160 if (ACE_OS::strncasecmp(argv[i], ACE_TEXT("-ORB"), ACE_OS::strlen(ACE_TEXT("-ORB"))) == 0 && 00161 (ACE_OS::strcasecmp(ACE_TEXT("-ORBEndpoint"), argv[i]) == 0 || 00162 ACE_OS::strcasecmp(ACE_TEXT("-ORBListenEndpoints"), argv[i]) == 0 || 00163 ACE_OS::strcasecmp(ACE_TEXT("-ORBLaneEndpoint"), argv[i]) == 0 || 00164 ACE_OS::strcasecmp(ACE_TEXT("-ORBLaneListenEndpoints"), argv[i]) == 0)) { 00165 const ACE_TCHAR* enpoints = argv[++i]; 00166 hash_endpoints(hash, enpoints); 00167 found = true; 00168 } 00169 } 00170 if (!found) { 00171 hash = random_id(); 00172 } 00173 return hash; 00174 }
void OPENDDS_BEGIN_VERSIONED_NAMESPACE_DECL::hash_endpoints | ( | ::CORBA::Long & | hash, | |
const ACE_TCHAR *const | endpoints_str | |||
) |
Definition at line 141 of file FederatorConfig.cpp.
References ACE_TEXT(), hash_endpoint(), ACE_OS::strlen(), and ACE_OS::strstr().
Referenced by hash_endpoints().
00142 { 00143 const ACE_TCHAR* delim = ACE_TEXT(";"); 00144 const size_t len = ACE_OS::strlen(endpoints_str); 00145 const ACE_TCHAR* curr = endpoints_str; 00146 while (curr < endpoints_str + len) { 00147 const ACE_TCHAR* next = ACE_OS::strstr(curr, delim); 00148 if (next == 0) 00149 next = endpoints_str + len; 00150 hash_endpoint(hash, curr, (next - curr)); 00151 curr = next + 1; 00152 } 00153 }
int OPENDDS_BEGIN_VERSIONED_NAMESPACE_DECL::random_id | ( | ) |
Definition at line 112 of file FederatorConfig.cpp.
References ACE_OS::gettimeofday(), ACE_Time_Value::msec(), ACE_OS::rand(), and ACE_OS::srand().
Referenced by hash_endpoints().
00113 { 00114 ACE_UINT64 msec; 00115 ACE_OS::gettimeofday().msec(msec); 00116 ACE_OS::srand((unsigned int)msec); 00117 const int r = ACE_OS::rand(); 00118 return r; 00119 }
const ACE_TCHAR OPENDDS_BEGIN_VERSIONED_NAMESPACE_DECL::FEDERATION_DOMAIN_KEY[] = ACE_TEXT("FederationDomain") |
Definition at line 31 of file FederatorConfig.cpp.
const ACE_TCHAR OPENDDS_BEGIN_VERSIONED_NAMESPACE_DECL::FEDERATION_ID_KEY[] = ACE_TEXT("FederationId") |
Definition at line 34 of file FederatorConfig.cpp.
const ACE_TCHAR OPENDDS_BEGIN_VERSIONED_NAMESPACE_DECL::FEDERATION_PORT_KEY[] = ACE_TEXT("FederationPort") |
Definition at line 37 of file FederatorConfig.cpp.