]>
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> | |
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> | |
37 | ||
38 | #ifdef BOOST_HAS_PRAGMA_ONCE | |
39 | #pragma once | |
40 | #endif | |
41 | ||
42 | namespace boost { | |
43 | ||
44 | BOOST_LOG_OPEN_NAMESPACE | |
45 | ||
46 | namespace expressions { | |
47 | ||
48 | template< | |
49 | typename ChannelT, | |
50 | typename SeverityT, | |
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 > | |
56 | > | |
57 | class channel_severity_filter_terminal | |
58 | { | |
59 | public: | |
60 | #ifndef BOOST_LOG_DOXYGEN_PASS | |
61 | //! Internal typedef for type categorization | |
62 | typedef void _is_boost_log_terminal; | |
63 | #endif | |
64 | ||
65 | //! Function result type | |
66 | typedef bool result_type; | |
67 | ||
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; | |
76 | ||
77 | private: | |
78 | //! Channel to severity mapping type | |
79 | typedef std::map< | |
80 | channel_value_type, | |
81 | severity_value_type, | |
82 | ChannelOrderT, | |
83 | typename AllocatorT::BOOST_NESTED_TEMPLATE rebind< std::pair< const channel_value_type, severity_value_type > >::other | |
84 | > mapping_type; | |
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; | |
89 | ||
90 | //! Channel visitor | |
91 | template< typename ArgT > | |
92 | struct channel_visitor | |
93 | { | |
94 | typedef void result_type; | |
95 | ||
96 | channel_visitor(channel_severity_filter_terminal const& self, ArgT arg, bool& res) : m_self(self), m_arg(arg), m_res(res) | |
97 | { | |
98 | } | |
99 | ||
100 | result_type operator() (channel_value_type const& channel) const | |
101 | { | |
102 | m_self.visit_channel(channel, m_arg, m_res); | |
103 | } | |
104 | ||
105 | private: | |
106 | channel_severity_filter_terminal const& m_self; | |
107 | ArgT m_arg; | |
108 | bool& m_res; | |
109 | }; | |
110 | ||
111 | //! Severity level visitor | |
112 | struct severity_visitor | |
113 | { | |
114 | typedef void result_type; | |
115 | ||
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) | |
117 | { | |
118 | } | |
119 | ||
120 | result_type operator() (severity_value_type const& severity) const | |
121 | { | |
122 | m_self.visit_severity(severity, m_severity, m_res); | |
123 | } | |
124 | ||
125 | private: | |
126 | channel_severity_filter_terminal const& m_self; | |
127 | severity_value_type const& m_severity; | |
128 | bool& m_res; | |
129 | }; | |
130 | ||
131 | private: | |
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; | |
140 | ||
141 | //! Channel to severity level mapping | |
142 | mapping_type m_mapping; | |
143 | //! Severity checking predicate | |
144 | SeverityCompareT m_severity_compare; | |
145 | ||
146 | //! Default result | |
147 | bool m_default; | |
148 | ||
149 | public: | |
150 | //! Initializing constructor | |
151 | channel_severity_filter_terminal | |
152 | ( | |
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() | |
159 | ) : | |
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), | |
166 | m_default(false) | |
167 | { | |
168 | } | |
169 | ||
170 | //! Adds a new element to the mapping | |
171 | void add(channel_value_type const& channel, severity_value_type const& severity) | |
172 | { | |
173 | typedef typename mapping_type::iterator iterator; | |
174 | std::pair< iterator, bool > res = m_mapping.insert(typename mapping_type::value_type(channel, severity)); | |
175 | if (!res.second) | |
176 | res.first->second = severity; | |
177 | } | |
178 | ||
179 | //! Sets the default result of the predicate | |
180 | void set_default(bool def) | |
181 | { | |
182 | m_default = def; | |
183 | } | |
184 | ||
185 | //! Invokation operator | |
186 | template< typename ContextT > | |
187 | result_type operator() (ContextT const& ctx) const | |
188 | { | |
189 | result_type res = m_default; | |
190 | ||
191 | typedef typename remove_cv< | |
192 | typename remove_reference< typename phoenix::result_of::env< ContextT >::type >::type | |
193 | >::type env_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()); | |
197 | ||
198 | m_channel_visitor_invoker(m_channel_name, arg, channel_visitor< arg_type >(*this, arg, res)); | |
199 | ||
200 | return res; | |
201 | } | |
202 | ||
203 | private: | |
204 | //! Visits channel name | |
205 | template< typename ArgT > | |
206 | void visit_channel(channel_value_type const& channel, ArgT const& arg, bool& res) const | |
207 | { | |
208 | typename mapping_type::const_iterator it = m_mapping.find(channel); | |
209 | if (it != m_mapping.end()) | |
210 | { | |
211 | m_severity_visitor_invoker(m_severity_name, arg, severity_visitor(*this, it->second, res)); | |
212 | } | |
213 | } | |
214 | ||
215 | //! Visits severity level | |
216 | void visit_severity(severity_value_type const& left, severity_value_type const& right, bool& res) const | |
217 | { | |
218 | res = m_severity_compare(left, right); | |
219 | } | |
220 | }; | |
221 | ||
222 | template< | |
223 | typename ChannelT, | |
224 | typename SeverityT, | |
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 | |
231 | > | |
232 | class channel_severity_filter_actor : | |
233 | public ActorT< channel_severity_filter_terminal< ChannelT, SeverityT, ChannelFallbackT, SeverityFallbackT, ChannelOrderT, SeverityCompareT, AllocatorT > > | |
234 | { | |
235 | private: | |
236 | //! Self type | |
237 | typedef channel_severity_filter_actor this_type; | |
238 | ||
239 | public: | |
240 | //! Terminal type | |
241 | typedef channel_severity_filter_terminal< ChannelT, SeverityT, ChannelFallbackT, SeverityFallbackT, ChannelOrderT, SeverityCompareT, AllocatorT > terminal_type; | |
242 | //! Base actor type | |
243 | typedef ActorT< terminal_type > base_type; | |
244 | ||
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; | |
253 | ||
254 | private: | |
255 | //! An auxiliary pseudo-reference to implement insertion through subscript operator | |
256 | class subscript_result | |
257 | { | |
258 | private: | |
259 | channel_severity_filter_actor& m_owner; | |
260 | channel_value_type const& m_channel; | |
261 | ||
262 | public: | |
263 | subscript_result(channel_severity_filter_actor& owner, channel_value_type const& channel) : m_owner(owner), m_channel(channel) | |
264 | { | |
265 | } | |
266 | ||
267 | void operator= (severity_value_type const& severity) | |
268 | { | |
269 | m_owner.add(m_channel, severity); | |
270 | } | |
271 | }; | |
272 | ||
273 | public: | |
274 | //! Initializing constructor | |
275 | explicit channel_severity_filter_actor(base_type const& act) : base_type(act) | |
276 | { | |
277 | } | |
278 | //! Copy constructor | |
279 | channel_severity_filter_actor(channel_severity_filter_actor const& that) : base_type(static_cast< base_type const& >(that)) | |
280 | { | |
281 | } | |
282 | ||
283 | //! Sets the default function result | |
284 | this_type& set_default(bool def) | |
285 | { | |
286 | this->proto_expr_.child0.set_default(def); | |
287 | return *this; | |
288 | } | |
289 | ||
290 | //! Adds a new element to the mapping | |
291 | this_type& add(channel_value_type const& channel, severity_value_type const& severity) | |
292 | { | |
293 | this->proto_expr_.child0.add(channel, severity); | |
294 | return *this; | |
295 | } | |
296 | ||
297 | //! Alternative interface for adding a new element to the mapping | |
298 | subscript_result operator[] (channel_value_type const& channel) | |
299 | { | |
300 | return subscript_result(*this, channel); | |
301 | } | |
302 | }; | |
303 | ||
304 | /*! | |
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. | |
307 | */ | |
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) | |
311 | { | |
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); | |
316 | } | |
317 | ||
318 | //! \overload | |
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) | |
322 | { | |
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); | |
327 | } | |
328 | ||
329 | //! \overload | |
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) | |
333 | { | |
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); | |
338 | } | |
339 | ||
340 | //! \overload | |
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) | |
344 | { | |
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); | |
349 | } | |
350 | ||
351 | //! \overload | |
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) | |
355 | { | |
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); | |
360 | } | |
361 | ||
362 | //! \overload | |
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) | |
366 | { | |
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); | |
371 | } | |
372 | ||
373 | //! \overload | |
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) | |
377 | { | |
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); | |
382 | } | |
383 | ||
384 | ||
385 | //! \overload | |
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) | |
389 | { | |
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); | |
394 | } | |
395 | ||
396 | //! \overload | |
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) | |
400 | { | |
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); | |
405 | } | |
406 | ||
407 | //! \overload | |
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) | |
411 | { | |
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); | |
416 | } | |
417 | ||
418 | //! \overload | |
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) | |
422 | { | |
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); | |
427 | } | |
428 | ||
429 | //! \overload | |
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) | |
433 | { | |
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); | |
438 | } | |
439 | ||
440 | //! \overload | |
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) | |
444 | { | |
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); | |
449 | } | |
450 | ||
451 | //! \overload | |
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) | |
455 | { | |
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); | |
460 | } | |
461 | ||
462 | ||
463 | //! \overload | |
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) | |
467 | { | |
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); | |
472 | } | |
473 | ||
474 | //! \overload | |
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) | |
478 | { | |
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); | |
483 | } | |
484 | ||
485 | //! \overload | |
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) | |
489 | { | |
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); | |
494 | } | |
495 | ||
496 | //! \overload | |
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) | |
500 | { | |
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); | |
505 | } | |
506 | ||
507 | //! \overload | |
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) | |
511 | { | |
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); | |
516 | } | |
517 | ||
518 | //! \overload | |
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) | |
522 | { | |
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); | |
527 | } | |
528 | ||
529 | //! \overload | |
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) | |
533 | { | |
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); | |
538 | } | |
539 | ||
540 | } // namespace expressions | |
541 | ||
542 | BOOST_LOG_CLOSE_NAMESPACE // namespace log | |
543 | ||
544 | #ifndef BOOST_LOG_DOXYGEN_PASS | |
545 | ||
546 | namespace phoenix { | |
547 | ||
548 | namespace result_of { | |
549 | ||
550 | template< | |
551 | typename ChannelT, | |
552 | typename SeverityT, | |
553 | typename ChannelFallbackT, | |
554 | typename SeverityFallbackT, | |
555 | typename ChannelOrderT, | |
556 | typename SeverityCompareT, | |
557 | typename AllocatorT | |
558 | > | |
559 | struct is_nullary< custom_terminal< boost::log::expressions::channel_severity_filter_terminal< ChannelT, SeverityT, ChannelFallbackT, SeverityFallbackT, ChannelOrderT, SeverityCompareT, AllocatorT > > > : | |
560 | public mpl::false_ | |
561 | { | |
562 | }; | |
563 | ||
564 | } // namespace result_of | |
565 | ||
566 | } // namespace phoenix | |
567 | ||
568 | #endif | |
569 | ||
570 | } // namespace boost | |
571 | ||
572 | #include <boost/log/detail/footer.hpp> | |
573 | ||
574 | #endif // BOOST_LOG_EXPRESSIONS_PREDICATES_CHANNEL_SEVERITY_FILTER_HPP_INCLUDED_ |