reSIProcate
SIP stack, Dialog Usage Manager and related libraries
Loading...
Searching...
No Matches
TimerMessage.cxx
Go to the documentation of this file.
1#if defined(HAVE_CONFIG_H)
2#include "config.h"
3#endif
4
5#include "rutil/ResipAssert.h"
7
8using namespace resip;
9
10TimerMessage::TimerMessage(Data transactionId, Timer::Type type, unsigned long duration)
11 : mTransactionId(transactionId),
12 mType(type),
13 mDuration(duration) {}
14
15const Data&
17{
18 return mTransactionId;
19}
20
23{
24 return mType;
25}
26
27unsigned long
29{
30 return mDuration;
31}
32
35
36bool
38{
39 switch (mType)
40 {
41 case Timer::TimerA:
42 case Timer::TimerB:
43 case Timer::TimerD:
44 case Timer::TimerE1:
45 case Timer::TimerE2:
46 case Timer::TimerF:
47 case Timer::TimerK:
52 return true;
53
54 case Timer::TimerG:
55 case Timer::TimerH:
56 case Timer::TimerI:
57 case Timer::TimerJ:
60 return false;
61
62 case Timer::TimerC:
63 resip_assert(0);
64 break;
65
66 default:
67 resip_assert(0);
68 break;
69 }
70 resip_assert(0);
71 return false;
72}
73
74
75
77TimerMessage::encodeBrief(EncodeStream& str) const
78{
79 return str << "Timer: " << Timer::toData(mType) << " " << mDuration;
80}
81
82EncodeStream& TimerMessage::encode(EncodeStream& strm) const
83{
84 return strm << "TimerMessage TransactionId[" << mTransactionId << "] "
85 << " Type[" << Timer::toData(mType) << "]"
86 << " duration[" << mDuration << "]";
87}
88
89/* ====================================================================
90 * The Vovida Software License, Version 1.0
91 *
92 * Redistribution and use in source and binary forms, with or without
93 * modification, are permitted provided that the following conditions
94 * are met:
95 *
96 * 1. Redistributions of source code must retain the above copyright
97 * notice, this list of conditions and the following disclaimer.
98 *
99 * 2. Redistributions in binary form must reproduce the above copyright
100 * notice, this list of conditions and the following disclaimer in
101 * the documentation and/or other materials provided with the
102 * distribution.
103 *
104 * 3. The names "VOCAL", "Vovida Open Communication Application Library",
105 * and "Vovida Open Communication Application Library (VOCAL)" must
106 * not be used to endorse or promote products derived from this
107 * software without prior written permission. For written
108 * permission, please contact vocal@vovida.org.
109 *
110 * 4. Products derived from this software may not be called "VOCAL", nor
111 * may "VOCAL" appear in their name, without prior written
112 * permission of Vovida Networks, Inc.
113 *
114 * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED
115 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
116 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND
117 * NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL VOVIDA
118 * NETWORKS, INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT DAMAGES
119 * IN EXCESS OF $1,000, NOR FOR ANY INDIRECT, INCIDENTAL, SPECIAL,
120 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
121 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
122 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
123 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
124 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
125 * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
126 * DAMAGE.
127 *
128 * ====================================================================
129 *
130 * This software consists of voluntary contributions made by Vovida
131 * Networks, Inc. and many individuals on behalf of Vovida Networks,
132 * Inc. For more information on Vovida Networks, Inc., please see
133 * <http://www.vovida.org/>.
134 *
135 */
#define resip_assert(x)
This file needs to work for both C and C++ code.
An alternative to std::string, encapsulates an arbitrary buffer of bytes.
Definition Data.hxx:90
virtual EncodeStream & encode(EncodeStream &strm) const
output the entire message to stream
bool isClientTransaction() const
virtual const Data & getTransactionId() const
TimerMessage(Data transactionId, Timer::Type type, unsigned long duration)
unsigned long getDuration() const
Timer::Type getType() const
virtual EncodeStream & encodeBrief(EncodeStream &str) const
output a brief description to stream
static Data toData(Type timer)
Definition Timer.cxx:71
@ TimerStateless
Definition Timer.hxx:51
@ TimerStaleClient
Definition Timer.hxx:49
@ TcpConnectTimer
Definition Timer.hxx:54
@ TimerStaleServer
Definition Timer.hxx:50
dcm! – add UnusedChecking(_enum) below;
#define EncodeStream