## Class template value_visitor_invoker

boost::log::value_visitor_invoker — Generic attribute value visitor invoker.

## Synopsis

    // In header: <boost/log/attributes/value_visitation_fwd.hpp>

    template<typename T, typename FallbackPolicyT>
    class value_visitor_invoker : private FallbackPolicyT {
    public:

      // public member functions
      value_visitor_invoker() = default;
      value_visitor_invoker(value_visitor_invoker const &);
      template<typename U> explicit value_visitor_invoker(U const &);
      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;
    };

## Description

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 a 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 member functions

1.     value_visitor_invoker() = default;

   Default constructor

2.     value_visitor_invoker(value_visitor_invoker const & that);

   Copy constructor

3.     template<typename U> explicit value_visitor_invoker(U const & arg);

   Initializing constructor

   Parameters: |
   `arg` | Fallback policy argument

4.     template<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: |
   `attr` | An attribute value to apply the visitor to.
   `visitor` | A receiving function object to pass the attribute value to.
   Returns: | The result of visitation.

5.     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: |
   `name` | Attribute value name.
   `attrs` | A set of attribute values in which to look for the specified attribute value.
   `visitor` | A receiving function object to pass the attribute value to.
   Returns: | The result of visitation.

6.     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: |
   `name` | Attribute value name.
   `rec` | A log record. The attribute value will be sought among those associated with the record.
   `visitor` | A receiving function object to pass the attribute value to.
   Returns: | The result of visitation.

7.     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: |
   `name` | Attribute value name.
   `rec` | A log record view. The attribute value will be sought among those associated with the record.
   `visitor` | A receiving function object to pass the attribute value to.
   Returns: | The result of visitation.

8.     fallback_policy const & get_fallback_policy() const;

   Returns: | Fallback policy