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 a snapshot of the master branch, built from commit 3a0bce0744.
PrevUpHomeNext

Class record

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

Synopsis

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


class record {
public:
  // construct/copy/destruct
  record() noexcept;
  record(record &&) noexcept;
  record & operator=(record &&) noexcept;
  ~record();

  // public member functions
  attribute_value_set & attribute_values() noexcept;
  attribute_value_set const  & attribute_values() const noexcept;
  explicit operator bool() const noexcept;
  bool operator!() const noexcept;
  void swap(record &) 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;
  record_view lock();
};

Description

The logging record encapsulates all information related to a single logging statement, in particular, attribute values view and the log message string. The record can be updated before pushing for further processing to the logging core.

record public construct/copy/destruct

  1. record() noexcept;

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

    Postconditions:

    !*this == true

  2. record(record && that) noexcept;

    Move constructor. Source record contents unspecified after the operation.

  3. record & operator=(record && that) noexcept;

    Move assignment. Source record contents unspecified after the operation.

  4. ~record();

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

record public member functions

  1. attribute_value_set & attribute_values() noexcept;

    Requires:

    !!*this

    Returns:

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

  2. attribute_value_set const  & attribute_values() const noexcept;

    Requires:

    !!*this

    Returns:

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

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

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

  5. void swap(record & that) noexcept;

    Swaps two handles

    Parameters:

    that

    Another record to swap with Throws: Nothing

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

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

  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.

  9. record_view lock();

    The function ensures that the log record does not depend on any thread-specific data. Then the record contents are used to construct a record_view which is returned from the function. The record is no longer valid after the call.

    Requires:

    !!*this

    Postconditions:

    !*this

    Returns:

    The record view that contains all attribute values from the original record.


PrevUpHomeNext