OpenDDS  Snapshot(2023/04/28-20:55)
BundlingCacheKey.h
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 #ifndef OPENDDS_DCPS_TRANSPORT_RTPS_UDP_BUNDLINGCACHEKEY_H
9 #define OPENDDS_DCPS_TRANSPORT_RTPS_UDP_BUNDLINGCACHEKEY_H
10 
11 #include "Rtps_Udp_Export.h"
12 #include "ConstSharedRepoIdSet.h"
13 
14 #include "dds/DCPS/GuidConverter.h"
15 #include "dds/DCPS/PoolAllocator.h"
16 #include "dds/DCPS/AddressCache.h"
17 #include "dds/DCPS/Hash.h"
18 
19 #if defined ACE_HAS_CPP11
20 #include <functional>
21 #endif
22 
24 
25 namespace OpenDDS {
26 namespace DCPS {
27 
28 #pragma pack(push, 1)
29 
31  BundlingCacheKey(const GUID_t& dst_guid, const GUID_t& src_guid)
32  : src_guid_(src_guid)
33  , dst_guid_(dst_guid)
34  {
35  }
36 
38  : src_guid_(val.src_guid_)
39  , dst_guid_(val.dst_guid_)
40  {
41  }
42 
43  bool operator<(const BundlingCacheKey& rhs) const
44  {
45  return std::memcmp(static_cast<const void*>(this), static_cast<const void*>(&rhs), sizeof (BundlingCacheKey)) < 0;
46  }
47 
48  bool operator==(const BundlingCacheKey& rhs) const
49  {
50  return std::memcmp(static_cast<const void*>(this), static_cast<const void*>(&rhs), sizeof (BundlingCacheKey)) == 0;
51  }
52 
53  void get_contained_guids(GuidSet& set) const
54  {
55  set.clear();
56  set.insert(src_guid_);
57  set.insert(dst_guid_);
58  }
59 
62 };
63 
64 #pragma pack(pop)
65 
66 } // namespace DCPS
67 } // namespace OpenDDS
68 
70 
71 #if defined ACE_HAS_CPP11
73 #endif
74 
75 #endif /* OPENDDS_DCPS_TRANSPORT_RTPS_UDP_BUNDLINGCACHEKEY_H */
void get_contained_guids(GuidSet &set) const
BundlingCacheKey(const BundlingCacheKey &val)
bool operator<(const BundlingCacheKey &rhs) const
#define OPENDDS_END_VERSIONED_NAMESPACE_DECL
The Internal API and Implementation of OpenDDS.
Definition: AddressCache.h:28
BundlingCacheKey(const GUID_t &dst_guid, const GUID_t &src_guid)
bool operator==(const BundlingCacheKey &rhs) const
#define OpenDDS_Rtps_Udp_Export