reSIProcate
SIP stack, Dialog Usage Manager and related libraries
Loading...
Searching...
No Matches
Aor.hxx
Go to the documentation of this file.
1#if !defined(RESIP_AOR_HXX)
2#define RESIP_AOR_HXX
3
4#include <iosfwd>
5#include "rutil/Data.hxx"
6
7namespace resip
8{
9
10class Uri;
11
12class Aor
13{
14 public:
15 explicit Aor(const Data& value);
16 Aor();
17 Aor(const Uri& uri);
18 Aor(const Aor& aor);
19 Aor& operator=(const Aor& aor);
20
21 bool operator==(const Aor& other) const;
22 bool operator!=(const Aor& other) const;
23 bool operator<(const Aor& other) const;
24
25 const Data& value() const;
26
27 Data& scheme();
28 const Data& scheme() const;
29
30 Data& host();
31 const Data& host() const;
32
33 Data& user();
34 const Data& user() const;
35
36 int& port();
37 int port() const;
38
40
41 private:
42 // Owns a copy of the string passed to Aor(const Data&): mScheme/
43 // mUser/mHost below are overlays (non-owning views, set via
44 // ParseBuffer::data()) into whatever buffer gets parsed, so it must
45 // be this member -- which lives as long as the Aor -- and not the
46 // constructor's `value` argument directly, which may be a temporary
47 // (e.g. Aor aor("sip:...")) destroyed right after the constructor
48 // returns, leaving those views dangling.
49 Data mOwnedBuffer;
50
51 mutable Data mValue;
52
53 mutable Data mOldScheme;
54 mutable Data mOldUser;
55 mutable Data mOldHost;
56 mutable int mOldPort = 0;
57
58 // cache for IPV6 host comparison
59 mutable Data mCanonicalHost;
60
61 Data mScheme;
62 Data mUser;
63 Data mHost;
64 int mPort = 0;
65};
66
67}
68
69#endif
70
71/* ====================================================================
72 * The Vovida Software License, Version 1.0
73 *
74 * Copyright (c) 2000-2005 Vovida Networks, Inc. All rights reserved.
75 *
76 * Redistribution and use in source and binary forms, with or without
77 * modification, are permitted provided that the following conditions
78 * are met:
79 *
80 * 1. Redistributions of source code must retain the above copyright
81 * notice, this list of conditions and the following disclaimer.
82 *
83 * 2. Redistributions in binary form must reproduce the above copyright
84 * notice, this list of conditions and the following disclaimer in
85 * the documentation and/or other materials provided with the
86 * distribution.
87 *
88 * 3. The names "VOCAL", "Vovida Open Communication Application Library",
89 * and "Vovida Open Communication Application Library (VOCAL)" must
90 * not be used to endorse or promote products derived from this
91 * software without prior written permission. For written
92 * permission, please contact vocal@vovida.org.
93 *
94 * 4. Products derived from this software may not be called "VOCAL", nor
95 * may "VOCAL" appear in their name, without prior written
96 * permission of Vovida Networks, Inc.
97 *
98 * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED
99 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
100 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND
101 * NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL VOVIDA
102 * NETWORKS, INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT DAMAGES
103 * IN EXCESS OF $1,000, NOR FOR ANY INDIRECT, INCIDENTAL, SPECIAL,
104 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
105 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
106 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
107 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
108 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
109 * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
110 * DAMAGE.
111 *
112 * ====================================================================
113 *
114 * This software consists of voluntary contributions made by Vovida
115 * Networks, Inc. and many individuals on behalf of Vovida Networks,
116 * Inc. For more information on Vovida Networks, Inc., please see
117 * <http://www.vovida.org/>.
118 *
119 */
bool operator!=(const Aor &other) const
Definition Aor.cxx:135
EncodeStream & operator<<(EncodeStream &str) const
Definition Aor.cxx:240
Data & user()
Definition Aor.cxx:216
Data & host()
Definition Aor.cxx:204
const Data & value() const
Definition Aor.cxx:147
Aor & operator=(const Aor &aor)
Definition Aor.cxx:115
int & port()
Definition Aor.cxx:228
Data & scheme()
Definition Aor.cxx:192
bool operator==(const Aor &other) const
Definition Aor.cxx:129
bool operator<(const Aor &other) const
Definition Aor.cxx:141
An alternative to std::string, encapsulates an arbitrary buffer of bytes.
Definition Data.hxx:90
Represents the "SIP-URI" and "SIPS-URI" elements in the RFC 3261 grammar.
Definition Uri.hxx:22
dcm! – add UnusedChecking(_enum) below;
#define EncodeStream