...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
boost::log::record_view — Logging record view class.
// In header: <boost/log/core/record_view.hpp> class record_view { public: // construct/copy/destruct record_view(); 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; };
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/destructrecord_view();
Default constructor. Creates an empty record view that is equivalent to the invalid record handle.
Postconditions: |
|
record_view(record_view const & that) noexcept;
Copy constructor
record_view(record_view && that) noexcept;
Move constructor. Source record contents unspecified after the operation.
record_view & operator=(record_view const & that) noexcept;
Copy assignment
record_view & operator=(record_view && that) noexcept;
Move assignment. Source record contents unspecified after the operation.
~record_view();
Destructor. Destroys the record, releases any sinks and attribute values that were involved in processing this record.
record_view
public member functionsattribute_value_set const & attribute_values() const noexcept;
Requires: |
|
Returns: |
A reference to the set of attribute values attached to this record |
bool operator==(record_view const & that) const noexcept;
Equality comparison
Parameters: |
|
||
Returns: |
|
bool operator!=(record_view const & that) const noexcept;
Inequality comparison
Parameters: |
|
||
Returns: |
|
explicit operator bool() const noexcept;
Conversion to an unspecified boolean type
Returns: |
|
bool operator!() const noexcept;
Inverted conversion to an unspecified boolean type
Returns: |
|
void swap(record_view & that) noexcept;
Swaps two handles
Parameters: |
|
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: |
|
attribute_value_set::mapped_type operator[](attribute_value_set::key_type name) const;
Attribute value lookup.
Parameters: |
|
||
Returns: |
An |
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: |
|
||
Returns: |
A |