/[resiprocate]/main/resip/dum/MergedRequestKey.cxx
ViewVC logotype

Annotation of /main/resip/dum/MergedRequestKey.cxx

Parent Directory Parent Directory | Revision Log Revision Log


Revision 5929 - (hide annotations) (download)
Thu Feb 16 22:36:43 2006 UTC (13 years, 10 months ago) by dworley
File size: 3920 byte(s)
Start cleaning up svn:eol-style and EOLs in files.
Note that text and program files that can be used on both Un*x and Windows
should have svn:eol-style=native so they check out correctly on both
platforms.

1 jason 5276 #include "resip/dum/MergedRequestKey.hxx"
2 derek 5283 #include "resip/stack/SipMessage.hxx"
3     #include "resip/stack/CSeqCategory.hxx"
4 jason 2879
5     using namespace resip;
6    
7     const MergedRequestKey MergedRequestKey::Empty;
8    
9     MergedRequestKey::MergedRequestKey()
10     {
11     }
12    
13     MergedRequestKey::MergedRequestKey(const SipMessage& req) :
14 derek 5762 // mRequestUri(Data::from(req.header(h_RequestLine).uri())),
15 jason 4010 mCSeq(Data::from(req.header(h_CSeq))),
16 derek 3295 mTag(req.header(h_From).exists(p_tag) ? req.header(h_From).param(p_tag) : Data::Empty),
17 jason 2879 mCallId(req.header(h_CallID).value())
18     {
19     }
20    
21     bool
22     MergedRequestKey::operator==(const MergedRequestKey& other) const
23     {
24     return (mCallId == other.mCallId &&
25     mTag == other.mTag &&
26 derek 5762 mCSeq == other.mCSeq
27     // && mRequestUri == other.mRequestUri
28     );
29 jason 2879 }
30    
31     bool
32     MergedRequestKey::operator!=(const MergedRequestKey& other) const
33     {
34     return !(*this == other);
35     }
36    
37     bool
38     MergedRequestKey::operator<(const MergedRequestKey& other) const
39     {
40     if ( mCallId < other.mCallId)
41     {
42     return true;
43     }
44     else if (mCallId > other.mCallId)
45     {
46     return false;
47     }
48    
49     if (mTag < other.mTag)
50     {
51     return true;
52     }
53     else if (mTag > other.mTag)
54     {
55     return false;
56     }
57    
58 derek 5762 return (mCSeq < other.mCSeq);
59     #if 0
60 jason 4010 if (mCSeq < other.mCSeq)
61 jason 2879 {
62     return true;
63     }
64 jason 4010 else if (mCSeq > other.mCSeq)
65 jason 2879 {
66     return false;
67     }
68    
69     return (mRequestUri < other.mRequestUri);
70 derek 5762 #endif
71 jason 2879 }
72    
73 jason 4010 Data& MergedRequestKey::cseq()
74     {
75     return mCSeq;
76     }
77    
78     const Data& MergedRequestKey::cseq() const
79     {
80     return mCSeq;
81     }
82    
83    
84     /* ====================================================================
85     * The Vovida Software License, Version 1.0
86     *
87     * Copyright (c) 2000 Vovida Networks, Inc. All rights reserved.
88     *
89     * Redistribution and use in source and binary forms, with or without
90     * modification, are permitted provided that the following conditions
91     * are met:
92     *
93     * 1. Redistributions of source code must retain the above copyright
94     * notice, this list of conditions and the following disclaimer.
95     *
96     * 2. Redistributions in binary form must reproduce the above copyright
97     * notice, this list of conditions and the following disclaimer in
98     * the documentation and/or other materials provided with the
99     * distribution.
100     *
101     * 3. The names "VOCAL", "Vovida Open Communication Application Library",
102     * and "Vovida Open Communication Application Library (VOCAL)" must
103     * not be used to endorse or promote products derived from this
104     * software without prior written permission. For written
105     * permission, please contact vocal@vovida.org.
106     *
107     * 4. Products derived from this software may not be called "VOCAL", nor
108     * may "VOCAL" appear in their name, without prior written
109     * permission of Vovida Networks, Inc.
110     *
111     * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED
112     * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
113     * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND
114     * NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL VOVIDA
115     * NETWORKS, INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT DAMAGES
116     * IN EXCESS OF $1,000, NOR FOR ANY INDIRECT, INCIDENTAL, SPECIAL,
117     * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
118     * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
119     * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
120     * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
121     * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
122     * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
123     * DAMAGE.
124     *
125     * ====================================================================
126     *
127     * This software consists of voluntary contributions made by Vovida
128     * Networks, Inc. and many individuals on behalf of Vovida Networks,
129     * Inc. For more information on Vovida Networks, Inc., please see
130     * <http://www.vovida.org/>.
131     *
132     */

Properties

Name Value
svn:eol-style native

webmaster AT resiprocate DOT org
ViewVC Help
Powered by ViewVC 1.1.27