]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
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 | * \file channel_severity_filter.hpp | |
9 | * \author Andrey Semashev | |
10 | * \date 25.11.2012 | |
11 | * | |
12 | * The header contains implementation of a minimal severity per channel filter. | |
13 | */ | |
14 | ||
15 | #ifndef BOOST_LOG_EXPRESSIONS_PREDICATES_CHANNEL_SEVERITY_FILTER_HPP_INCLUDED_ | |
16 | #define BOOST_LOG_EXPRESSIONS_PREDICATES_CHANNEL_SEVERITY_FILTER_HPP_INCLUDED_ | |
17 | ||
18 | #include <map> | |
19 | #include <memory> | |
20 | #include <utility> | |
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> | |
11fdf7f2 | 29 | #include <boost/log/detail/allocator_traits.hpp> |
7c673cae FG |
30 | #include <boost/log/detail/custom_terminal_spec.hpp> |
31 | #include <boost/log/attributes/attribute_name.hpp> | |
32 | #include <boost/log/attributes/fallback_policy.hpp> | |
33 | #include <boost/log/attributes/value_visitation.hpp> | |
34 | #include <boost/log/utility/functional/logical.hpp> | |
35 | #include <boost/log/expressions/attr_fwd.hpp> | |
36 | #include <boost/log/expressions/keyword_fwd.hpp> | |
37 | #include <boost/log/detail/header.hpp> | |
38 | ||
39 | #ifdef BOOST_HAS_PRAGMA_ONCE | |
40 | #pragma once | |
41 | #endif | |
42 | ||
43 | namespace boost { | |
44 | ||
45 | BOOST_LOG_OPEN_NAMESPACE | |
46 | ||
47 | namespace expressions { | |
48 | ||
49 | template< | |
50 | typename ChannelT, | |
51 | typename SeverityT, | |
52 | typename ChannelFallbackT = fallback_to_none, | |
53 | typename SeverityFallbackT = fallback_to_none, | |
54 | typename ChannelOrderT = less, | |
55 | typename SeverityCompareT = greater_equal, | |
56 | typename AllocatorT = std::allocator< void > | |
57 | > | |
58 | class channel_severity_filter_terminal | |
59 | { | |
60 | public: | |
61 | #ifndef BOOST_LOG_DOXYGEN_PASS | |
62 | //! Internal typedef for type categorization | |
63 | typedef void _is_boost_log_terminal; | |
64 | #endif | |
65 | ||
66 | //! Function result type | |
67 | typedef bool result_type; | |
68 | ||
69 | //! Channel attribute value type | |
70 | typedef ChannelT channel_value_type; | |
71 | //! Channel fallback policy | |
72 | typedef ChannelFallbackT channel_fallback_policy; | |
73 | //! Severity level attribute value type | |
74 | typedef SeverityT severity_value_type; | |
75 | //! Severity level fallback policy | |
76 | typedef SeverityFallbackT severity_fallback_policy; | |
77 | ||
78 | private: | |
79 | //! Channel to severity mapping type | |
80 | typedef std::map< | |
81 | channel_value_type, | |
82 | severity_value_type, | |
83 | ChannelOrderT, | |
11fdf7f2 | 84 | typename boost::log::aux::rebind_alloc< AllocatorT, std::pair< const channel_value_type, severity_value_type > >::type |
7c673cae FG |
85 | > mapping_type; |
86 | //! Attribute value visitor invoker for channel | |
87 | typedef value_visitor_invoker< channel_value_type, channel_fallback_policy > channel_visitor_invoker_type; | |
88 | //! Attribute value visitor invoker for severity level | |
89 | typedef value_visitor_invoker< severity_value_type, severity_fallback_policy > severity_visitor_invoker_type; | |
90 | ||
91 | //! Channel visitor | |
92 | template< typename ArgT > | |
93 | struct channel_visitor | |
94 | { | |
95 | typedef void result_type; | |
96 | ||
97 | channel_visitor(channel_severity_filter_terminal const& self, ArgT arg, bool& res) : m_self(self), m_arg(arg), m_res(res) | |
98 | { | |
99 | } | |
100 | ||
101 | result_type operator() (channel_value_type const& channel) const | |
102 | { | |
103 | m_self.visit_channel(channel, m_arg, m_res); | |
104 | } | |
105 | ||
106 | private: | |
107 | channel_severity_filter_terminal const& m_self; | |
108 | ArgT m_arg; | |
109 | bool& m_res; | |
110 | }; | |
111 | ||
112 | //! Severity level visitor | |
113 | struct severity_visitor | |
114 | { | |
115 | typedef void result_type; | |
116 | ||
117 | severity_visitor(channel_severity_filter_terminal const& self, severity_value_type const& severity, bool& res) : m_self(self), m_severity(severity), m_res(res) | |
118 | { | |
119 | } | |
120 | ||
121 | result_type operator() (severity_value_type const& severity) const | |
122 | { | |
123 | m_self.visit_severity(severity, m_severity, m_res); | |
124 | } | |
125 | ||
126 | private: | |
127 | channel_severity_filter_terminal const& m_self; | |
128 | severity_value_type const& m_severity; | |
129 | bool& m_res; | |
130 | }; | |
131 | ||
132 | private: | |
133 | //! Channel attribute name | |
134 | attribute_name m_channel_name; | |
135 | //! Severity level attribute name | |
136 | attribute_name m_severity_name; | |
137 | //! Channel value visitor invoker | |
138 | channel_visitor_invoker_type m_channel_visitor_invoker; | |
139 | //! Severity level value visitor invoker | |
140 | severity_visitor_invoker_type m_severity_visitor_invoker; | |
141 | ||
142 | //! Channel to severity level mapping | |
143 | mapping_type m_mapping; | |
144 | //! Severity checking predicate | |
145 | SeverityCompareT m_severity_compare; | |
146 | ||
147 | //! Default result | |
148 | bool m_default; | |
149 | ||
150 | public: | |
151 | //! Initializing constructor | |
152 | channel_severity_filter_terminal | |
153 | ( | |
154 | attribute_name const& channel_name, | |
155 | attribute_name const& severity_name, | |
156 | channel_fallback_policy const& channel_fallback = channel_fallback_policy(), | |
157 | severity_fallback_policy const& severity_fallback = severity_fallback_policy(), | |
158 | ChannelOrderT const& channel_order = ChannelOrderT(), | |
159 | SeverityCompareT const& severity_compare = SeverityCompareT() | |
160 | ) : | |
161 | m_channel_name(channel_name), | |
162 | m_severity_name(severity_name), | |
163 | m_channel_visitor_invoker(channel_fallback), | |
164 | m_severity_visitor_invoker(severity_fallback), | |
165 | m_mapping(channel_order), | |
166 | m_severity_compare(severity_compare), | |
167 | m_default(false) | |
168 | { | |
169 | } | |
170 | ||
171 | //! Adds a new element to the mapping | |
172 | void add(channel_value_type const& channel, severity_value_type const& severity) | |
173 | { | |
174 | typedef typename mapping_type::iterator iterator; | |
175 | std::pair< iterator, bool > res = m_mapping.insert(typename mapping_type::value_type(channel, severity)); | |
176 | if (!res.second) | |
177 | res.first->second = severity; | |
178 | } | |
179 | ||
180 | //! Sets the default result of the predicate | |
181 | void set_default(bool def) | |
182 | { | |
183 | m_default = def; | |
184 | } | |
185 | ||
186 | //! Invokation operator | |
187 | template< typename ContextT > | |
188 | result_type operator() (ContextT const& ctx) const | |
189 | { | |
190 | result_type res = m_default; | |
191 | ||
192 | typedef typename remove_cv< | |
193 | typename remove_reference< typename phoenix::result_of::env< ContextT >::type >::type | |
194 | >::type env_type; | |
195 | typedef typename env_type::args_type args_type; | |
196 | typedef typename fusion::result_of::at_c< args_type, 0 >::type arg_type; | |
197 | arg_type arg = fusion::at_c< 0 >(phoenix::env(ctx).args()); | |
198 | ||
199 | m_channel_visitor_invoker(m_channel_name, arg, channel_visitor< arg_type >(*this, arg, res)); | |
200 | ||
201 | return res; | |
202 | } | |
203 | ||
204 | private: | |
205 | //! Visits channel name | |
206 | template< typename ArgT > | |
207 | void visit_channel(channel_value_type const& channel, ArgT const& arg, bool& res) const | |
208 | { | |
209 | typename mapping_type::const_iterator it = m_mapping.find(channel); | |
210 | if (it != m_mapping.end()) | |
211 | { | |
212 | m_severity_visitor_invoker(m_severity_name, arg, severity_visitor(*this, it->second, res)); | |
213 | } | |
214 | } | |
215 | ||
216 | //! Visits severity level | |
217 | void visit_severity(severity_value_type const& left, severity_value_type const& right, bool& res) const | |
218 | { | |
219 | res = m_severity_compare(left, right); | |
220 | } | |
221 | }; | |
222 | ||
223 | template< | |
224 | typename ChannelT, | |
225 | typename SeverityT, | |
226 | typename ChannelFallbackT = fallback_to_none, | |
227 | typename SeverityFallbackT = fallback_to_none, | |
228 | typename ChannelOrderT = less, | |
229 | typename SeverityCompareT = greater_equal, | |
230 | typename AllocatorT = std::allocator< void >, | |
231 | template< typename > class ActorT = phoenix::actor | |
232 | > | |
233 | class channel_severity_filter_actor : | |
234 | public ActorT< channel_severity_filter_terminal< ChannelT, SeverityT, ChannelFallbackT, SeverityFallbackT, ChannelOrderT, SeverityCompareT, AllocatorT > > | |
235 | { | |
236 | private: | |
237 | //! Self type | |
238 | typedef channel_severity_filter_actor this_type; | |
239 | ||
240 | public: | |
241 | //! Terminal type | |
242 | typedef channel_severity_filter_terminal< ChannelT, SeverityT, ChannelFallbackT, SeverityFallbackT, ChannelOrderT, SeverityCompareT, AllocatorT > terminal_type; | |
243 | //! Base actor type | |
244 | typedef ActorT< terminal_type > base_type; | |
245 | ||
246 | //! Channel attribute value type | |
247 | typedef typename terminal_type::channel_value_type channel_value_type; | |
248 | //! Channel fallback policy | |
249 | typedef typename terminal_type::channel_fallback_policy channel_fallback_policy; | |
250 | //! Severity level attribute value type | |
251 | typedef typename terminal_type::severity_value_type severity_value_type; | |
252 | //! Severity level fallback policy | |
253 | typedef typename terminal_type::severity_fallback_policy severity_fallback_policy; | |
254 | ||
255 | private: | |
256 | //! An auxiliary pseudo-reference to implement insertion through subscript operator | |
257 | class subscript_result | |
258 | { | |
259 | private: | |
260 | channel_severity_filter_actor& m_owner; | |
261 | channel_value_type const& m_channel; | |
262 | ||
263 | public: | |
264 | subscript_result(channel_severity_filter_actor& owner, channel_value_type const& channel) : m_owner(owner), m_channel(channel) | |
265 | { | |
266 | } | |
267 | ||
268 | void operator= (severity_value_type const& severity) | |
269 | { | |
270 | m_owner.add(m_channel, severity); | |
271 | } | |
272 | }; | |
273 | ||
274 | public: | |
275 | //! Initializing constructor | |
276 | explicit channel_severity_filter_actor(base_type const& act) : base_type(act) | |
277 | { | |
278 | } | |
279 | //! Copy constructor | |
280 | channel_severity_filter_actor(channel_severity_filter_actor const& that) : base_type(static_cast< base_type const& >(that)) | |
281 | { | |
282 | } | |
283 | ||
284 | //! Sets the default function result | |
285 | this_type& set_default(bool def) | |
286 | { | |
287 | this->proto_expr_.child0.set_default(def); | |
288 | return *this; | |
289 | } | |
290 | ||
291 | //! Adds a new element to the mapping | |
292 | this_type& add(channel_value_type const& channel, severity_value_type const& severity) | |
293 | { | |
294 | this->proto_expr_.child0.add(channel, severity); | |
295 | return *this; | |
296 | } | |
297 | ||
298 | //! Alternative interface for adding a new element to the mapping | |
299 | subscript_result operator[] (channel_value_type const& channel) | |
300 | { | |
301 | return subscript_result(*this, channel); | |
302 | } | |
303 | }; | |
304 | ||
305 | /*! | |
306 | * The function generates a filtering predicate that checks the severity levels of log records in different channels. The predicate will return \c true | |
307 | * if the record severity level is not less than the threshold for the channel the record belongs to. | |
308 | */ | |
309 | template< typename ChannelT, typename SeverityT > | |
310 | BOOST_FORCEINLINE channel_severity_filter_actor< ChannelT, SeverityT > | |
311 | channel_severity_filter(attribute_name const& channel_name, attribute_name const& severity_name) | |
312 | { | |
313 | typedef channel_severity_filter_actor< ChannelT, SeverityT > result_type; | |
314 | typedef typename result_type::terminal_type terminal_type; | |
315 | typename result_type::base_type act = {{ terminal_type(channel_name, severity_name) }}; | |
316 | return result_type(act); | |
317 | } | |
318 | ||
319 | //! \overload | |
320 | template< typename SeverityT, typename ChannelDescriptorT, template< typename > class ActorT > | |
321 | BOOST_FORCEINLINE channel_severity_filter_actor< typename ChannelDescriptorT::value_type, SeverityT, fallback_to_none, fallback_to_none, less, greater_equal, std::allocator< void >, ActorT > | |
322 | channel_severity_filter(attribute_keyword< ChannelDescriptorT, ActorT > const& channel_keyword, attribute_name const& severity_name) | |
323 | { | |
324 | 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; | |
325 | typedef typename result_type::terminal_type terminal_type; | |
326 | typename result_type::base_type act = {{ terminal_type(channel_keyword.get_name(), severity_name) }}; | |
327 | return result_type(act); | |
328 | } | |
329 | ||
330 | //! \overload | |
331 | template< typename ChannelT, typename SeverityDescriptorT, template< typename > class ActorT > | |
332 | BOOST_FORCEINLINE channel_severity_filter_actor< ChannelT, typename SeverityDescriptorT::value_type, fallback_to_none, fallback_to_none, less, greater_equal, std::allocator< void >, ActorT > | |
333 | channel_severity_filter(attribute_name const& channel_name, attribute_keyword< SeverityDescriptorT, ActorT > const& severity_keyword) | |
334 | { | |
335 | 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; | |
336 | typedef typename result_type::terminal_type terminal_type; | |
337 | typename result_type::base_type act = {{ terminal_type(channel_name, severity_keyword.get_name()) }}; | |
338 | return result_type(act); | |
339 | } | |
340 | ||
341 | //! \overload | |
342 | template< typename ChannelDescriptorT, typename SeverityDescriptorT, template< typename > class ActorT > | |
343 | 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 > | |
344 | channel_severity_filter(attribute_keyword< ChannelDescriptorT, ActorT > const& channel_keyword, attribute_keyword< SeverityDescriptorT, ActorT > const& severity_keyword) | |
345 | { | |
346 | 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; | |
347 | typedef typename result_type::terminal_type terminal_type; | |
348 | typename result_type::base_type act = {{ terminal_type(channel_keyword.get_name(), severity_keyword.get_name()) }}; | |
349 | return result_type(act); | |
350 | } | |
351 | ||
352 | //! \overload | |
353 | template< typename SeverityT, typename ChannelT, typename ChannelFallbackT, typename ChannelTagT, template< typename > class ActorT > | |
354 | BOOST_FORCEINLINE channel_severity_filter_actor< ChannelT, SeverityT, ChannelFallbackT, fallback_to_none, less, greater_equal, std::allocator< void >, ActorT > | |
355 | channel_severity_filter(attribute_actor< ChannelT, ChannelFallbackT, ChannelTagT, ActorT > const& channel_placeholder, attribute_name const& severity_name) | |
356 | { | |
357 | typedef channel_severity_filter_actor< ChannelT, SeverityT, ChannelFallbackT, fallback_to_none, less, greater_equal, std::allocator< void >, ActorT > result_type; | |
358 | typedef typename result_type::terminal_type terminal_type; | |
359 | typename result_type::base_type act = {{ terminal_type(channel_placeholder.get_name(), severity_name, channel_placeholder.get_fallback_policy()) }}; | |
360 | return result_type(act); | |
361 | } | |
362 | ||
363 | //! \overload | |
364 | template< typename ChannelT, typename SeverityT, typename SeverityFallbackT, typename SeverityTagT, template< typename > class ActorT > | |
365 | BOOST_FORCEINLINE channel_severity_filter_actor< ChannelT, SeverityT, fallback_to_none, SeverityFallbackT, less, greater_equal, std::allocator< void >, ActorT > | |
366 | channel_severity_filter(attribute_name const& channel_name, attribute_actor< SeverityT, SeverityFallbackT, SeverityTagT, ActorT > const& severity_placeholder) | |
367 | { | |
368 | typedef channel_severity_filter_actor< ChannelT, SeverityT, fallback_to_none, SeverityFallbackT, less, greater_equal, std::allocator< void >, ActorT > result_type; | |
369 | typedef typename result_type::terminal_type terminal_type; | |
370 | typename result_type::base_type act = {{ terminal_type(channel_name, severity_placeholder.get_name(), fallback_to_none(), severity_placeholder.get_fallback_policy()) }}; | |
371 | return result_type(act); | |
372 | } | |
373 | ||
374 | //! \overload | |
375 | template< typename ChannelT, typename ChannelFallbackT, typename ChannelTagT, typename SeverityT, typename SeverityFallbackT, typename SeverityTagT, template< typename > class ActorT > | |
376 | BOOST_FORCEINLINE channel_severity_filter_actor< ChannelT, SeverityT, ChannelFallbackT, SeverityFallbackT, less, greater_equal, std::allocator< void >, ActorT > | |
377 | channel_severity_filter(attribute_actor< ChannelT, ChannelFallbackT, ChannelTagT, ActorT > const& channel_placeholder, attribute_actor< SeverityT, SeverityFallbackT, SeverityTagT, ActorT > const& severity_placeholder) | |
378 | { | |
379 | typedef channel_severity_filter_actor< ChannelT, SeverityT, ChannelFallbackT, SeverityFallbackT, less, greater_equal, std::allocator< void >, ActorT > result_type; | |
380 | typedef typename result_type::terminal_type terminal_type; | |
381 | 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()) }}; | |
382 | return result_type(act); | |
383 | } | |
384 | ||
385 | ||
386 | //! \overload | |
387 | template< typename ChannelT, typename SeverityT, typename SeverityCompareT > | |
388 | BOOST_FORCEINLINE channel_severity_filter_actor< ChannelT, SeverityT, fallback_to_none, fallback_to_none, less, SeverityCompareT > | |
389 | channel_severity_filter(attribute_name const& channel_name, attribute_name const& severity_name, SeverityCompareT const& severity_compare) | |
390 | { | |
391 | typedef channel_severity_filter_actor< ChannelT, SeverityT, fallback_to_none, fallback_to_none, less, SeverityCompareT > result_type; | |
392 | typedef typename result_type::terminal_type terminal_type; | |
393 | typename result_type::base_type act = {{ terminal_type(channel_name, severity_name, fallback_to_none(), fallback_to_none(), less(), severity_compare) }}; | |
394 | return result_type(act); | |
395 | } | |
396 | ||
397 | //! \overload | |
398 | template< typename SeverityT, typename ChannelDescriptorT, template< typename > class ActorT, typename SeverityCompareT > | |
399 | BOOST_FORCEINLINE channel_severity_filter_actor< typename ChannelDescriptorT::value_type, SeverityT, fallback_to_none, fallback_to_none, less, SeverityCompareT, std::allocator< void >, ActorT > | |
400 | channel_severity_filter(attribute_keyword< ChannelDescriptorT, ActorT > const& channel_keyword, attribute_name const& severity_name, SeverityCompareT const& severity_compare) | |
401 | { | |
402 | typedef channel_severity_filter_actor< typename ChannelDescriptorT::value_type, SeverityT, fallback_to_none, fallback_to_none, less, SeverityCompareT, std::allocator< void >, ActorT > result_type; | |
403 | typedef typename result_type::terminal_type terminal_type; | |
404 | typename result_type::base_type act = {{ terminal_type(channel_keyword.get_name(), severity_name, fallback_to_none(), fallback_to_none(), less(), severity_compare) }}; | |
405 | return result_type(act); | |
406 | } | |
407 | ||
408 | //! \overload | |
409 | template< typename ChannelT, typename SeverityDescriptorT, template< typename > class ActorT, typename SeverityCompareT > | |
410 | BOOST_FORCEINLINE channel_severity_filter_actor< ChannelT, typename SeverityDescriptorT::value_type, fallback_to_none, fallback_to_none, less, SeverityCompareT, std::allocator< void >, ActorT > | |
411 | channel_severity_filter(attribute_name const& channel_name, attribute_keyword< SeverityDescriptorT, ActorT > const& severity_keyword, SeverityCompareT const& severity_compare) | |
412 | { | |
413 | typedef channel_severity_filter_actor< ChannelT, typename SeverityDescriptorT::value_type, fallback_to_none, fallback_to_none, less, SeverityCompareT, std::allocator< void >, ActorT > result_type; | |
414 | typedef typename result_type::terminal_type terminal_type; | |
415 | typename result_type::base_type act = {{ terminal_type(channel_name, severity_keyword.get_name(), fallback_to_none(), fallback_to_none(), less(), severity_compare) }}; | |
416 | return result_type(act); | |
417 | } | |
418 | ||
419 | //! \overload | |
420 | template< typename ChannelDescriptorT, typename SeverityDescriptorT, template< typename > class ActorT, typename SeverityCompareT > | |
421 | 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 > | |
422 | channel_severity_filter(attribute_keyword< ChannelDescriptorT, ActorT > const& channel_keyword, attribute_keyword< SeverityDescriptorT, ActorT > const& severity_keyword, SeverityCompareT const& severity_compare) | |
423 | { | |
424 | 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; | |
425 | typedef typename result_type::terminal_type terminal_type; | |
426 | 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) }}; | |
427 | return result_type(act); | |
428 | } | |
429 | ||
430 | //! \overload | |
431 | template< typename SeverityT, typename ChannelT, typename ChannelFallbackT, typename ChannelTagT, template< typename > class ActorT, typename SeverityCompareT > | |
432 | BOOST_FORCEINLINE channel_severity_filter_actor< ChannelT, SeverityT, ChannelFallbackT, fallback_to_none, less, SeverityCompareT, std::allocator< void >, ActorT > | |
433 | channel_severity_filter(attribute_actor< ChannelT, ChannelFallbackT, ChannelTagT, ActorT > const& channel_placeholder, attribute_name const& severity_name, SeverityCompareT const& severity_compare) | |
434 | { | |
435 | typedef channel_severity_filter_actor< ChannelT, SeverityT, ChannelFallbackT, fallback_to_none, less, SeverityCompareT, std::allocator< void >, ActorT > result_type; | |
436 | typedef typename result_type::terminal_type terminal_type; | |
437 | 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) }}; | |
438 | return result_type(act); | |
439 | } | |
440 | ||
441 | //! \overload | |
442 | template< typename ChannelT, typename SeverityT, typename SeverityFallbackT, typename SeverityTagT, template< typename > class ActorT, typename SeverityCompareT > | |
443 | BOOST_FORCEINLINE channel_severity_filter_actor< ChannelT, SeverityT, fallback_to_none, SeverityFallbackT, less, SeverityCompareT, std::allocator< void >, ActorT > | |
444 | channel_severity_filter(attribute_name const& channel_name, attribute_actor< SeverityT, SeverityFallbackT, SeverityTagT, ActorT > const& severity_placeholder, SeverityCompareT const& severity_compare) | |
445 | { | |
446 | typedef channel_severity_filter_actor< ChannelT, SeverityT, fallback_to_none, SeverityFallbackT, less, SeverityCompareT, std::allocator< void >, ActorT > result_type; | |
447 | typedef typename result_type::terminal_type terminal_type; | |
448 | 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) }}; | |
449 | return result_type(act); | |
450 | } | |
451 | ||
452 | //! \overload | |
453 | template< typename ChannelT, typename ChannelFallbackT, typename ChannelTagT, typename SeverityT, typename SeverityFallbackT, typename SeverityTagT, template< typename > class ActorT, typename SeverityCompareT > | |
454 | BOOST_FORCEINLINE channel_severity_filter_actor< ChannelT, SeverityT, ChannelFallbackT, SeverityFallbackT, less, SeverityCompareT, std::allocator< void >, ActorT > | |
455 | 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 | { | |
457 | typedef channel_severity_filter_actor< ChannelT, SeverityT, ChannelFallbackT, SeverityFallbackT, less, SeverityCompareT, std::allocator< void >, ActorT > result_type; | |
458 | typedef typename result_type::terminal_type terminal_type; | |
459 | 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) }}; | |
460 | return result_type(act); | |
461 | } | |
462 | ||
463 | ||
464 | //! \overload | |
465 | template< typename ChannelT, typename SeverityT, typename SeverityCompareT, typename ChannelOrderT > | |
466 | BOOST_FORCEINLINE channel_severity_filter_actor< ChannelT, SeverityT, fallback_to_none, fallback_to_none, ChannelOrderT, SeverityCompareT > | |
467 | channel_severity_filter(attribute_name const& channel_name, attribute_name const& severity_name, SeverityCompareT const& severity_compare, ChannelOrderT const& channel_order) | |
468 | { | |
469 | typedef channel_severity_filter_actor< ChannelT, SeverityT, fallback_to_none, fallback_to_none, ChannelOrderT, SeverityCompareT > result_type; | |
470 | typedef typename result_type::terminal_type terminal_type; | |
471 | typename result_type::base_type act = {{ terminal_type(channel_name, severity_name, fallback_to_none(), fallback_to_none(), channel_order, severity_compare) }}; | |
472 | return result_type(act); | |
473 | } | |
474 | ||
475 | //! \overload | |
476 | template< typename SeverityT, typename ChannelDescriptorT, template< typename > class ActorT, typename SeverityCompareT, typename ChannelOrderT > | |
477 | BOOST_FORCEINLINE channel_severity_filter_actor< typename ChannelDescriptorT::value_type, SeverityT, fallback_to_none, fallback_to_none, ChannelOrderT, SeverityCompareT, std::allocator< void >, ActorT > | |
478 | channel_severity_filter(attribute_keyword< ChannelDescriptorT, ActorT > const& channel_keyword, attribute_name const& severity_name, SeverityCompareT const& severity_compare, ChannelOrderT const& channel_order) | |
479 | { | |
480 | typedef channel_severity_filter_actor< typename ChannelDescriptorT::value_type, SeverityT, fallback_to_none, fallback_to_none, ChannelOrderT, SeverityCompareT, std::allocator< void >, ActorT > result_type; | |
481 | typedef typename result_type::terminal_type terminal_type; | |
482 | typename result_type::base_type act = {{ terminal_type(channel_keyword.get_name(), severity_name, fallback_to_none(), fallback_to_none(), channel_order, severity_compare) }}; | |
483 | return result_type(act); | |
484 | } | |
485 | ||
486 | //! \overload | |
487 | template< typename ChannelT, typename SeverityDescriptorT, template< typename > class ActorT, typename SeverityCompareT, typename ChannelOrderT > | |
488 | BOOST_FORCEINLINE channel_severity_filter_actor< ChannelT, typename SeverityDescriptorT::value_type, fallback_to_none, fallback_to_none, ChannelOrderT, SeverityCompareT, std::allocator< void >, ActorT > | |
489 | channel_severity_filter(attribute_name const& channel_name, attribute_keyword< SeverityDescriptorT, ActorT > const& severity_keyword, SeverityCompareT const& severity_compare, ChannelOrderT const& channel_order) | |
490 | { | |
491 | typedef channel_severity_filter_actor< ChannelT, typename SeverityDescriptorT::value_type, fallback_to_none, fallback_to_none, ChannelOrderT, SeverityCompareT, std::allocator< void >, ActorT > result_type; | |
492 | typedef typename result_type::terminal_type terminal_type; | |
493 | typename result_type::base_type act = {{ terminal_type(channel_name, severity_keyword.get_name(), fallback_to_none(), fallback_to_none(), channel_order, severity_compare) }}; | |
494 | return result_type(act); | |
495 | } | |
496 | ||
497 | //! \overload | |
498 | template< typename ChannelDescriptorT, typename SeverityDescriptorT, template< typename > class ActorT, typename SeverityCompareT, typename ChannelOrderT > | |
499 | 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 > | |
500 | 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 | { | |
502 | 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; | |
503 | typedef typename result_type::terminal_type terminal_type; | |
504 | 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) }}; | |
505 | return result_type(act); | |
506 | } | |
507 | ||
508 | //! \overload | |
509 | template< typename SeverityT, typename ChannelT, typename ChannelFallbackT, typename ChannelTagT, template< typename > class ActorT, typename SeverityCompareT, typename ChannelOrderT > | |
510 | BOOST_FORCEINLINE channel_severity_filter_actor< ChannelT, SeverityT, ChannelFallbackT, fallback_to_none, ChannelOrderT, SeverityCompareT, std::allocator< void >, ActorT > | |
511 | 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 | { | |
513 | typedef channel_severity_filter_actor< ChannelT, SeverityT, ChannelFallbackT, fallback_to_none, ChannelOrderT, SeverityCompareT, std::allocator< void >, ActorT > result_type; | |
514 | typedef typename result_type::terminal_type terminal_type; | |
515 | 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) }}; | |
516 | return result_type(act); | |
517 | } | |
518 | ||
519 | //! \overload | |
520 | template< typename ChannelT, typename SeverityT, typename SeverityFallbackT, typename SeverityTagT, template< typename > class ActorT, typename SeverityCompareT, typename ChannelOrderT > | |
521 | BOOST_FORCEINLINE channel_severity_filter_actor< ChannelT, SeverityT, fallback_to_none, SeverityFallbackT, ChannelOrderT, SeverityCompareT, std::allocator< void >, ActorT > | |
522 | 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 | { | |
524 | typedef channel_severity_filter_actor< ChannelT, SeverityT, fallback_to_none, SeverityFallbackT, ChannelOrderT, SeverityCompareT, std::allocator< void >, ActorT > result_type; | |
525 | typedef typename result_type::terminal_type terminal_type; | |
526 | 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) }}; | |
527 | return result_type(act); | |
528 | } | |
529 | ||
530 | //! \overload | |
531 | template< typename ChannelT, typename ChannelFallbackT, typename ChannelTagT, typename SeverityT, typename SeverityFallbackT, typename SeverityTagT, template< typename > class ActorT, typename SeverityCompareT, typename ChannelOrderT > | |
532 | BOOST_FORCEINLINE channel_severity_filter_actor< ChannelT, SeverityT, ChannelFallbackT, SeverityFallbackT, ChannelOrderT, SeverityCompareT, std::allocator< void >, ActorT > | |
533 | 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 | { | |
535 | typedef channel_severity_filter_actor< ChannelT, SeverityT, ChannelFallbackT, SeverityFallbackT, ChannelOrderT, SeverityCompareT, std::allocator< void >, ActorT > result_type; | |
536 | typedef typename result_type::terminal_type terminal_type; | |
537 | 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) }}; | |
538 | return result_type(act); | |
539 | } | |
540 | ||
541 | } // namespace expressions | |
542 | ||
543 | BOOST_LOG_CLOSE_NAMESPACE // namespace log | |
544 | ||
545 | #ifndef BOOST_LOG_DOXYGEN_PASS | |
546 | ||
547 | namespace phoenix { | |
548 | ||
549 | namespace result_of { | |
550 | ||
551 | template< | |
552 | typename ChannelT, | |
553 | typename SeverityT, | |
554 | typename ChannelFallbackT, | |
555 | typename SeverityFallbackT, | |
556 | typename ChannelOrderT, | |
557 | typename SeverityCompareT, | |
558 | typename AllocatorT | |
559 | > | |
560 | struct is_nullary< custom_terminal< boost::log::expressions::channel_severity_filter_terminal< ChannelT, SeverityT, ChannelFallbackT, SeverityFallbackT, ChannelOrderT, SeverityCompareT, AllocatorT > > > : | |
561 | public mpl::false_ | |
562 | { | |
563 | }; | |
564 | ||
565 | } // namespace result_of | |
566 | ||
567 | } // namespace phoenix | |
568 | ||
569 | #endif | |
570 | ||
571 | } // namespace boost | |
572 | ||
573 | #include <boost/log/detail/footer.hpp> | |
574 | ||
575 | #endif // BOOST_LOG_EXPRESSIONS_PREDICATES_CHANNEL_SEVERITY_FILTER_HPP_INCLUDED_ |