...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 // Factory implementation. class impl : public attribute::impl { public: // construct/copy/destruct impl(value_type, value_type) noexcept; // public member functions virtual attribute_value get_value(); }; // construct/copy/destruct explicit counter(value_type = (value_type) 0, value_type = (value_type) 1); explicit counter(cast_source const &); // private member functions BOOST_STATIC_ASSERT_MSG(is_integral< T >::value, "Boost.Log: Only integral types are supported by the counter attribute"); };
This attribute acts as a counter - it returns a monotonously changing value each time requested. The attribute value type can be specified as a template parameter. The type must be an integral type.
counter
public
construct/copy/destructexplicit counter(value_type initial = (value_type) 0, value_type step = (value_type) 1);
Constructor
Parameters: |
|
explicit counter(cast_source const & source);
Constructor for casting support