forked from cpp-netlib/cpp-netlib
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtransformers.hpp
53 lines (42 loc) · 1.68 KB
/
transformers.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
// Copyright Dean Michael Berris 2007.
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
#ifndef __NETWORK_MESSAGE_TRANSFORMERS_HPP__
#define __NETWORK_MESSAGE_TRANSFORMERS_HPP__
/** transformers.hpp
*
* Pulls in all the transformers files.
*/
#include <boost/network/message/transformers/selectors.hpp>
#include <boost/network/message/transformers/to_upper.hpp>
#include <boost/network/message/transformers/to_lower.hpp>
#include <boost/type_traits.hpp>
namespace boost {
namespace network {
namespace impl {
template <class Algorithm, class Selector>
struct get_real_algorithm {
typedef typename boost::function_traits<
typename boost::remove_pointer<Algorithm>::type>::result_type::
template type<typename boost::function_traits<
typename boost::remove_pointer<Selector>::type>::result_type> type;
};
template <class Algorithm, class Selector>
struct transform_impl : public get_real_algorithm<Algorithm, Selector>::type {};
} // namespace impl
template <class Algorithm, class Selector>
inline impl::transform_impl<Algorithm, Selector> transform(Algorithm /*unused*/ /*unused*/,
Selector /*unused*/ /*unused*/) {
return impl::transform_impl<Algorithm, Selector>();
}
template <class Tag, class Algorithm, class Selector>
inline basic_message<Tag>& operator<<(
basic_message<Tag>& msg_,
impl::transform_impl<Algorithm, Selector> const& transformer) {
transformer(msg_);
return msg_;
}
} // namespace network
} // namespace boost
#endif // __NETWORK_MESSAGE_TRANSFORMERS_HPP__