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