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)
8 * \file channel_severity_filter.hpp
9 * \author Andrey Semashev
12 * The header contains implementation of a minimal severity per channel filter.
15 #ifndef BOOST_LOG_EXPRESSIONS_PREDICATES_CHANNEL_SEVERITY_FILTER_HPP_INCLUDED_
16 #define BOOST_LOG_EXPRESSIONS_PREDICATES_CHANNEL_SEVERITY_FILTER_HPP_INCLUDED_
21 #include <boost/phoenix/core/actor.hpp>
22 #include <boost/phoenix/core/terminal_fwd.hpp>
23 #include <boost/phoenix/core/is_nullary.hpp>
24 #include <boost/phoenix/core/environment.hpp>
25 #include <boost/fusion/sequence/intrinsic/at_c.hpp>
26 #include <boost/type_traits/remove_cv.hpp>
27 #include <boost/type_traits/remove_reference.hpp>
28 #include <boost/log/detail/config.hpp>
29 #include <boost/log/detail/custom_terminal_spec.hpp>
30 #include <boost/log/attributes/attribute_name.hpp>
31 #include <boost/log/attributes/fallback_policy.hpp>
32 #include <boost/log/attributes/value_visitation.hpp>
33 #include <boost/log/utility/functional/logical.hpp>
34 #include <boost/log/expressions/attr_fwd.hpp>
35 #include <boost/log/expressions/keyword_fwd.hpp>
36 #include <boost/log/detail/header.hpp>
38 #ifdef BOOST_HAS_PRAGMA_ONCE
44 BOOST_LOG_OPEN_NAMESPACE
46 namespace expressions {
51 typename ChannelFallbackT = fallback_to_none,
52 typename SeverityFallbackT = fallback_to_none,
53 typename ChannelOrderT = less,
54 typename SeverityCompareT = greater_equal,
55 typename AllocatorT = std::allocator< void >
57 class channel_severity_filter_terminal
60 #ifndef BOOST_LOG_DOXYGEN_PASS
61 //! Internal typedef for type categorization
62 typedef void _is_boost_log_terminal;
65 //! Function result type
66 typedef bool result_type;
68 //! Channel attribute value type
69 typedef ChannelT channel_value_type;
70 //! Channel fallback policy
71 typedef ChannelFallbackT channel_fallback_policy;
72 //! Severity level attribute value type
73 typedef SeverityT severity_value_type;
74 //! Severity level fallback policy
75 typedef SeverityFallbackT severity_fallback_policy;
78 //! Channel to severity mapping type
83 typename AllocatorT::BOOST_NESTED_TEMPLATE rebind< std::pair< const channel_value_type, severity_value_type > >::other
85 //! Attribute value visitor invoker for channel
86 typedef value_visitor_invoker< channel_value_type, channel_fallback_policy > channel_visitor_invoker_type;
87 //! Attribute value visitor invoker for severity level
88 typedef value_visitor_invoker< severity_value_type, severity_fallback_policy > severity_visitor_invoker_type;
91 template< typename ArgT >
92 struct channel_visitor
94 typedef void result_type;
96 channel_visitor(channel_severity_filter_terminal const& self, ArgT arg, bool& res) : m_self(self), m_arg(arg), m_res(res)
100 result_type operator() (channel_value_type const& channel) const
102 m_self.visit_channel(channel, m_arg, m_res);
106 channel_severity_filter_terminal const& m_self;
111 //! Severity level visitor
112 struct severity_visitor
114 typedef void result_type;
116 severity_visitor(channel_severity_filter_terminal const& self, severity_value_type const& severity, bool& res) : m_self(self), m_severity(severity), m_res(res)
120 result_type operator() (severity_value_type const& severity) const
122 m_self.visit_severity(severity, m_severity, m_res);
126 channel_severity_filter_terminal const& m_self;
127 severity_value_type const& m_severity;
132 //! Channel attribute name
133 attribute_name m_channel_name;
134 //! Severity level attribute name
135 attribute_name m_severity_name;
136 //! Channel value visitor invoker
137 channel_visitor_invoker_type m_channel_visitor_invoker;
138 //! Severity level value visitor invoker
139 severity_visitor_invoker_type m_severity_visitor_invoker;
141 //! Channel to severity level mapping
142 mapping_type m_mapping;
143 //! Severity checking predicate
144 SeverityCompareT m_severity_compare;
150 //! Initializing constructor
151 channel_severity_filter_terminal
153 attribute_name const& channel_name,
154 attribute_name const& severity_name,
155 channel_fallback_policy const& channel_fallback = channel_fallback_policy(),
156 severity_fallback_policy const& severity_fallback = severity_fallback_policy(),
157 ChannelOrderT const& channel_order = ChannelOrderT(),
158 SeverityCompareT const& severity_compare = SeverityCompareT()
160 m_channel_name(channel_name),
161 m_severity_name(severity_name),
162 m_channel_visitor_invoker(channel_fallback),
163 m_severity_visitor_invoker(severity_fallback),
164 m_mapping(channel_order),
165 m_severity_compare(severity_compare),
170 //! Adds a new element to the mapping
171 void add(channel_value_type const& channel, severity_value_type const& severity)
173 typedef typename mapping_type::iterator iterator;
174 std::pair< iterator, bool > res = m_mapping.insert(typename mapping_type::value_type(channel, severity));
176 res.first->second = severity;
179 //! Sets the default result of the predicate
180 void set_default(bool def)
185 //! Invokation operator
186 template< typename ContextT >
187 result_type operator() (ContextT const& ctx) const
189 result_type res = m_default;
191 typedef typename remove_cv<
192 typename remove_reference< typename phoenix::result_of::env< ContextT >::type >::type
194 typedef typename env_type::args_type args_type;
195 typedef typename fusion::result_of::at_c< args_type, 0 >::type arg_type;
196 arg_type arg = fusion::at_c< 0 >(phoenix::env(ctx).args());
198 m_channel_visitor_invoker(m_channel_name, arg, channel_visitor< arg_type >(*this, arg, res));
204 //! Visits channel name
205 template< typename ArgT >
206 void visit_channel(channel_value_type const& channel, ArgT const& arg, bool& res) const
208 typename mapping_type::const_iterator it = m_mapping.find(channel);
209 if (it != m_mapping.end())
211 m_severity_visitor_invoker(m_severity_name, arg, severity_visitor(*this, it->second, res));
215 //! Visits severity level
216 void visit_severity(severity_value_type const& left, severity_value_type const& right, bool& res) const
218 res = m_severity_compare(left, right);
225 typename ChannelFallbackT = fallback_to_none,
226 typename SeverityFallbackT = fallback_to_none,
227 typename ChannelOrderT = less,
228 typename SeverityCompareT = greater_equal,
229 typename AllocatorT = std::allocator< void >,
230 template< typename > class ActorT = phoenix::actor
232 class channel_severity_filter_actor :
233 public ActorT< channel_severity_filter_terminal< ChannelT, SeverityT, ChannelFallbackT, SeverityFallbackT, ChannelOrderT, SeverityCompareT, AllocatorT > >
237 typedef channel_severity_filter_actor this_type;
241 typedef channel_severity_filter_terminal< ChannelT, SeverityT, ChannelFallbackT, SeverityFallbackT, ChannelOrderT, SeverityCompareT, AllocatorT > terminal_type;
243 typedef ActorT< terminal_type > base_type;
245 //! Channel attribute value type
246 typedef typename terminal_type::channel_value_type channel_value_type;
247 //! Channel fallback policy
248 typedef typename terminal_type::channel_fallback_policy channel_fallback_policy;
249 //! Severity level attribute value type
250 typedef typename terminal_type::severity_value_type severity_value_type;
251 //! Severity level fallback policy
252 typedef typename terminal_type::severity_fallback_policy severity_fallback_policy;
255 //! An auxiliary pseudo-reference to implement insertion through subscript operator
256 class subscript_result
259 channel_severity_filter_actor& m_owner;
260 channel_value_type const& m_channel;
263 subscript_result(channel_severity_filter_actor& owner, channel_value_type const& channel) : m_owner(owner), m_channel(channel)
267 void operator= (severity_value_type const& severity)
269 m_owner.add(m_channel, severity);
274 //! Initializing constructor
275 explicit channel_severity_filter_actor(base_type const& act) : base_type(act)
279 channel_severity_filter_actor(channel_severity_filter_actor const& that) : base_type(static_cast< base_type const& >(that))
283 //! Sets the default function result
284 this_type& set_default(bool def)
286 this->proto_expr_.child0.set_default(def);
290 //! Adds a new element to the mapping
291 this_type& add(channel_value_type const& channel, severity_value_type const& severity)
293 this->proto_expr_.child0.add(channel, severity);
297 //! Alternative interface for adding a new element to the mapping
298 subscript_result operator[] (channel_value_type const& channel)
300 return subscript_result(*this, channel);
305 * The function generates a filtering predicate that checks the severity levels of log records in different channels. The predicate will return \c true
306 * if the record severity level is not less than the threshold for the channel the record belongs to.
308 template< typename ChannelT, typename SeverityT >
309 BOOST_FORCEINLINE channel_severity_filter_actor< ChannelT, SeverityT >
310 channel_severity_filter(attribute_name const& channel_name, attribute_name const& severity_name)
312 typedef channel_severity_filter_actor< ChannelT, SeverityT > result_type;
313 typedef typename result_type::terminal_type terminal_type;
314 typename result_type::base_type act = {{ terminal_type(channel_name, severity_name) }};
315 return result_type(act);
319 template< typename SeverityT, typename ChannelDescriptorT, template< typename > class ActorT >
320 BOOST_FORCEINLINE channel_severity_filter_actor< typename ChannelDescriptorT::value_type, SeverityT, fallback_to_none, fallback_to_none, less, greater_equal, std::allocator< void >, ActorT >
321 channel_severity_filter(attribute_keyword< ChannelDescriptorT, ActorT > const& channel_keyword, attribute_name const& severity_name)
323 typedef channel_severity_filter_actor< typename ChannelDescriptorT::value_type, SeverityT, fallback_to_none, fallback_to_none, less, greater_equal, std::allocator< void >, ActorT > result_type;
324 typedef typename result_type::terminal_type terminal_type;
325 typename result_type::base_type act = {{ terminal_type(channel_keyword.get_name(), severity_name) }};
326 return result_type(act);
330 template< typename ChannelT, typename SeverityDescriptorT, template< typename > class ActorT >
331 BOOST_FORCEINLINE channel_severity_filter_actor< ChannelT, typename SeverityDescriptorT::value_type, fallback_to_none, fallback_to_none, less, greater_equal, std::allocator< void >, ActorT >
332 channel_severity_filter(attribute_name const& channel_name, attribute_keyword< SeverityDescriptorT, ActorT > const& severity_keyword)
334 typedef channel_severity_filter_actor< ChannelT, typename SeverityDescriptorT::value_type, fallback_to_none, fallback_to_none, less, greater_equal, std::allocator< void >, ActorT > result_type;
335 typedef typename result_type::terminal_type terminal_type;
336 typename result_type::base_type act = {{ terminal_type(channel_name, severity_keyword.get_name()) }};
337 return result_type(act);
341 template< typename ChannelDescriptorT, typename SeverityDescriptorT, template< typename > class ActorT >
342 BOOST_FORCEINLINE channel_severity_filter_actor< typename ChannelDescriptorT::value_type, typename SeverityDescriptorT::value_type, fallback_to_none, fallback_to_none, less, greater_equal, std::allocator< void >, ActorT >
343 channel_severity_filter(attribute_keyword< ChannelDescriptorT, ActorT > const& channel_keyword, attribute_keyword< SeverityDescriptorT, ActorT > const& severity_keyword)
345 typedef channel_severity_filter_actor< typename ChannelDescriptorT::value_type, typename SeverityDescriptorT::value_type, fallback_to_none, fallback_to_none, less, greater_equal, std::allocator< void >, ActorT > result_type;
346 typedef typename result_type::terminal_type terminal_type;
347 typename result_type::base_type act = {{ terminal_type(channel_keyword.get_name(), severity_keyword.get_name()) }};
348 return result_type(act);
352 template< typename SeverityT, typename ChannelT, typename ChannelFallbackT, typename ChannelTagT, template< typename > class ActorT >
353 BOOST_FORCEINLINE channel_severity_filter_actor< ChannelT, SeverityT, ChannelFallbackT, fallback_to_none, less, greater_equal, std::allocator< void >, ActorT >
354 channel_severity_filter(attribute_actor< ChannelT, ChannelFallbackT, ChannelTagT, ActorT > const& channel_placeholder, attribute_name const& severity_name)
356 typedef channel_severity_filter_actor< ChannelT, SeverityT, ChannelFallbackT, fallback_to_none, less, greater_equal, std::allocator< void >, ActorT > result_type;
357 typedef typename result_type::terminal_type terminal_type;
358 typename result_type::base_type act = {{ terminal_type(channel_placeholder.get_name(), severity_name, channel_placeholder.get_fallback_policy()) }};
359 return result_type(act);
363 template< typename ChannelT, typename SeverityT, typename SeverityFallbackT, typename SeverityTagT, template< typename > class ActorT >
364 BOOST_FORCEINLINE channel_severity_filter_actor< ChannelT, SeverityT, fallback_to_none, SeverityFallbackT, less, greater_equal, std::allocator< void >, ActorT >
365 channel_severity_filter(attribute_name const& channel_name, attribute_actor< SeverityT, SeverityFallbackT, SeverityTagT, ActorT > const& severity_placeholder)
367 typedef channel_severity_filter_actor< ChannelT, SeverityT, fallback_to_none, SeverityFallbackT, less, greater_equal, std::allocator< void >, ActorT > result_type;
368 typedef typename result_type::terminal_type terminal_type;
369 typename result_type::base_type act = {{ terminal_type(channel_name, severity_placeholder.get_name(), fallback_to_none(), severity_placeholder.get_fallback_policy()) }};
370 return result_type(act);
374 template< typename ChannelT, typename ChannelFallbackT, typename ChannelTagT, typename SeverityT, typename SeverityFallbackT, typename SeverityTagT, template< typename > class ActorT >
375 BOOST_FORCEINLINE channel_severity_filter_actor< ChannelT, SeverityT, ChannelFallbackT, SeverityFallbackT, less, greater_equal, std::allocator< void >, ActorT >
376 channel_severity_filter(attribute_actor< ChannelT, ChannelFallbackT, ChannelTagT, ActorT > const& channel_placeholder, attribute_actor< SeverityT, SeverityFallbackT, SeverityTagT, ActorT > const& severity_placeholder)
378 typedef channel_severity_filter_actor< ChannelT, SeverityT, ChannelFallbackT, SeverityFallbackT, less, greater_equal, std::allocator< void >, ActorT > result_type;
379 typedef typename result_type::terminal_type terminal_type;
380 typename result_type::base_type act = {{ terminal_type(channel_placeholder.get_name(), severity_placeholder.get_name(), channel_placeholder.get_fallback_policy(), severity_placeholder.get_fallback_policy()) }};
381 return result_type(act);
386 template< typename ChannelT, typename SeverityT, typename SeverityCompareT >
387 BOOST_FORCEINLINE channel_severity_filter_actor< ChannelT, SeverityT, fallback_to_none, fallback_to_none, less, SeverityCompareT >
388 channel_severity_filter(attribute_name const& channel_name, attribute_name const& severity_name, SeverityCompareT const& severity_compare)
390 typedef channel_severity_filter_actor< ChannelT, SeverityT, fallback_to_none, fallback_to_none, less, SeverityCompareT > result_type;
391 typedef typename result_type::terminal_type terminal_type;
392 typename result_type::base_type act = {{ terminal_type(channel_name, severity_name, fallback_to_none(), fallback_to_none(), less(), severity_compare) }};
393 return result_type(act);
397 template< typename SeverityT, typename ChannelDescriptorT, template< typename > class ActorT, typename SeverityCompareT >
398 BOOST_FORCEINLINE channel_severity_filter_actor< typename ChannelDescriptorT::value_type, SeverityT, fallback_to_none, fallback_to_none, less, SeverityCompareT, std::allocator< void >, ActorT >
399 channel_severity_filter(attribute_keyword< ChannelDescriptorT, ActorT > const& channel_keyword, attribute_name const& severity_name, SeverityCompareT const& severity_compare)
401 typedef channel_severity_filter_actor< typename ChannelDescriptorT::value_type, SeverityT, fallback_to_none, fallback_to_none, less, SeverityCompareT, std::allocator< void >, ActorT > result_type;
402 typedef typename result_type::terminal_type terminal_type;
403 typename result_type::base_type act = {{ terminal_type(channel_keyword.get_name(), severity_name, fallback_to_none(), fallback_to_none(), less(), severity_compare) }};
404 return result_type(act);
408 template< typename ChannelT, typename SeverityDescriptorT, template< typename > class ActorT, typename SeverityCompareT >
409 BOOST_FORCEINLINE channel_severity_filter_actor< ChannelT, typename SeverityDescriptorT::value_type, fallback_to_none, fallback_to_none, less, SeverityCompareT, std::allocator< void >, ActorT >
410 channel_severity_filter(attribute_name const& channel_name, attribute_keyword< SeverityDescriptorT, ActorT > const& severity_keyword, SeverityCompareT const& severity_compare)
412 typedef channel_severity_filter_actor< ChannelT, typename SeverityDescriptorT::value_type, fallback_to_none, fallback_to_none, less, SeverityCompareT, std::allocator< void >, ActorT > result_type;
413 typedef typename result_type::terminal_type terminal_type;
414 typename result_type::base_type act = {{ terminal_type(channel_name, severity_keyword.get_name(), fallback_to_none(), fallback_to_none(), less(), severity_compare) }};
415 return result_type(act);
419 template< typename ChannelDescriptorT, typename SeverityDescriptorT, template< typename > class ActorT, typename SeverityCompareT >
420 BOOST_FORCEINLINE channel_severity_filter_actor< typename ChannelDescriptorT::value_type, typename SeverityDescriptorT::value_type, fallback_to_none, fallback_to_none, less, SeverityCompareT, std::allocator< void >, ActorT >
421 channel_severity_filter(attribute_keyword< ChannelDescriptorT, ActorT > const& channel_keyword, attribute_keyword< SeverityDescriptorT, ActorT > const& severity_keyword, SeverityCompareT const& severity_compare)
423 typedef channel_severity_filter_actor< typename ChannelDescriptorT::value_type, typename SeverityDescriptorT::value_type, fallback_to_none, fallback_to_none, less, SeverityCompareT, std::allocator< void >, ActorT > result_type;
424 typedef typename result_type::terminal_type terminal_type;
425 typename result_type::base_type act = {{ terminal_type(channel_keyword.get_name(), severity_keyword.get_name(), fallback_to_none(), fallback_to_none(), less(), severity_compare) }};
426 return result_type(act);
430 template< typename SeverityT, typename ChannelT, typename ChannelFallbackT, typename ChannelTagT, template< typename > class ActorT, typename SeverityCompareT >
431 BOOST_FORCEINLINE channel_severity_filter_actor< ChannelT, SeverityT, ChannelFallbackT, fallback_to_none, less, SeverityCompareT, std::allocator< void >, ActorT >
432 channel_severity_filter(attribute_actor< ChannelT, ChannelFallbackT, ChannelTagT, ActorT > const& channel_placeholder, attribute_name const& severity_name, SeverityCompareT const& severity_compare)
434 typedef channel_severity_filter_actor< ChannelT, SeverityT, ChannelFallbackT, fallback_to_none, less, SeverityCompareT, std::allocator< void >, ActorT > result_type;
435 typedef typename result_type::terminal_type terminal_type;
436 typename result_type::base_type act = {{ terminal_type(channel_placeholder.get_name(), severity_name, channel_placeholder.get_fallback_policy(), fallback_to_none(), less(), severity_compare) }};
437 return result_type(act);
441 template< typename ChannelT, typename SeverityT, typename SeverityFallbackT, typename SeverityTagT, template< typename > class ActorT, typename SeverityCompareT >
442 BOOST_FORCEINLINE channel_severity_filter_actor< ChannelT, SeverityT, fallback_to_none, SeverityFallbackT, less, SeverityCompareT, std::allocator< void >, ActorT >
443 channel_severity_filter(attribute_name const& channel_name, attribute_actor< SeverityT, SeverityFallbackT, SeverityTagT, ActorT > const& severity_placeholder, SeverityCompareT const& severity_compare)
445 typedef channel_severity_filter_actor< ChannelT, SeverityT, fallback_to_none, SeverityFallbackT, less, SeverityCompareT, std::allocator< void >, ActorT > result_type;
446 typedef typename result_type::terminal_type terminal_type;
447 typename result_type::base_type act = {{ terminal_type(channel_name, severity_placeholder.get_name(), fallback_to_none(), severity_placeholder.get_fallback_policy(), less(), severity_compare) }};
448 return result_type(act);
452 template< typename ChannelT, typename ChannelFallbackT, typename ChannelTagT, typename SeverityT, typename SeverityFallbackT, typename SeverityTagT, template< typename > class ActorT, typename SeverityCompareT >
453 BOOST_FORCEINLINE channel_severity_filter_actor< ChannelT, SeverityT, ChannelFallbackT, SeverityFallbackT, less, SeverityCompareT, std::allocator< void >, ActorT >
454 channel_severity_filter(attribute_actor< ChannelT, ChannelFallbackT, ChannelTagT, ActorT > const& channel_placeholder, attribute_actor< SeverityT, SeverityFallbackT, SeverityTagT, ActorT > const& severity_placeholder, SeverityCompareT const& severity_compare)
456 typedef channel_severity_filter_actor< ChannelT, SeverityT, ChannelFallbackT, SeverityFallbackT, less, SeverityCompareT, std::allocator< void >, ActorT > result_type;
457 typedef typename result_type::terminal_type terminal_type;
458 typename result_type::base_type act = {{ terminal_type(channel_placeholder.get_name(), severity_placeholder.get_name(), channel_placeholder.get_fallback_policy(), severity_placeholder.get_fallback_policy(), less(), severity_compare) }};
459 return result_type(act);
464 template< typename ChannelT, typename SeverityT, typename SeverityCompareT, typename ChannelOrderT >
465 BOOST_FORCEINLINE channel_severity_filter_actor< ChannelT, SeverityT, fallback_to_none, fallback_to_none, ChannelOrderT, SeverityCompareT >
466 channel_severity_filter(attribute_name const& channel_name, attribute_name const& severity_name, SeverityCompareT const& severity_compare, ChannelOrderT const& channel_order)
468 typedef channel_severity_filter_actor< ChannelT, SeverityT, fallback_to_none, fallback_to_none, ChannelOrderT, SeverityCompareT > result_type;
469 typedef typename result_type::terminal_type terminal_type;
470 typename result_type::base_type act = {{ terminal_type(channel_name, severity_name, fallback_to_none(), fallback_to_none(), channel_order, severity_compare) }};
471 return result_type(act);
475 template< typename SeverityT, typename ChannelDescriptorT, template< typename > class ActorT, typename SeverityCompareT, typename ChannelOrderT >
476 BOOST_FORCEINLINE channel_severity_filter_actor< typename ChannelDescriptorT::value_type, SeverityT, fallback_to_none, fallback_to_none, ChannelOrderT, SeverityCompareT, std::allocator< void >, ActorT >
477 channel_severity_filter(attribute_keyword< ChannelDescriptorT, ActorT > const& channel_keyword, attribute_name const& severity_name, SeverityCompareT const& severity_compare, ChannelOrderT const& channel_order)
479 typedef channel_severity_filter_actor< typename ChannelDescriptorT::value_type, SeverityT, fallback_to_none, fallback_to_none, ChannelOrderT, SeverityCompareT, std::allocator< void >, ActorT > result_type;
480 typedef typename result_type::terminal_type terminal_type;
481 typename result_type::base_type act = {{ terminal_type(channel_keyword.get_name(), severity_name, fallback_to_none(), fallback_to_none(), channel_order, severity_compare) }};
482 return result_type(act);
486 template< typename ChannelT, typename SeverityDescriptorT, template< typename > class ActorT, typename SeverityCompareT, typename ChannelOrderT >
487 BOOST_FORCEINLINE channel_severity_filter_actor< ChannelT, typename SeverityDescriptorT::value_type, fallback_to_none, fallback_to_none, ChannelOrderT, SeverityCompareT, std::allocator< void >, ActorT >
488 channel_severity_filter(attribute_name const& channel_name, attribute_keyword< SeverityDescriptorT, ActorT > const& severity_keyword, SeverityCompareT const& severity_compare, ChannelOrderT const& channel_order)
490 typedef channel_severity_filter_actor< ChannelT, typename SeverityDescriptorT::value_type, fallback_to_none, fallback_to_none, ChannelOrderT, SeverityCompareT, std::allocator< void >, ActorT > result_type;
491 typedef typename result_type::terminal_type terminal_type;
492 typename result_type::base_type act = {{ terminal_type(channel_name, severity_keyword.get_name(), fallback_to_none(), fallback_to_none(), channel_order, severity_compare) }};
493 return result_type(act);
497 template< typename ChannelDescriptorT, typename SeverityDescriptorT, template< typename > class ActorT, typename SeverityCompareT, typename ChannelOrderT >
498 BOOST_FORCEINLINE channel_severity_filter_actor< typename ChannelDescriptorT::value_type, typename SeverityDescriptorT::value_type, fallback_to_none, fallback_to_none, ChannelOrderT, SeverityCompareT, std::allocator< void >, ActorT >
499 channel_severity_filter(attribute_keyword< ChannelDescriptorT, ActorT > const& channel_keyword, attribute_keyword< SeverityDescriptorT, ActorT > const& severity_keyword, SeverityCompareT const& severity_compare, ChannelOrderT const& channel_order)
501 typedef channel_severity_filter_actor< typename ChannelDescriptorT::value_type, typename SeverityDescriptorT::value_type, fallback_to_none, fallback_to_none, ChannelOrderT, SeverityCompareT, std::allocator< void >, ActorT > result_type;
502 typedef typename result_type::terminal_type terminal_type;
503 typename result_type::base_type act = {{ terminal_type(channel_keyword.get_name(), severity_keyword.get_name(), fallback_to_none(), fallback_to_none(), channel_order, severity_compare) }};
504 return result_type(act);
508 template< typename SeverityT, typename ChannelT, typename ChannelFallbackT, typename ChannelTagT, template< typename > class ActorT, typename SeverityCompareT, typename ChannelOrderT >
509 BOOST_FORCEINLINE channel_severity_filter_actor< ChannelT, SeverityT, ChannelFallbackT, fallback_to_none, ChannelOrderT, SeverityCompareT, std::allocator< void >, ActorT >
510 channel_severity_filter(attribute_actor< ChannelT, ChannelFallbackT, ChannelTagT, ActorT > const& channel_placeholder, attribute_name const& severity_name, SeverityCompareT const& severity_compare, ChannelOrderT const& channel_order)
512 typedef channel_severity_filter_actor< ChannelT, SeverityT, ChannelFallbackT, fallback_to_none, ChannelOrderT, SeverityCompareT, std::allocator< void >, ActorT > result_type;
513 typedef typename result_type::terminal_type terminal_type;
514 typename result_type::base_type act = {{ terminal_type(channel_placeholder.get_name(), severity_name, channel_placeholder.get_fallback_policy(), fallback_to_none(), channel_order, severity_compare) }};
515 return result_type(act);
519 template< typename ChannelT, typename SeverityT, typename SeverityFallbackT, typename SeverityTagT, template< typename > class ActorT, typename SeverityCompareT, typename ChannelOrderT >
520 BOOST_FORCEINLINE channel_severity_filter_actor< ChannelT, SeverityT, fallback_to_none, SeverityFallbackT, ChannelOrderT, SeverityCompareT, std::allocator< void >, ActorT >
521 channel_severity_filter(attribute_name const& channel_name, attribute_actor< SeverityT, SeverityFallbackT, SeverityTagT, ActorT > const& severity_placeholder, SeverityCompareT const& severity_compare, ChannelOrderT const& channel_order)
523 typedef channel_severity_filter_actor< ChannelT, SeverityT, fallback_to_none, SeverityFallbackT, ChannelOrderT, SeverityCompareT, std::allocator< void >, ActorT > result_type;
524 typedef typename result_type::terminal_type terminal_type;
525 typename result_type::base_type act = {{ terminal_type(channel_name, severity_placeholder.get_name(), fallback_to_none(), severity_placeholder.get_fallback_policy(), channel_order, severity_compare) }};
526 return result_type(act);
530 template< typename ChannelT, typename ChannelFallbackT, typename ChannelTagT, typename SeverityT, typename SeverityFallbackT, typename SeverityTagT, template< typename > class ActorT, typename SeverityCompareT, typename ChannelOrderT >
531 BOOST_FORCEINLINE channel_severity_filter_actor< ChannelT, SeverityT, ChannelFallbackT, SeverityFallbackT, ChannelOrderT, SeverityCompareT, std::allocator< void >, ActorT >
532 channel_severity_filter(attribute_actor< ChannelT, ChannelFallbackT, ChannelTagT, ActorT > const& channel_placeholder, attribute_actor< SeverityT, SeverityFallbackT, SeverityTagT, ActorT > const& severity_placeholder, SeverityCompareT const& severity_compare, ChannelOrderT const& channel_order)
534 typedef channel_severity_filter_actor< ChannelT, SeverityT, ChannelFallbackT, SeverityFallbackT, ChannelOrderT, SeverityCompareT, std::allocator< void >, ActorT > result_type;
535 typedef typename result_type::terminal_type terminal_type;
536 typename result_type::base_type act = {{ terminal_type(channel_placeholder.get_name(), severity_placeholder.get_name(), channel_placeholder.get_fallback_policy(), severity_placeholder.get_fallback_policy(), channel_order, severity_compare) }};
537 return result_type(act);
540 } // namespace expressions
542 BOOST_LOG_CLOSE_NAMESPACE // namespace log
544 #ifndef BOOST_LOG_DOXYGEN_PASS
548 namespace result_of {
553 typename ChannelFallbackT,
554 typename SeverityFallbackT,
555 typename ChannelOrderT,
556 typename SeverityCompareT,
559 struct is_nullary< custom_terminal< boost::log::expressions::channel_severity_filter_terminal< ChannelT, SeverityT, ChannelFallbackT, SeverityFallbackT, ChannelOrderT, SeverityCompareT, AllocatorT > > > :
564 } // namespace result_of
566 } // namespace phoenix
572 #include <boost/log/detail/footer.hpp>
574 #endif // BOOST_LOG_EXPRESSIONS_PREDICATES_CHANNEL_SEVERITY_FILTER_HPP_INCLUDED_