2 * Copyright (c) 2008, 2009 by Vinzenz Feenstra
5 * - Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
8 * - Redistributions of source code must retain the above copyright notice, this
9 * list of conditions and the following disclaimer.
10 * - Neither the name of the Vinzenz Feenstra nor the names
11 * of its contributors may be used to endorse or promote products derived from
12 * this software without specific prior written permission.
14 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
15 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
18 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
19 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
20 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
21 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
22 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
23 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
24 * POSSIBILITY OF SUCH DAMAGE.
26 #ifndef GUARD_NET_BASIC_MESSAGE_HPP_INCLUDED
27 #define GUARD_NET_BASIC_MESSAGE_HPP_INCLUDED
29 #include <net/detail/traits.hpp>
33 template<typename Tag
>
36 typedef typename header_collection_traits
<Tag
>::type headers_type
;
37 typedef typename string_traits
<Tag
>::type string_type
;
39 headers_type headers_
;
54 basic_message(basic_message
const & other
)
55 : headers_(other
.headers_
)
57 , source_(other
.source_
)
58 , target_(other
.target_
)
67 basic_message
& operator=(basic_message other
)
73 void swap(basic_message
& other
)
75 std::swap(other
.headers_
, headers_
);
76 std::swap(other
.body_
, body_
);
77 std::swap(other
.source_
, source_
);
78 std::swap(other
.target_
, target_
);
81 headers_type
const & headers() const
86 headers_type
& headers()
96 string_type
const & body() const
101 string_type
const & source() const
106 string_type
& target()
111 string_type
const & target() const
119 #endif //GUARD_NET_HTTP_BASIC_MESSAGE_HPP_INCLUDED