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

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 &) noexcept;
  record_view(record_view &&) noexcept;
  record_view & operator=(record_view const &) noexcept;
  record_view & operator=(record_view &&) noexcept;
  ~record_view();

  // public member functions
  attribute_value_set const & attribute_values() const noexcept;
  bool operator==(record_view const &) const noexcept;
  bool operator!=(record_view const &) const noexcept;
  explicit operator bool() const noexcept;
  bool operator!() const noexcept;
  void swap(record_view &) noexcept;
  void reset() noexcept;
  attribute_value_set::mapped_type 
  operator[](attribute_value_set::key_type) const;
  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) noexcept;

    Copy constructor

  3. record_view(record_view && that) noexcept;

    Move constructor. Source record contents unspecified after the operation.

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

    Copy assignment

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

    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 noexcept;

    Requires:

    !!*this

    Returns:

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

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

    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 noexcept;

    Inequality comparison

    Parameters:

    that

    Comparand

    Returns:

    !(*this == that)

  4. explicit operator bool() const noexcept;

    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 noexcept;

    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) noexcept;

    Swaps two handles

    Parameters:

    that

    Another record to swap with Throws: Nothing

  7. void reset() noexcept;

    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. attribute_value_set::mapped_type 
    operator[](attribute_value_set::key_type name) const;

    Attribute value lookup.

    Parameters:

    name

    Attribute name.

    Returns:

    An attribute_value, non-empty if it is found, empty otherwise.

  9. 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