Boost C++ Libraries

PrevUpHomeNext

Class template flt_has_attr

boost::log::filters::flt_has_attr — A filter that detects if there is an attribute with given name and type in the attribute values view.

Synopsis

// In header: <boost/log/filters/has_attr.hpp>

template<typename CharT, typename AttributeValueTypesT = void> 
class flt_has_attr :
  public basic_filter< CharT, flt_has_attr< CharT, AttributeValueTypesT > >
{
public:
  // types
  typedef base_type::values_view_type values_view_type;  // Attribute values container type. 
  typedef base_type::char_type        char_type;         // Char type. 
  typedef base_type::string_type      string_type;       // String type. 

  // construct/copy/destruct
  explicit flt_has_attr(string_type const &);

  // public member functions
  bool operator()(values_view_type const &) const;
};

Description

The filter can be instantiated either with one particular attribute value type or with a sequence of types.

flt_has_attr public construct/copy/destruct

  1. explicit flt_has_attr(string_type const & name);

    Constructs the filter

    Parameters:
    name

    Attribute name

flt_has_attr public member functions

  1. bool operator()(values_view_type const & values) const;

    Applies the filter

    Parameters:
    values

    A set of attribute values of a single log record

    Returns:

    true if the log record contains the sought attribute value, false otherwise


PrevUpHomeNext