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 record_view

boost::log::record_view — Logging record view class.

Synopsis

// In header: <boost/log/core/record_view.hpp>


class record_view {
public:
  // construct/copy/destruct
  record_view() = default;
  record_view(record_view const &);
  record_view(record_view &&);
  record_view& operator=(record_view const &);
  record_view& operator=(record_view &&);
  ~record_view();

  // public member functions
  attribute_value_set const & attribute_values() const;
  bool operator==(record_view const &) const;
  bool operator!=(record_view const &) const;
  explicit operator bool() const;
  bool operator!() const;
  void swap(record_view &);
  void reset();
  template<typename DescriptorT, template< typename > class ActorT> 
    result_of::extract< typename expressions::attribute_keyword< DescriptorT, ActorT >::value_type, DescriptorT >::type 
    operator[](expressions::attribute_keyword< DescriptorT, ActorT > const &) const;
};

Description

The logging record encapsulates all information related to a single logging statement, in particular, attribute values view and the log message string. The view is immutable, it is implemented as a wrapper around a reference-counted implementation.

record_view public construct/copy/destruct

  1. record_view() = default;

    Default constructor. Creates an empty record view that is equivalent to the invalid record handle.

    Postconditions:

    !*this == true

  2. record_view(record_view const & that);

    Copy constructor

  3. record_view(record_view && that);

    Move constructor. Source record contents unspecified after the operation.

  4. record_view& operator=(record_view const & that);

    Copy assignment

  5. record_view& operator=(record_view && that);

    Move assignment. Source record contents unspecified after the operation.

  6. ~record_view();

    Destructor. Destroys the record, releases any sinks and attribute values that were involved in processing this record.

record_view public member functions

  1. attribute_value_set const & attribute_values() const;

    Requires:

    !!*this

    Returns:

    A reference to the set of attribute values attached to this record

  2. bool operator==(record_view const & that) const;

    Equality comparison

    Parameters:

    that

    Comparand

    Returns:

    true if both *this and that identify the same log record or both do not identify any record, false otherwise.

  3. bool operator!=(record_view const & that) const;

    Inequality comparison

    Parameters:

    that

    Comparand

    Returns:

    !(*this == that)

  4. explicit operator bool() const;

    Conversion to an unspecified boolean type

    Returns:

    true, if the *this identifies a log record, false, if the *this is not valid

  5. bool operator!() const;

    Inverted conversion to an unspecified boolean type

    Returns:

    false, if the *this identifies a log record, true, if the *this is not valid

  6. void swap(record_view & that);

    Swaps two handles

    Parameters:

    that

    Another record to swap with Throws: Nothing

  7. void reset();

    Resets the log record handle. If there are no other handles left, the log record is closed and all resources referenced by the record are released.

    Postconditions:

    !*this == true

  8. template<typename DescriptorT, template< typename > class ActorT> 
      result_of::extract< typename expressions::attribute_keyword< DescriptorT, ActorT >::value_type, DescriptorT >::type 
      operator[](expressions::attribute_keyword< DescriptorT, ActorT > const & keyword) const;

    Attribute value lookup.

    Parameters:

    keyword

    Attribute keyword.

    Returns:

    A value_ref with extracted attribute value if it is found, empty value_ref otherwise.


PrevUpHomeNext