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 for the latest Boost documentation.
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 ValueT, typename FunT = less> 
class attribute_value_ordering : private less {
public:
  // types
  typedef bool   result_type;  // Result type. 
  typedef ValueT value_type;   // Compared attribute value type. 

  // member classes/structs/unions

  struct l1_visitor {
    // types
    typedef void result_type;

    // construct/copy/destruct
    l1_visitor(attribute_value_ordering const &, record_view const &, bool &);

    // public member functions
    template<typename LeftT> result_type operator()(LeftT const &) const;
  };
  template<typename LeftT> 
  struct l2_visitor {
    // types
    typedef void result_type;

    // construct/copy/destruct
    l2_visitor(FunT const &, LeftT const &, bool &);

    // public member functions
    template<typename RightT> result_type operator()(RightT const &) const;
  };

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

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

Description

This predicate allows to order log records based on values of a specifically 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. explicit attribute_value_ordering(attribute_name 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_view const & left, record_view const & right) const;

    Ordering operator


PrevUpHomeNext