Chris@16
|
1 /*
|
Chris@101
|
2 * Copyright Andrey Semashev 2007 - 2015.
|
Chris@16
|
3 * Distributed under the Boost Software License, Version 1.0.
|
Chris@16
|
4 * (See accompanying file LICENSE_1_0.txt or copy at
|
Chris@16
|
5 * http://www.boost.org/LICENSE_1_0.txt)
|
Chris@16
|
6 */
|
Chris@16
|
7
|
Chris@16
|
8 template< BOOST_PP_ENUM_PARAMS(BOOST_PP_ITERATION(), typename ArgT) >
|
Chris@16
|
9 BOOST_FORCEINLINE format_named_scope_actor<
|
Chris@16
|
10 fallback_to_none,
|
Chris@16
|
11 typename boost::log::aux::deduce_char_type<
|
Chris@16
|
12 typename parameter::binding<
|
Chris@16
|
13 typename boost::log::aux::make_arg_list< BOOST_PP_ENUM_PARAMS(BOOST_PP_ITERATION(), ArgT) >::type,
|
Chris@16
|
14 keywords::tag::format,
|
Chris@16
|
15 void
|
Chris@16
|
16 >::type
|
Chris@16
|
17 >::type
|
Chris@16
|
18 > format_named_scope(attribute_name const& name, BOOST_PP_ENUM_BINARY_PARAMS(BOOST_PP_ITERATION(), ArgT, const& arg))
|
Chris@16
|
19 {
|
Chris@16
|
20 typedef typename boost::log::aux::deduce_char_type<
|
Chris@16
|
21 typename parameter::binding<
|
Chris@16
|
22 typename boost::log::aux::make_arg_list< BOOST_PP_ENUM_PARAMS(BOOST_PP_ITERATION(), ArgT) >::type,
|
Chris@16
|
23 keywords::tag::format,
|
Chris@16
|
24 void
|
Chris@16
|
25 >::type
|
Chris@16
|
26 >::type char_type;
|
Chris@16
|
27 return aux::format_named_scope< char_type, phoenix::actor >(name, fallback_to_none(), (BOOST_PP_ENUM_PARAMS(BOOST_PP_ITERATION(), arg)));
|
Chris@16
|
28 }
|
Chris@16
|
29
|
Chris@16
|
30 template< typename DescriptorT, template< typename > class ActorT, BOOST_PP_ENUM_PARAMS(BOOST_PP_ITERATION(), typename ArgT) >
|
Chris@16
|
31 BOOST_FORCEINLINE format_named_scope_actor<
|
Chris@16
|
32 fallback_to_none,
|
Chris@16
|
33 typename boost::log::aux::deduce_char_type<
|
Chris@16
|
34 typename parameter::binding<
|
Chris@16
|
35 typename boost::log::aux::make_arg_list< BOOST_PP_ENUM_PARAMS(BOOST_PP_ITERATION(), ArgT) >::type,
|
Chris@16
|
36 keywords::tag::format,
|
Chris@16
|
37 void
|
Chris@16
|
38 >::type
|
Chris@16
|
39 >::type,
|
Chris@16
|
40 ActorT
|
Chris@16
|
41 >
|
Chris@16
|
42 format_named_scope(attribute_keyword< DescriptorT, ActorT > const& keyword, BOOST_PP_ENUM_BINARY_PARAMS(BOOST_PP_ITERATION(), ArgT, const& arg))
|
Chris@16
|
43 {
|
Chris@16
|
44 BOOST_STATIC_ASSERT_MSG((is_same< typename DescriptorT::value_type, attributes::named_scope::value_type >::value),\
|
Chris@16
|
45 "Boost.Log: Named scope formatter only accepts attribute values of type attributes::named_scope::value_type.");
|
Chris@16
|
46
|
Chris@16
|
47 typedef typename boost::log::aux::deduce_char_type<
|
Chris@16
|
48 typename parameter::binding<
|
Chris@16
|
49 typename boost::log::aux::make_arg_list< BOOST_PP_ENUM_PARAMS(BOOST_PP_ITERATION(), ArgT) >::type,
|
Chris@16
|
50 keywords::tag::format,
|
Chris@16
|
51 void
|
Chris@16
|
52 >::type
|
Chris@16
|
53 >::type char_type;
|
Chris@16
|
54 return aux::format_named_scope< char_type, ActorT >(keyword.get_name(), fallback_to_none(), (BOOST_PP_ENUM_PARAMS(BOOST_PP_ITERATION(), arg)));
|
Chris@16
|
55 }
|
Chris@16
|
56
|
Chris@16
|
57 template< typename T, typename FallbackPolicyT, typename TagT, template< typename > class ActorT, BOOST_PP_ENUM_PARAMS(BOOST_PP_ITERATION(), typename ArgT) >
|
Chris@16
|
58 BOOST_FORCEINLINE format_named_scope_actor<
|
Chris@16
|
59 FallbackPolicyT,
|
Chris@16
|
60 typename boost::log::aux::deduce_char_type<
|
Chris@16
|
61 typename parameter::binding<
|
Chris@16
|
62 typename boost::log::aux::make_arg_list< BOOST_PP_ENUM_PARAMS(BOOST_PP_ITERATION(), ArgT) >::type,
|
Chris@16
|
63 keywords::tag::format,
|
Chris@16
|
64 void
|
Chris@16
|
65 >::type
|
Chris@16
|
66 >::type,
|
Chris@16
|
67 ActorT
|
Chris@16
|
68 >
|
Chris@16
|
69 format_named_scope(attribute_actor< T, FallbackPolicyT, TagT, ActorT > const& placeholder, BOOST_PP_ENUM_BINARY_PARAMS(BOOST_PP_ITERATION(), ArgT, const& arg))
|
Chris@16
|
70 {
|
Chris@16
|
71 BOOST_STATIC_ASSERT_MSG((is_same< T, attributes::named_scope::value_type >::value),\
|
Chris@16
|
72 "Boost.Log: Named scope formatter only accepts attribute values of type attributes::named_scope::value_type.");
|
Chris@16
|
73
|
Chris@16
|
74 typedef typename boost::log::aux::deduce_char_type<
|
Chris@16
|
75 typename parameter::binding<
|
Chris@16
|
76 typename boost::log::aux::make_arg_list< BOOST_PP_ENUM_PARAMS(BOOST_PP_ITERATION(), ArgT) >::type,
|
Chris@16
|
77 keywords::tag::format,
|
Chris@16
|
78 void
|
Chris@16
|
79 >::type
|
Chris@16
|
80 >::type char_type;
|
Chris@16
|
81 return aux::format_named_scope< char_type, ActorT >(placeholder.get_name(), placeholder.get_fallback_policy(), (BOOST_PP_ENUM_PARAMS(BOOST_PP_ITERATION(), arg)));
|
Chris@16
|
82 }
|