boost::log::value_visitor_invoker — Generic attribute value visitor invoker.
// In header: <boost/log/attributes/value_visitation.hpp> template<typename T, typename FallbackPolicyT> class value_visitor_invoker : private FallbackPolicyT { public: // types typedef T value_type; // Attribute value types. typedef FallbackPolicyT fallback_policy; // Fallback policy. typedef visitation_result result_type; // Function object result type. // construct/copy/destruct value_visitor_invoker() = default; value_visitor_invoker(value_visitor_invoker const &); template<typename U> explicit value_visitor_invoker(U const &); // public member functions template<typename VisitorT> result_type operator()(attribute_value const &, VisitorT) const; template<typename VisitorT> result_type operator()(attribute_name const &, attribute_value_set const &, VisitorT) const; template<typename VisitorT> result_type operator()(attribute_name const &, record const &, VisitorT) const; template<typename VisitorT> result_type operator()(attribute_name const &, record_view const &, VisitorT) const; fallback_policy const & get_fallback_policy() const; };
Attribute value invoker is a functional object that attempts to find and extract the stored attribute value from the attribute value view or a log record. The extracted value is passed to an unary function object (the visitor) provided by user.
The invoker can be specialized on one or several attribute value types that should be specified in the second template argument.
value_visitor_invoker
public
construct/copy/destructvalue_visitor_invoker() = default;
Default constructor
value_visitor_invoker(value_visitor_invoker const & that);
Copy constructor
template<typename U> explicit value_visitor_invoker(U const & arg);
Initializing constructor
Parameters: |
|
value_visitor_invoker
public member functionstemplate<typename VisitorT> result_type operator()(attribute_value const & attr, VisitorT visitor) const;
Visitation operator. Attempts to acquire the stored value of one of the supported types. If acquisition succeeds, the value is passed to visitor.
Parameters: |
|
||||
Returns: |
The result of visitation. |
template<typename VisitorT> result_type operator()(attribute_name const & name, attribute_value_set const & attrs, VisitorT visitor) const;
Visitation operator. Looks for an attribute value with the specified name and tries to acquire the stored value of one of the supported types. If acquisition succeeds, the value is passed to visitor.
Parameters: |
|
||||||
Returns: |
The result of visitation. |
template<typename VisitorT> result_type operator()(attribute_name const & name, record const & rec, VisitorT visitor) const;
Visitation operator. Looks for an attribute value with the specified name and tries to acquire the stored value of one of the supported types. If acquisition succeeds, the value is passed to visitor.
Parameters: |
|
||||||
Returns: |
The result of visitation. |
template<typename VisitorT> result_type operator()(attribute_name const & name, record_view const & rec, VisitorT visitor) const;
Visitation operator. Looks for an attribute value with the specified name and tries to acquire the stored value of one of the supported types. If acquisition succeeds, the value is passed to visitor.
Parameters: |
|
||||||
Returns: |
The result of visitation. |
fallback_policy const & get_fallback_policy() const;
Returns: |
Fallback policy |