File indexing completed on 2025-01-18 09:39:23
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015 #ifndef BOOST_LOG_EXPRESSIONS_PREDICATES_IS_IN_RANGE_HPP_INCLUDED_
0016 #define BOOST_LOG_EXPRESSIONS_PREDICATES_IS_IN_RANGE_HPP_INCLUDED_
0017
0018 #include <utility>
0019 #include <boost/phoenix/core/actor.hpp>
0020 #include <boost/log/detail/config.hpp>
0021 #include <boost/log/detail/embedded_string_type.hpp>
0022 #include <boost/log/detail/unary_function_terminal.hpp>
0023 #include <boost/log/detail/attribute_predicate.hpp>
0024 #include <boost/log/expressions/attr_fwd.hpp>
0025 #include <boost/log/expressions/keyword_fwd.hpp>
0026 #include <boost/log/attributes/attribute_name.hpp>
0027 #include <boost/log/attributes/fallback_policy.hpp>
0028 #include <boost/log/utility/functional/in_range.hpp>
0029 #include <boost/log/detail/header.hpp>
0030
0031 #ifdef BOOST_HAS_PRAGMA_ONCE
0032 #pragma once
0033 #endif
0034
0035 namespace boost {
0036
0037 BOOST_LOG_OPEN_NAMESPACE
0038
0039 namespace expressions {
0040
0041
0042
0043
0044 #if !defined(BOOST_NO_CXX11_TEMPLATE_ALIASES)
0045
0046 template< typename T, typename BoundaryT, typename FallbackPolicyT = fallback_to_none >
0047 using attribute_is_in_range = aux::attribute_predicate< T, std::pair< BoundaryT, BoundaryT >, in_range_fun, FallbackPolicyT >;
0048
0049 #else
0050
0051 template< typename T, typename BoundaryT, typename FallbackPolicyT = fallback_to_none >
0052 class attribute_is_in_range :
0053 public aux::attribute_predicate< T, std::pair< BoundaryT, BoundaryT >, in_range_fun, FallbackPolicyT >
0054 {
0055 typedef aux::attribute_predicate< T, std::pair< BoundaryT, BoundaryT >, in_range_fun, FallbackPolicyT > base_type;
0056
0057 public:
0058
0059
0060
0061
0062
0063
0064 attribute_is_in_range(attribute_name const& name, std::pair< BoundaryT, BoundaryT > const& boundaries) : base_type(name, boundaries)
0065 {
0066 }
0067
0068
0069
0070
0071
0072
0073
0074
0075 template< typename U >
0076 attribute_is_in_range(attribute_name const& name, std::pair< BoundaryT, BoundaryT > const& boundaries, U const& arg) : base_type(name, boundaries, arg)
0077 {
0078 }
0079 };
0080
0081 #endif
0082
0083
0084
0085
0086
0087 template< typename T, typename FallbackPolicyT, typename TagT, template< typename > class ActorT, typename BoundaryT >
0088 BOOST_FORCEINLINE ActorT< aux::unary_function_terminal< attribute_is_in_range< T, typename boost::log::aux::make_embedded_string_type< BoundaryT >::type, FallbackPolicyT > > >
0089 is_in_range(attribute_actor< T, FallbackPolicyT, TagT, ActorT > const& attr, BoundaryT const& least, BoundaryT const& most)
0090 {
0091 typedef typename boost::log::aux::make_embedded_string_type< BoundaryT >::type boundary_type;
0092 typedef aux::unary_function_terminal< attribute_is_in_range< T, boundary_type, FallbackPolicyT > > terminal_type;
0093 ActorT< terminal_type > act = {{ terminal_type(attr.get_name(), std::pair< boundary_type, boundary_type >(least, most), attr.get_fallback_policy()) }};
0094 return act;
0095 }
0096
0097
0098
0099
0100
0101 template< typename DescriptorT, template< typename > class ActorT, typename BoundaryT >
0102 BOOST_FORCEINLINE ActorT< aux::unary_function_terminal< attribute_is_in_range< typename DescriptorT::value_type, typename boost::log::aux::make_embedded_string_type< BoundaryT >::type > > >
0103 is_in_range(attribute_keyword< DescriptorT, ActorT > const&, BoundaryT const& least, BoundaryT const& most)
0104 {
0105 typedef typename boost::log::aux::make_embedded_string_type< BoundaryT >::type boundary_type;
0106 typedef aux::unary_function_terminal< attribute_is_in_range< typename DescriptorT::value_type, boundary_type > > terminal_type;
0107 ActorT< terminal_type > act = {{ terminal_type(DescriptorT::get_name(), std::pair< boundary_type, boundary_type >(least, most)) }};
0108 return act;
0109 }
0110
0111
0112
0113
0114
0115 template< typename T, typename BoundaryT >
0116 BOOST_FORCEINLINE phoenix::actor< aux::unary_function_terminal< attribute_is_in_range< T, typename boost::log::aux::make_embedded_string_type< BoundaryT >::type > > >
0117 is_in_range(attribute_name const& name, BoundaryT const& least, BoundaryT const& most)
0118 {
0119 typedef typename boost::log::aux::make_embedded_string_type< BoundaryT >::type boundary_type;
0120 typedef aux::unary_function_terminal< attribute_is_in_range< T, boundary_type > > terminal_type;
0121 phoenix::actor< terminal_type > act = {{ terminal_type(name, std::pair< boundary_type, boundary_type >(least, most)) }};
0122 return act;
0123 }
0124
0125 }
0126
0127 BOOST_LOG_CLOSE_NAMESPACE
0128
0129 }
0130
0131 #include <boost/log/detail/footer.hpp>
0132
0133 #endif