Boost  v1.57.0
doxygen for www.boost.org
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
boost::value_visitor_invoker< T, FallbackPolicyT > Singleton Reference

Generic attribute value visitor invoker. More...

#include <value_visitation_fwd.hpp>

Inheritance diagram for boost::value_visitor_invoker< T, FallbackPolicyT >:
Collaboration diagram for boost::value_visitor_invoker< T, FallbackPolicyT >:

Public Types

typedef T value_type
 Attribute value types. More...
 
typedef FallbackPolicyT fallback_policy
 Fallback policy. More...
 
typedef visitation_result result_type
 Function object result type. More...
 

Public Member Functions

 value_visitor_invoker (value_visitor_invoker const &that)
 Default constructor. More...
 
template<typename U >
 value_visitor_invoker (U const &arg)
 Initializing constructor. More...
 
template<typename VisitorT >
result_type operator() (attribute_value const &attr, VisitorT visitor) const
 Visitation operator. More...
 
template<typename VisitorT >
result_type operator() (attribute_name const &name, attribute_value_set const &attrs, VisitorT visitor) const
 Visitation operator. More...
 
template<typename VisitorT >
result_type operator() (attribute_name const &name, record const &rec, VisitorT visitor) const
 Visitation operator. More...
 
template<typename VisitorT >
result_type operator() (attribute_name const &name, record_view const &rec, VisitorT visitor) const
 Visitation operator. More...
 
fallback_policy const & get_fallback_policy () const
 

Detailed Description

template<typename T, typename FallbackPolicyT>
singleton boost::value_visitor_invoker< T, FallbackPolicyT >

Generic attribute value visitor invoker.

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.

Member Typedef Documentation

template<typename T, typename FallbackPolicyT>
typedef FallbackPolicyT boost::value_visitor_invoker< T, FallbackPolicyT >::fallback_policy

Fallback policy.

template<typename T, typename FallbackPolicyT>
typedef visitation_result boost::value_visitor_invoker< T, FallbackPolicyT >::result_type

Function object result type.

template<typename T, typename FallbackPolicyT>
typedef T boost::value_visitor_invoker< T, FallbackPolicyT >::value_type

Attribute value types.

Constructor & Destructor Documentation

template<typename T, typename FallbackPolicyT>
boost::value_visitor_invoker< T, FallbackPolicyT >::value_visitor_invoker ( value_visitor_invoker< T, FallbackPolicyT > const &  that)
inline

Default constructor.

Copy constructor

template<typename T, typename FallbackPolicyT>
template<typename U >
boost::value_visitor_invoker< T, FallbackPolicyT >::value_visitor_invoker ( U const &  arg)
inlineexplicit

Initializing constructor.

Parameters
argFallback policy argument

Member Function Documentation

template<typename T, typename FallbackPolicyT>
fallback_policy const& boost::value_visitor_invoker< T, FallbackPolicyT >::get_fallback_policy ( ) const
inline
template<typename T, typename FallbackPolicyT>
template<typename VisitorT >
result_type boost::value_visitor_invoker< T, FallbackPolicyT >::operator() ( attribute_value const &  attr,
VisitorT  visitor 
) const
inline

Visitation operator.

Attempts to acquire the stored value of one of the supported types. If acquisition succeeds, the value is passed to visitor.

Parameters
attrAn attribute value to apply the visitor to.
visitorA receiving function object to pass the attribute value to.
Returns
The result of visitation.

Referenced by boost::value_visitor_invoker< channel_value_type, channel_fallback_policy >::operator()().

template<typename T, typename FallbackPolicyT>
template<typename VisitorT >
result_type boost::value_visitor_invoker< T, FallbackPolicyT >::operator() ( attribute_name const &  name,
attribute_value_set const &  attrs,
VisitorT  visitor 
) const
inline

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
nameAttribute value name.
attrsA set of attribute values in which to look for the specified attribute value.
visitorA receiving function object to pass the attribute value to.
Returns
The result of visitation.
template<typename T, typename FallbackPolicyT>
template<typename VisitorT >
result_type boost::value_visitor_invoker< T, FallbackPolicyT >::operator() ( attribute_name const &  name,
record const &  rec,
VisitorT  visitor 
) const
inline

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
nameAttribute value name.
recA log record. The attribute value will be sought among those associated with the record.
visitorA receiving function object to pass the attribute value to.
Returns
The result of visitation.
template<typename T, typename FallbackPolicyT>
template<typename VisitorT >
result_type boost::value_visitor_invoker< T, FallbackPolicyT >::operator() ( attribute_name const &  name,
record_view const &  rec,
VisitorT  visitor 
) const
inline

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
nameAttribute value name.
recA log record view. The attribute value will be sought among those associated with the record.
visitorA receiving function object to pass the attribute value to.
Returns
The result of visitation.

The documentation for this singleton was generated from the following file: