You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: libs/network/doc/architecture.qbk
+2-2
Original file line number
Diff line number
Diff line change
@@ -9,9 +9,9 @@
9
9
[section:architecture Architecture]
10
10
__cnl__ is built upon __boost_asio__, a high-quality, portable asynchronous I/O library that provides a solid interface for C++ network programming.
11
11
12
-
The architecture is driven by the requirement to separate requests from the transport mechanism. Additionally, it's possible to utilise templates and static mechanisms to make decisions at compile-time, resulting in more efficient and stable client code.
12
+
The architecture is driven by the requirement to separate requests and responses from the transport mechanism. Additionally, it utilises generic programming techniques to make decisions at compile-time, resulting in more efficient and stable client code.
13
13
14
-
There are two main features of the architecture which use modern C++ techniques to allow extensibility without comprimising efficiency: tags and directives. These underly the design of the message.
14
+
There are two main features of the architecture which use modern C++ techniques to allow extensibility without comprimising efficiency: tags and directives. It is these techniques that underpin the design of the message.
Copy file name to clipboardExpand all lines: libs/network/doc/http.qbk
+4-4
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
[/
2
-
(C) Copyright 2008, 2009 Glyn Matthews.
2
+
(C) Copyright 2008, 2009, 2010 Glyn Matthews.
3
3
Distributed under the Boost Software License, Version 1.0.
4
4
(See accompanying file LICENSE_1_0.txt or copy at
5
5
http://www.boost.org/LICENSE_1_0.txt).
@@ -42,7 +42,7 @@ Before walking through exactly what is happening in this example, the principle
42
42
typedef basic_request<tags::default_> request;
43
43
}}}
44
44
45
-
The [^request] encapsulates information about the request and the resource.
45
+
The [^request] encapsulates information about the request and the resource. It models the Message concept.
46
46
47
47
[heading HTTP Client]
48
48
@@ -60,7 +60,7 @@ The [^client] encapsulates the connection-mapping logic between the domain and t
60
60
typedef basic_response<tags::default_> response;
61
61
}}}
62
62
63
-
The [^response] encapsulates the data received from the server.
63
+
The [^response] encapsulates the data received from the server. It also models the Message concept.
64
64
65
65
[heading Walkthrough]
66
66
@@ -117,4 +117,4 @@ This argument enables the caching of resolved endpoints and prevents the client
117
117
[h5 [^http::client::follow_redirect(s)]]
118
118
[^http::client::follow_redirects] / [^http::client::follow_redirect] follow HTTP redirect(s) (300..307) by looking at the "Location" header provided by the response(s); headers present in the original request are preserved in the subsequent request(s).
Distributed under the Boost Software License, Version 1.0.
4
4
(See accompanying file LICENSE_1_0.txt or copy at
5
5
http://www.boost.org/LICENSE_1_0.txt).
@@ -9,14 +9,11 @@
9
9
[section:intro Introduction]
10
10
11
11
[section:motivation Motivation]
12
-
Modern applications that communicate with the web have never been more prevalent, through a range of diverse areas from high performance servers to embedded systems such as smart phones or navigation systems. Such applications often have high performance or small memory footprint requirements for which C++ is the best language option. Currently, there are no network libraries available that use modern object-oriented techniques in C++. __libcurl__ and __mozilla_netlib__ are two widely used libraries in this domain but there are drawbacks to both:
12
+
Modern applications that communicate over the internet have never been more prevalent, ranging through diverse areas such as high performance servers to embedded systems for smart phones or navigation systems.
13
13
14
-
* __libcurl__ suffers from poor design and inconsistent behavior in a threaded environment
15
-
* __mozilla_netlib__ is too heavily coupled within the Mozilla architecture for practical use as a separate component
14
+
Currently, there are no open source network libraries available that use modern object-oriented techniques in C++. With the introduction of __boost_asio__, developing portable network C++ applications has become a very much easier task. What is still lacking is a set of libraries that utilise __boost_asio__ in order to provide application level support so that C++ developers are able to develop internet and distributed applications more effectively.
16
15
17
-
With the development of __boost_asio__, developing portable network C++ applications has become a very much easier task. What is still lacking is a set of libraries that utilise __boost_asio__ in order to provide application level support so that C++ developers are able to develop internet and distributed applications more effectively.
18
-
19
-
[endsect]
16
+
[endsect] [/motivation]
20
17
21
18
[section:objectives Objectives]
22
19
The objectives of the __cnl__ are to:
@@ -31,6 +28,11 @@ While many languages provide direct library support for high level network progr
31
28
32
29
Eventually, __cnl__ will be extended to support many of the application layer protocols such as SMTP, FTP, SOAP, XMPP etc.
33
30
34
-
[endsect]
31
+
[endsect] [/objectives]
32
+
33
+
[section:history History]
34
+
The __cnl__ was founded by Dean Michael Berris in 2007. Initially it consisted of a message template and an HTTP client. It found a home on [[http://sourceforge.net/projects/cpp-netlib/][sourceforge]] but was recently migrated to [[http://github.com/mikhailberis/cpp-netlib][github]] where development is actively continued by a committed community.
Copy file name to clipboardExpand all lines: libs/network/doc/message.qbk
+45-10
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
[/
2
-
(C) Copyright 2008, 2009 Glyn Matthews.
2
+
(C) Copyright 2008, 2009, 2010 Glyn Matthews.
3
3
Distributed under the Boost Software License, Version 1.0.
4
4
(See accompanying file LICENSE_1_0.txt or copy at
5
5
http://www.boost.org/LICENSE_1_0.txt).
@@ -33,13 +33,16 @@ The __cnl__ uses tag dispatching to specialize the message interface at compile
33
33
34
34
namespace boost {
35
35
namespace network {
36
-
typedef void tag_specialization_is_not_provided;
36
+
template <
37
+
class Tag
38
+
>
39
+
class unsupported_tag;
37
40
38
41
template <
39
42
class Tag
40
43
>
41
44
struct string {
42
-
typedef tag_specialization_is_not_provided type;
45
+
typedef unsupported_tag<Tag> type;
43
46
};
44
47
45
48
namespace tags {
@@ -61,24 +64,56 @@ This technique is extended to two more metafunctions that are used by __message_
61
64
class Tag
62
65
>
63
66
struct ostringstream {
64
-
typedef tag_specialization_is_not_provided type;
67
+
typedef unsupported_tag<Tag> type;
65
68
};
66
69
67
70
template <
68
71
class Tag
69
72
>
70
73
struct headers_container {
71
-
typedef tag_specialization_is_not_provided type;
74
+
typedef unsupported_tag<Tag> type;
72
75
};
73
76
} // namespace network
74
77
} // namespace boost
75
78
76
-
[endsect]
79
+
[endsect] [/tag_dispatching]
77
80
78
81
[section:message_concepts Concepts]
79
82
__message__ is [@http://www.boost.org/doc/html/DefaultConstructible.html DefaultConstructible], [@http://www.boost.org/doc/html/CopyConstructible.html CopyConstructible] and [@http://www.boost.org/doc/html/Assignable.html Assignable].
80
83
81
-
[endsect]
84
+
[section:message_concept Message]
85
+
86
+
[heading Description]
87
+
88
+
A type models the URI Concept if the type adheres to the following
89
+
usage semantics, and is DefaultConstructible and EqualityComparable.
90
+
91
+
[variablelist Notation
92
+
[[`M`] [A Message Type.]]
93
+
[[`m`, `m_`] [A Message Type instance.]]
94
+
[[`S`] [A String Type.]]
95
+
[[`s`] [A String Type instance.]]
96
+
[[`O`] [An Ostringstream Type.]]
97
+
[[`o`] [An Ostringstream Type instance.]]
98
+
[[`C`] [A Header Container Type.]]
99
+
[[`c`] [A Header Container Type instance.]]
100
+
]
101
+
102
+
[heading Valid Expressions]
103
+
104
+
[table
105
+
[[Expression] [Return Type] [Description]]
106
+
[[`M m_(m);`] [] [M must be Copy constructible.]]
107
+
[[`M m_; m_ = m;`] [] [M must be Assignable.]]
108
+
[[`swap(m, m_);`] [void] [Swap should be availabe via ADL.]]
109
+
[[`M::string_type`] [S] [M should have a nested type `string_type` of type `S`.]]
110
+
[[`M::headers_container_type`] [C] [M should have a nested type `headers_container_type` of type `C`.]]
The transformation layer defines the algorithms that can be applied on messages to transform parts or whole messages into different forms or representations. Transformations should apply to any type that models the Message concept. Functions in the transform layer take the form:
@@ -88,7 +123,7 @@ The transformation layer defines the algorithms that can be applied on messages
The rendering layer defines the algorithms used to render a message into different formats or types. Rendering functions should apply to any type that models the Message Concept. Functions in the rendering layer take the form:
@@ -98,6 +133,6 @@ The rendering layer defines the algorithms used to render a message into differe
0 commit comments