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

Class TestKey

tests/unit-tests/dds/DCPS/AddressCache.cpp:14–38  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

12using namespace OpenDDS::DCPS;
13
14struct TestKey {
15 TestKey(const GUID_t& from, const GUID_t& to) : from_(from), to_(to) {}
16 TestKey(const TestKey& val) : from_(val.from_), to_(val.to_) {}
17 bool operator<(const TestKey& rhs) const {
18 const int from_comp = std::memcmp(&from_, &rhs.from_, sizeof (GUID_t));
19 if (from_comp < 0) {
20 return true;
21 } else if (from_comp == 0) {
22 return std::memcmp(&to_, &rhs.to_, sizeof (GUID_t)) < 0;
23 }
24 return false;
25 }
26 bool operator==(const TestKey& rhs) const {
27 const int from_comp = std::memcmp(&from_, &rhs.from_, sizeof (GUID_t));
28 const int to_comp = std::memcmp(&to_, &rhs.to_, sizeof (GUID_t));
29 return from_comp == 0 && to_comp == 0;
30 }
31 void get_contained_guids(RepoIdSet& set) const {
32 set.clear();
33 set.insert(from_);
34 set.insert(to_);
35 }
36 GUID_t from_;
37 GUID_t to_;
38};
39
40#define NOOP
41

Callers 1

TESTFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected