Skip to content

Commit a167c8a

Browse files
glynosdeanberris
authored andcommitted
Updated concept documentation.
1 parent 4308537 commit a167c8a

File tree

5 files changed

+62
-22
lines changed

5 files changed

+62
-22
lines changed

boost/network/message.hpp

+5-1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424
// include wrappers base
2525
#include <boost/network/detail/wrapper_base.hpp>
2626

27+
#include <boost/network/message/message_concept.hpp>
28+
2729
/** message.hpp
2830
*
2931
* This header file implements the common message type which
@@ -98,8 +100,10 @@ namespace boost { namespace network {
98100
left.swap(right);
99101
}
100102

101-
} // namespace network
103+
BOOST_CONCEPT_ASSERT((Message<basic_message<boost::network::tags::default_string> >));
104+
BOOST_CONCEPT_ASSERT((Message<basic_message<boost::network::tags::default_wstring> >));
102105

106+
} // namespace network
103107
} // namespace boost
104108

105109
#include <boost/network/message/directives.hpp>
+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
// Copyright (c) Glyn Matthews 2010.
2+
// Distributed under the Boost Software License, Version 1.0.
3+
// (See accompanying file LICENSE_1_0.txt or copy at
4+
// http://www.boost.org/LICENSE_1_0.txt)
5+
6+
7+
#ifndef __BOOST_NETWORK_MESSAGE_MESSAGE_CONCEPT_INC__
8+
# define __BOOST_NETWORK_MESSAGE_MESSAGE_CONCEPT_INC__
9+
10+
11+
# include <boost/concept_check.hpp>
12+
13+
14+
namespace boost {
15+
namespace network {
16+
template <
17+
class M
18+
>
19+
struct Message
20+
: DefaultConstructible<M>,
21+
CopyConstructible<M>,
22+
Assignable<M> {
23+
typedef typename M::string_type string_type;
24+
typedef typename M::headers_container_type headers_container_type;
25+
26+
BOOST_CONCEPT_USAGE(Message) {
27+
M message_;
28+
swap(message, message_);
29+
30+
headers_container_type &headers_ = message.headers();
31+
string_type &body_ = message.body();
32+
string_type &source_ = message.source();
33+
string_type &destination_ = message.destination();
34+
35+
(void)headers_;
36+
(void)body_;
37+
(void)source_;
38+
(void)destination_;
39+
}
40+
41+
private:
42+
43+
M message;
44+
};
45+
} // namespace network
46+
} // namespace boost
47+
48+
49+
#endif // __BOOST_NETWORK_MESSAGE_MESSAGE_CONCEPT_INC__

libs/network/doc/message_concept.qbk

+2-10
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,9 @@
88

99
[section:message_concept Message Concept]
1010

11-
__message__ is
12-
[@http://www.boost.org/doc/html/DefaultConstructible.html
13-
DefaultConstructible],
14-
[@http://www.boost.org/doc/html/CopyConstructible.html
15-
CopyConstructible] and [@http://www.boost.org/doc/html/Assignable.html
16-
Assignable].
17-
18-
[heading Description]
19-
2011
A type models the Message Concept if the type adheres to the following
21-
usage semantics, and is DefaultConstructible and EqualityComparable.
12+
usage semantics, and is __default_constructible__,
13+
__copy_constructible__ and __assignable__.
2214

2315
[variablelist Notation
2416
[[`M`] [A Message Type.]]

libs/network/doc/network.qbk

+4
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@
3535
[def __mozilla_netlib__ [@http://www.mozilla.org/projects/netlib/ mozilla-netlib]]
3636
[def __sf_cpp_netlib__ [@http://sourceforge.net/projects/cpp-netlib/ sourceforge]]
3737
[def __github__ [@http://github.com/mikhailberis/cpp-netlib github]]
38+
[def __default_constructible__ [@http://www.boost.org/doc/html/DefaultConstructible.html DefaultConstructible]]
39+
[def __copy_constructible__ [@http://www.boost.org/doc/html/CopyConstructible.html CopyConstructible]]
40+
[def __assignable__ [@http://www.boost.org/doc/html/Assignable.html Assignable]]
41+
[def __equality_comparable__ [@http://www.boost.org/doc/html/Assignable.html Assignable]]
3842

3943

4044
[def __quick_start__ quick start]

libs/network/doc/uri_concept.qbk

+2-11
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,9 @@
88

99
[section:uri_concept URI Concepts]
1010

11-
This page describes the URI Concepts implemented within cpp-netlib.
12-
The following concepts are also implemented as Boost.Concept_check
13-
types enforced by the URI library.
14-
15-
URI Concepts are organized into a hierarchy of conepts.
16-
17-
[heading Description]
18-
1911
A type models the URI Concept if the type adheres to the following
20-
usage semantics, and is [@http://www.boost.org/doc/html/DefaultConstructible.html
21-
DefaultConstructible] and [@http://www.boost.org/doc/html/EqualityComparable.html
22-
EqualityComparable].
12+
usage semantics, and is __default_constructible__ and
13+
__equality_comparable__.
2314

2415
[variablelist Notation
2516
[[`U`] [A URI Type.]]

0 commit comments

Comments
 (0)