-
Notifications
You must be signed in to change notification settings - Fork 3
/
CSeq.hpp
52 lines (44 loc) · 1.19 KB
/
CSeq.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#ifndef CSEQ_HPP
#define CSEQ_HPP
#include <stdexcept>
#include "SipHeaderValue.hpp"
#include "SipRequest.hpp"
using std::runtime_error;
namespace Sip {
/**
* * \class CSeqException
* * \brief standard exception class for CSeq
* */
class CSeqException : public runtime_error
{
public:
CSeqException ( std::string what ) throw() : runtime_error ( what ) {};
};
/**
* \class CSeq
* \brief Creates a usable CSeq object from a generic SipHeaderValue
* \sa SipHeaderValue
*/
class CSeq
{
public:
/**
* Parse a CSeq
* @param srhv The value to parse into a CSeq
*/
CSeq ( const SipHeaderValue& srhv ) throw ( CSeqException );
CSeq ( int sequence, SipRequest::REQUEST_METHOD rm ) throw( CSeqException );
CSeq ();
string ToString() const throw();
int Sequence() const throw();
SipRequest::REQUEST_METHOD RequestMethod() const throw();
string RequestMethodAsString() const throw();
CSeq& Increment() throw();
protected:
void ParseCSeq ( const string& rawValue ) throw ( CSeqException );
SipRequest::REQUEST_METHOD m_requestMethod;
int m_sequence;
string m_requestMethodString;
}; //class CSeq
}; //namespace Sip
#endif //CSEQ_HPP