OpenDDS
Snapshot(2023/04/28-20:55)
dds
DCPS
transport
framework
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
8
OPENDDS_BEGIN_VERSIONED_NAMESPACE_DECL
9
10
namespace
OpenDDS
{
11
namespace
DCPS {
12
13
ACE_INLINE
14
PriorityKey::PriorityKey
()
15
: priority_(0), is_loopback_(false), is_active_(false)
16
{
17
}
18
19
ACE_INLINE
20
PriorityKey::PriorityKey
(
Priority
priority
,
ACE_INET_Addr
address
,
bool
is_loopback
,
bool
active)
21
:
priority_
(priority),
address_
(address),
is_loopback_
(is_loopback),
is_active_
(active)
22
{
23
}
24
25
ACE_INLINE
26
bool
27
PriorityKey::operator<
(
const
PriorityKey
& rhs)
const
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
38
ACE_INLINE
39
bool
40
PriorityKey::operator==
(
const
PriorityKey
& rhs)
const
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
48
ACE_INLINE
49
unsigned
long
50
PriorityKey::hash
()
const
51
{
52
return
(this->
priority_
<< 16) + this->
address_
.
hash
() + this->
is_loopback_
53
+ this->
is_active_
;
54
}
55
56
ACE_INLINE
57
Priority
&
58
PriorityKey::priority
()
59
{
60
return
this->
priority_
;
61
}
62
63
ACE_INLINE
64
Priority
65
PriorityKey::priority
()
const
66
{
67
return
this->
priority_
;
68
}
69
70
ACE_INLINE
71
ACE_INET_Addr
&
72
PriorityKey::address
()
73
{
74
return
this->
address_
;
75
}
76
77
ACE_INLINE
78
ACE_INET_Addr
79
PriorityKey::address
()
const
80
{
81
return
this->
address_
;
82
}
83
84
85
ACE_INLINE
86
bool
&
PriorityKey::is_loopback
()
87
{
88
return
this->
is_loopback_
;
89
}
90
91
92
ACE_INLINE
93
bool
PriorityKey::is_loopback
()
const
94
{
95
return
this->
is_loopback_
;
96
}
97
98
99
ACE_INLINE
100
bool
&
PriorityKey::is_active
()
101
{
102
return
this->
is_active_
;
103
}
104
105
106
ACE_INLINE
107
bool
PriorityKey::is_active
()
const
108
{
109
return
this->
is_active_
;
110
}
111
112
}
113
}
114
115
OPENDDS_END_VERSIONED_NAMESPACE_DECL
OpenDDS::DCPS::PriorityKey
Encapsulate a priority value and internet address as a key.
Definition:
PriorityKey.h:52
OpenDDS::DCPS::PriorityKey::priority
Priority & priority()
Definition:
PriorityKey.inl:58
OpenDDS::DCPS::PriorityKey::address_
ACE_INET_Addr address_
Definition:
PriorityKey.h:88
OpenDDS::DCPS::PriorityKey::address
ACE_INET_Addr & address()
Definition:
PriorityKey.inl:72
ACE_INET_Addr
OpenDDS::DCPS::PriorityKey::is_loopback
bool & is_loopback()
Definition:
PriorityKey.inl:86
ACE_INET_Addr::hash
virtual u_long hash(void) const
OpenDDS::DCPS::PriorityKey::operator<
bool operator<(const PriorityKey &rhs) const
Definition:
PriorityKey.inl:27
OpenDDS::DCPS::PriorityKey::priority_
Priority priority_
Definition:
PriorityKey.h:85
OpenDDS::DCPS::PriorityKey::hash
unsigned long hash() const
Definition:
PriorityKey.inl:50
OpenDDS::DCPS::PriorityKey::is_loopback_
bool is_loopback_
Definition:
PriorityKey.h:90
OpenDDS::DCPS::PriorityKey::PriorityKey
PriorityKey()
Definition:
PriorityKey.inl:14
OpenDDS::DCPS::PriorityKey::is_active
bool & is_active()
Definition:
PriorityKey.inl:100
OpenDDS::DCPS::PriorityKey::is_active_
bool is_active_
Definition:
PriorityKey.h:91
OpenDDS::DCPS::Priority
ACE_CDR::Long Priority
Definition:
TransportDefs.h:254
OPENDDS_END_VERSIONED_NAMESPACE_DECL
#define OPENDDS_END_VERSIONED_NAMESPACE_DECL
Definition:
Versioned_Namespace.h:48
OPENDDS_BEGIN_VERSIONED_NAMESPACE_DECL
Definition:
Hash.cpp:17
OpenDDS::DCPS::PriorityKey::operator==
bool operator==(const PriorityKey &rhs) const
Definition:
PriorityKey.inl:40
ACE_INLINE
#define ACE_INLINE
OpenDDS
The Internal API and Implementation of OpenDDS.
Definition:
AddressCache.h:28
Generated by
1.8.13