MCPcopy Create free account
hub / github.com/OpenDDS/OpenDDS / tie_breaker

Function tie_breaker

dds/DCPS/NetworkResource.cpp:566–579  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

564
565template <typename T>
566ACE_INET_Addr tie_breaker(const T& addrs, const String& name)
567{
568 if (!name.empty()) {
569 for (typename T::const_iterator it = addrs.begin(); it != addrs.end(); ++it) {
570 if (name.compare(LogAddr::host(*it)) == 0) {
571 VDBG((LM_DEBUG, "(%P|%t) tie_breaker - Choosing Address %C\n",
572 LogAddr(*it, LogAddr::IpPortHost).c_str()));
573 return *it;
574 }
575 }
576 }
577 VDBG((LM_DEBUG, "(%P|%t) tie_breaker - Choosing Address %C\n", LogAddr(*(addrs.begin())).c_str()));
578 return *addrs.begin();
579}
580
581}
582

Callers 1

Calls 4

emptyMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
compareMethod · 0.45

Tested by

no test coverage detected