...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::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 value_type; // A counter value type. // member classes/structs/unions // Base class for factory implementation. class impl : public attribute::impl { }; class impl_dec : public counter< T >::impl { public: // construct/copy/destruct explicit impl_dec(value_type); // public member functions attribute_value get_value(); }; class impl_generic : public counter< T >::impl { public: // construct/copy/destruct impl_generic(value_type, long); // public member functions attribute_value get_value(); }; class impl_inc : public counter< T >::impl { public: // construct/copy/destruct explicit impl_inc(value_type); // public member functions attribute_value get_value(); }; // construct/copy/destruct explicit counter(value_type = (value_type) 0, long = 1); explicit counter(cast_source const &); };
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 be an integral type of size no more than sizeof(long)
.
counter
public
construct/copy/destructexplicit counter(value_type initial = (value_type) 0, long step = 1);
Constructor
Parameters: |
|
explicit counter(cast_source const & source);
Constructor for casting support