reSIProcate
SIP stack, Dialog Usage Manager and related libraries
Loading...
Searching...
No Matches
Message.hxx
Go to the documentation of this file.
1#ifndef RESIP_Message_hxx
2#define RESIP_Message_hxx
3
4#ifdef HAVE_CONFIG_H
5#include "config.h"
6#endif
7
8#include "rutil/Data.hxx"
9#include <iosfwd>
11
12namespace resip
13{
14class TransactionUser;
15
20class Message
21{
22 public:
23 Message();
24 virtual ~Message() {}
25
27 class Brief
28 {
29 public:
30 Brief(const Message& src);
32 };
33
35 virtual Brief brief() const;
36 virtual Message* clone() const = 0;
38 virtual EncodeStream& encode(EncodeStream& strm) const = 0;
40 virtual EncodeStream& encodeBrief(EncodeStream& str) const = 0;
41
42 protected:
43 friend class TuSelector;
45 friend class TransactionState;
46 friend class SipStack;
47 bool hasTransactionUser() const { return mTu != 0; }
51};
52
53//always need std streams where things are encoded to cout, cerr, DigestStream, etc...
54#ifndef RESIP_USE_STL_STREAMS
57
60#endif
61
62std::ostream&
63operator<<(std::ostream& strm, const Message& msg);
64
65std::ostream&
66operator<<(std::ostream& strm, const Message::Brief& brief);
67
68}
69
70#endif
71
72/* ====================================================================
73 * The Vovida Software License, Version 1.0
74 *
75 * Redistribution and use in source and binary forms, with or without
76 * modification, are permitted provided that the following conditions
77 * are met:
78 *
79 * 1. Redistributions of source code must retain the above copyright
80 * notice, this list of conditions and the following disclaimer.
81 *
82 * 2. Redistributions in binary form must reproduce the above copyright
83 * notice, this list of conditions and the following disclaimer in
84 * the documentation and/or other materials provided with the
85 * distribution.
86 *
87 * 3. The names "VOCAL", "Vovida Open Communication Application Library",
88 * and "Vovida Open Communication Application Library (VOCAL)" must
89 * not be used to endorse or promote products derived from this
90 * software without prior written permission. For written
91 * permission, please contact vocal@vovida.org.
92 *
93 * 4. Products derived from this software may not be called "VOCAL", nor
94 * may "VOCAL" appear in their name, without prior written
95 * permission of Vovida Networks, Inc.
96 *
97 * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED
98 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
99 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND
100 * NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL VOVIDA
101 * NETWORKS, INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT DAMAGES
102 * IN EXCESS OF $1,000, NOR FOR ANY INDIRECT, INCIDENTAL, SPECIAL,
103 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
104 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
105 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
106 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
107 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
108 * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
109 * DAMAGE.
110 *
111 * ====================================================================
112 *
113 * This software consists of voluntary contributions made by Vovida
114 * Networks, Inc. and many individuals on behalf of Vovida Networks,
115 * Inc. For more information on Vovida Networks, Inc., please see
116 * <http://www.vovida.org/>.
117 *
118 */
119
facet for brief output to streams
Definition Message.hxx:28
const Message & mSource
Definition Message.hxx:31
The base-class used for message-passing.
Definition Message.hxx:21
virtual Brief brief() const
return a facet for brief encoding of message
Definition Message.cxx:16
virtual EncodeStream & encodeBrief(EncodeStream &str) const =0
output a brief description to stream
virtual ~Message()
Definition Message.hxx:24
bool hasTransactionUser() const
Definition Message.hxx:47
virtual EncodeStream & encode(EncodeStream &strm) const =0
output the entire message to stream
TransactionUser * mTu
Definition Message.hxx:50
virtual Message * clone() const =0
TransactionUser * getTransactionUser()
Definition Message.hxx:49
void setTransactionUser(TransactionUser *t)
Definition Message.hxx:48
This is the primary point of interaction between the app-layer and the stack.
Definition SipStack.hxx:160
The base-class for an RFC 3261 Transaction User.
dcm! – add UnusedChecking(_enum) below;
EncodeStream & operator<<(EncodeStream &strm, const BaseException &e)
Replaces STL streams for general encoding purposes.
#define EncodeStream
void list()
Definition userAdmin.cxx:66