File tree 5 files changed +62
-22
lines changed
5 files changed +62
-22
lines changed Original file line number Diff line number Diff line change 24
24
// include wrappers base
25
25
#include < boost/network/detail/wrapper_base.hpp>
26
26
27
+ #include < boost/network/message/message_concept.hpp>
28
+
27
29
/* * message.hpp
28
30
*
29
31
* This header file implements the common message type which
@@ -98,8 +100,10 @@ namespace boost { namespace network {
98
100
left.swap (right);
99
101
}
100
102
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> >));
102
105
106
+ } // namespace network
103
107
} // namespace boost
104
108
105
109
#include < boost/network/message/directives.hpp>
Original file line number Diff line number Diff line change
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__
Original file line number Diff line number Diff line change 8
8
9
9
[section:message_concept Message Concept]
10
10
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
-
20
11
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__.
22
14
23
15
[variablelist Notation
24
16
[[`M`] [A Message Type.]]
Original file line number Diff line number Diff line change 35
35
[def __mozilla_netlib__ [@http://www.mozilla.org/projects/netlib/ mozilla-netlib]]
36
36
[def __sf_cpp_netlib__ [@http://sourceforge.net/projects/cpp-netlib/ sourceforge]]
37
37
[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]]
38
42
39
43
40
44
[def __quick_start__ quick start]
Original file line number Diff line number Diff line change 8
8
9
9
[section:uri_concept URI Concepts]
10
10
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
-
19
11
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__.
23
14
24
15
[variablelist Notation
25
16
[[`U`] [A URI Type.]]
You can’t perform that action at this time.
0 commit comments