Boost C++ Libraries

PrevUpHomeNext

Class template attribute_value_ordering

boost::log::attribute_value_ordering — Ordering predicate, based on attribute values associated with records.

Synopsis

// In header: <boost/log/utility/record_ordering.hpp>

template<typename CharT, typename ValueT, typename FunT = aux::less> 
class attribute_value_ordering {
public:
  // types
  typedef bool                      result_type;           // Result type. 
  typedef CharT                     char_type;             // Character type. 
  typedef basic_record< char_type > record_type;           // Log record type. 
  typedef record_type::string_type  string_type;           // String type. 
  typedef ValueT                    attribute_value_type;  // Compared attribute value type. 

  // construct/copy/destruct
  attribute_value_ordering(string_type const &, FunT const & = FunT());

  // public member functions
  result_type operator()(record_type const &, record_type const &) const;
};

Description

This predicate allows to order log records based on values of a specificly named attribute associated with them. Two given log records being compared should both have the specified attribute value of the specified type to be able to be ordered properly. As a special case, if neither of the records have the value, these records are considered equivalent. Otherwise, the ordering results are unspecified.

attribute_value_ordering public construct/copy/destruct

  1. attribute_value_ordering(string_type const & name, FunT const & fun = FunT());

    Initializing constructor.

    Parameters:
    fun

    The ordering functor

    name

    The attribute value name to be compared

attribute_value_ordering public member functions

  1. result_type operator()(record_type const & left, record_type const & right) const;

    Ordering operator


PrevUpHomeNext