Boost C++ Libraries

PrevUpHomeNext

Class template basic_record

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

Synopsis

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

template<typename CharT> 
class basic_record {
public:
  // types
  typedef CharT                                    char_type;         // Character type. 
  typedef basic_core< char_type >                  core_type;         // Logging core type. 
  typedef std::basic_string< char_type >           string_type;       // String type to be used as a message text holder. 
  typedef basic_attribute_values_view< char_type > values_view_type;  // Attribute values view type. 

  // construct/copy/destruct
  basic_record();
  explicit basic_record(record_handle const &);
  ~basic_record();

  // public member functions
  record_handle handle() const;
  values_view_type const & attribute_values() const;
  string_type & message();
  string_type const & message() const;
  bool operator==(basic_record const &) const;
  bool operator!=(basic_record const &) const;
  bool operator!() const;
  void swap(basic_record &);
  void reset();
  void detach_from_thread();
};

Description

The logging record incapsulates all information related to a single logging statement, in particular, attribute values view and the log message string.

basic_record public construct/copy/destruct

  1. basic_record();

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

    Postconditions:

    !*this == true

  2. explicit basic_record(record_handle const & rec);

    Conversion from a record handle. Adopts the record referenced by the handle.

    Parameters:
    rec

    The record handle being adopted

    Requires:

    The handle, if valid, have been issued by the logging core with the same character type as the record being constructed.

    Postconditions:

    this->handle() == rec

  3. ~basic_record();

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

basic_record public member functions

  1. record_handle handle() const;

    Returns:

    The handle to the record

  2. values_view_type const & attribute_values() const;

    Requires:

    !!*this

    Returns:

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

  3. string_type & message();

    Requires:

    !!*this

    Returns:

    A reference to the log record message string

  4. string_type const & message() const;

    Requires:

    !!*this

    Returns:

    A reference to the log record message string

  5. bool operator==(basic_record const & that) const;

    Equality comparison

    Parameters:
    that

    Comparand

    Returns:

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

  6. bool operator!=(basic_record const & that) const;

    Inequality comparison

    Parameters:
    that

    Comparand

    Returns:

    !(*this == that)

  7. bool operator!() const;

    Conversion to an unspecified boolean type

    Inverted conversion to an unspecified boolean type

    Returns:

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

    Returns:

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

  8. void swap(basic_record & that);

    Swaps two handles

    Parameters:
    that

    Another record to swap with Throws: Nothing

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

  10. void detach_from_thread();

    The function ensures that the log record does not depend on any thread-specific data.

    Requires:

    !!*this


PrevUpHomeNext