Boost C++ Libraries

PrevUpHomeNext

Struct attribute

boost::log::attribute — A base class for an attribute.

Synopsis

// In header: <boost/log/attributes/attribute.hpp>


struct attribute {
  // construct/copy/destruct
  ~attribute();

  // public member functions
  shared_ptr< attribute_value > get_value();
};

Description

An attribute is basically a wrapper for some logic of values acquision. The sole purpose of an attribute is to return an actual value when requested. A simpliest attribute can always return the same value that it stores internally, but more complex species may perform a considirable amount of work to return a value, and their values may differ.

A word about thread safety. An attribute should be prepared to be requested a value from multiple threads concurrently.

attribute public construct/copy/destruct

  1. ~attribute();

    Destructor. Destroys the attribute.

attribute public member functions

  1. shared_ptr< attribute_value > get_value();

    Returns:

    The actual attribute value. It shall not return NULL (exceptions shall be used to indicate errors).


PrevUpHomeNext