OpenDDS  Snapshot(2023/04/28-20:55)
PriorityKey.inl
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 
9 
10 namespace OpenDDS {
11 namespace DCPS {
12 
15  : priority_(0), is_loopback_(false), is_active_(false)
16 {
17 }
18 
21  : priority_(priority), address_(address), is_loopback_(is_loopback), is_active_(active)
22 {
23 }
24 
26 bool
28 {
29  return (this->address_ < rhs.address_)? true:
30  (rhs.address_ < this->address_)? false:
31  this->priority_ < rhs.priority_? true:
32  (rhs.priority_ < this->priority_)? false :
33  (this->is_loopback_ != rhs.is_loopback_) ? rhs.is_loopback_ :
34  (this->is_active_ != rhs.is_active_) ? rhs.is_active_ :
35  false;
36 }
37 
39 bool
41 {
42  return (this->priority_ == rhs.priority_)
43  && (this->address_ == rhs.address_)
44  && (this->is_loopback_ == rhs.is_loopback_)
45  && (this->is_active_ == rhs.is_active_);
46 }
47 
49 unsigned long
51 {
52  return (this->priority_ << 16) + this->address_.hash() + this->is_loopback_
53  + this->is_active_;
54 }
55 
57 Priority&
59 {
60  return this->priority_;
61 }
62 
66 {
67  return this->priority_;
68 }
69 
73 {
74  return this->address_;
75 }
76 
80 {
81  return this->address_;
82 }
83 
84 
87 {
88  return this->is_loopback_;
89 }
90 
91 
94 {
95  return this->is_loopback_;
96 }
97 
98 
101 {
102  return this->is_active_;
103 }
104 
105 
108 {
109  return this->is_active_;
110 }
111 
112 }
113 }
114 
Encapsulate a priority value and internet address as a key.
Definition: PriorityKey.h:52
ACE_INET_Addr & address()
Definition: PriorityKey.inl:72
virtual u_long hash(void) const
bool operator<(const PriorityKey &rhs) const
Definition: PriorityKey.inl:27
unsigned long hash() const
Definition: PriorityKey.inl:50
ACE_CDR::Long Priority
#define OPENDDS_END_VERSIONED_NAMESPACE_DECL
bool operator==(const PriorityKey &rhs) const
Definition: PriorityKey.inl:40
#define ACE_INLINE
The Internal API and Implementation of OpenDDS.
Definition: AddressCache.h:28