Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

This is the documentation for an old version of Boost. Click here to view this page for the latest version.
PrevUpHomeNext

Class template attribute_actor

boost::log::expressions::attribute_actor

Synopsis

// In header: <boost/log/expressions/attr.hpp>

template<typename T, typename FallbackPolicyT, typename TagT, 
         template< typename > class ActorT> 
class attribute_actor :
  public ActorT< attribute_terminal< T, FallbackPolicyT, TagT > >
{
public:
  // types
  typedef TagT                                                               tag_type;              // Attribute tag type. 
  typedef FallbackPolicyT                                                    fallback_policy;       // Fallback policy. 
  typedef attribute_terminal< T, fallback_policy, tag_type >                 terminal_type;         // Base terminal type. 
  typedef terminal_type::value_type                                          value_type;            // Attribute value type. 
  typedef ActorT< terminal_type >                                            base_type;             // Base actor type. 
  typedef attribute_actor< value_type, fallback_to_none, tag_type, ActorT >  or_none_result_type;   // Expression with cached attribute name. 
  typedef attribute_actor< value_type, fallback_to_throw, tag_type, ActorT > or_throw_result_type;  // Expression with cached attribute name. 

  // construct/copy/destruct
  explicit attribute_actor(base_type const &);

  // public member functions
  attribute_name get_name() const;
  fallback_policy const & get_fallback_policy() const;
  or_none_result_type or_none() const;
  or_throw_result_type or_throw() const;
  template<typename DefaultT> 
    attribute_actor< value_type, fallback_to_default< DefaultT >, tag_type, ActorT > 
    or_default(DefaultT const &) const;
};

Description

An attribute value extraction terminal actor

attribute_actor public construct/copy/destruct

  1. explicit attribute_actor(base_type const & act);
    Initializing constructor.

attribute_actor public member functions

  1. attribute_name get_name() const;

    Returns:

    The attribute name

  2. fallback_policy const & get_fallback_policy() const;

    Returns:

    Fallback policy

  3. or_none_result_type or_none() const;
    Generates an expression that extracts the attribute value or a default value.
  4. or_throw_result_type or_throw() const;
    Generates an expression that extracts the attribute value or throws an exception.
  5. template<typename DefaultT> 
      attribute_actor< value_type, fallback_to_default< DefaultT >, tag_type, ActorT > 
      or_default(DefaultT const & def_val) const;
    Generates an expression that extracts the attribute value or a default value.

PrevUpHomeNext