Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitd318a5e

Browse files
author
mikhail_beris
committed
Adding missing implementation headers for source directives and wrappers.
1 parent73435ab commitd318a5e

File tree

2 files changed

+90
-0
lines changed

2 files changed

+90
-0
lines changed
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
2+
// Copyright Dean Michael Berris 2007.
3+
// Distributed under the Boost Software License, Version 1.0.
4+
// (See accompanying file LICENSE_1_0.txt or copy at
5+
// http://www.boost.org/LICENSE_1_0.txt)
6+
7+
#ifndef __NETWORK_MESSAGE_DIRECTIVES_SOURCE_HPP__
8+
#define__NETWORK_MESSAGE_DIRECTIVES_SOURCE_HPP__
9+
10+
/** header.hpp
11+
*
12+
* Defines the types involved and the semantics of adding
13+
* source information into message objects.
14+
*
15+
* WARNING: DO NOT INCLUDE THIS HEADER DIRECTLY. THIS REQUIRES
16+
* TYPES TO BE DEFINED FROM EARLIER FILES THAT INCLUDE THIS
17+
* HEADER.
18+
*/
19+
namespaceboost {namespacenetwork {
20+
21+
namespaceimpl {
22+
template<classTag>
23+
structsource_directive :publicdetail::directive_base<Tag> {
24+
typedef Tag tag;
25+
26+
explicitsource_directive ( std::stringconst & source)
27+
: _source(source)
28+
{ };
29+
30+
voidoperator() (basic_message<tag> & msg)const {
31+
msg.source() = _source;
32+
};
33+
34+
private:
35+
36+
mutable std::string _source;
37+
};
38+
}// namespace impl
39+
40+
inline impl::source_directive<tags::default_>
41+
source(std::stringconst & source_) {
42+
return impl::source_directive<tags::default_>(source_);
43+
};
44+
45+
};// namespace network
46+
47+
};// namespace boost
48+
49+
#endif// __NETWORK_MESSAGE_DIRECTIVES_SOURCE_HPP__
50+
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
2+
// Copyright Dean Michael Berris 2007.
3+
// Distributed under the Boost Software License, Version 1.0.
4+
// (See accompanying file LICENSE_1_0.txt or copy at
5+
// http://www.boost.org/LICENSE_1_0.txt)
6+
7+
#ifndef __NETWORK_MESSAGE_WRAPPERS_SOURCE_HPP__
8+
#define__NETWORK_MESSAGE_WRAPPERS_SOURCE_HPP__
9+
10+
namespaceboost {namespacenetwork {
11+
12+
namespaceimpl {
13+
template<classTag>
14+
structsource_wrapper :publicdetail::wrapper_base<Tag> {
15+
typedef Tag tag;
16+
typedef basic_message<tag> message_type;
17+
18+
explicitsource_wrapper(basic_message<tag> & message_)
19+
: detail::wrapper_base<tag>(message_)
20+
{ };
21+
22+
operatorstd::string ()const {
23+
returnstd::string(detail::wrapper_base<tag>::_message.source());
24+
};
25+
};
26+
};// namespace impl
27+
28+
template<classTag>
29+
inline std::string
30+
source(basic_message<Tag> & message_) {
31+
return impl::source_wrapper<Tag>(message_);
32+
};
33+
34+
};// namespace network
35+
36+
};// namespace boost
37+
38+
#endif// __NETWORK_MESSAGE_WRAPPERS_SOURCE_HPP__
39+
40+

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp