reSIProcate
SIP stack, Dialog Usage Manager and related libraries
Loading...
Searching...
No Matches
TurnAllocationKey.cxx
Go to the documentation of this file.
2#include "StunTuple.hxx"
3
4using namespace std;
5
6namespace reTurn {
7
9 const StunTuple& clientRemoteTuple) :
10 mClientLocalTuple(clientLocalTuple),
11 mClientRemoteTuple(clientRemoteTuple)
12{
13}
14
15bool
17{
18 return mClientLocalTuple == rhs.mClientLocalTuple && mClientRemoteTuple == rhs.mClientRemoteTuple;
19}
20
21bool
23{
24 return mClientLocalTuple != rhs.mClientLocalTuple || mClientRemoteTuple != rhs.mClientRemoteTuple;
25}
26
27bool
29{
30 if (mClientLocalTuple < rhs.mClientLocalTuple)
31 {
32 return true;
33 }
34 if (mClientLocalTuple == rhs.mClientLocalTuple)
35 {
36 return mClientRemoteTuple < rhs.mClientRemoteTuple;
37 }
38 return false;
39}
40
41
42} // namespace
43
44
45/* ====================================================================
46
47 Copyright (c) 2007-2008, Plantronics, Inc.
48 All rights reserved.
49
50 Redistribution and use in source and binary forms, with or without
51 modification, are permitted provided that the following conditions are
52 met:
53
54 1. Redistributions of source code must retain the above copyright
55 notice, this list of conditions and the following disclaimer.
56
57 2. Redistributions in binary form must reproduce the above copyright
58 notice, this list of conditions and the following disclaimer in the
59 documentation and/or other materials provided with the distribution.
60
61 3. Neither the name of Plantronics nor the names of its contributors
62 may be used to endorse or promote products derived from this
63 software without specific prior written permission.
64
65 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
66 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
67 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
68 A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
69 OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
70 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
71 LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
72 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
73 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
74 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
75 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
76
77 ==================================================================== */
bool operator<(const TurnAllocationKey &rhs) const
bool operator!=(const TurnAllocationKey &rhs) const
bool operator==(const TurnAllocationKey &rhs) const
TurnAllocationKey(const StunTuple &clientLocalTuple, const StunTuple &clientRemoteTuple)