boost::log::attributes::counter — A class of an attribute that counts an integral value.
// In header: <boost/log/attributes/counter.hpp> template<typename T> class counter : public attribute { public: // types typedef T held_type; // A held counter type. // construct/copy/destruct explicit counter(held_type const & = held_type(), long = 1); // public member functions shared_ptr< attribute_value > get_value(); };
This type of attribute acts as a counter, that is, it returns a monotonously changing value each time requested. The attribute value type can be specified as a template parameter. However, the type must support basic arithmetic operations, such as addition and substraction.
counter
public member functionsshared_ptr< attribute_value > get_value();
Returns: | The actual attribute value. It shall not return NULL (exceptions shall be used to indicate errors). |