Menu

[r1]: / trunk / boost / network / message.hpp  Maximize  Restore  History

Download this file

70 lines (50 with data), 1.8 kB

 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
// Copyright Dean Michael Berris 2007.
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
#ifndef __NETWORK_MESSAGE_HPP__
#define __NETWORK_MESSAGE_HPP__
#include <map>
#include <string>
// forward declarations
namespace boost { namespace network {
template <class tag>
class basic_message;
}; // namespace network
}; // namespace boost
#include <boost/network/detail/directive_base.hpp>
#include <boost/network/detail/wrapper_base.hpp>
/** message.hpp
*
* This header file implements the common message type which
* all networking implementations under the boost::network
* namespace. The common message type allows for easy message
* construction and manipulation suited for networked
* application development.
*/
namespace boost { namespace network {
struct tags {
struct default_ { };
};
/** The common message type.
*/
template <class tag=tags::default_>
class basic_message {
public:
typedef std::multimap<std::string, std::string> headers_container_type;
headers_container_type & headers() const {
return _headers;
};
private:
friend struct detail::directive_base<tag> ;
friend struct detail::wrapper_base<tag> ;
mutable headers_container_type _headers;
};
typedef basic_message<> message; // default message type
}; // namespace network
}; // namespace boost
#include <boost/network/message/directives.hpp>
// pull in directives header file
#include <boost/network/message/wrappers.hpp>
// pull in wrappers header file
#endif // __NETWORK_MESSAGE_HPP__