Boost  v1.57.0
doxygen for www.boost.org
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
boost::attributes::counter< T > Class Template Reference

A class of an attribute that counts an integral value. More...

#include <counter.hpp>

Inheritance diagram for boost::attributes::counter< T >:
Collaboration diagram for boost::attributes::counter< T >:

Classes

class  impl
 Base class for factory implementation. More...
 
class  impl_dec
 
class  impl_generic
 
class  impl_inc
 

Public Types

typedef T value_type
 A counter value type. More...
 

Public Member Functions

 counter (value_type initial=(value_type) 0, long step=1)
 Constructor. More...
 
 counter (cast_source const &source)
 Constructor for casting support. More...
 
bool operator! () const BOOST_NOEXCEPT
 Verifies that the factory is not in empty state. More...
 
attribute_value get_value () const
 
void swap (attribute &that) BOOST_NOEXCEPT
 The method swaps two factories (i.e. More...
 

Protected Member Functions

implget_impl () const BOOST_NOEXCEPT
 
void set_impl (intrusive_ptr< impl > p) BOOST_NOEXCEPT
 Sets the pointer to the factory implementation. More...
 

Detailed Description

template<typename T>
class boost::attributes::counter< T >

A class of an attribute that counts an integral 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 be an integral type of size no more than sizeof(long).

Member Typedef Documentation

template<typename T >
typedef T boost::attributes::counter< T >::value_type

A counter value type.

Constructor & Destructor Documentation

template<typename T >
boost::attributes::counter< T >::counter ( value_type  initial = (value_type)0,
long  step = 1 
)
inlineexplicit

Constructor.

Parameters
initialInitial value of the counter
stepChanging step of the counter. Each value acquired from the attribute will be greater than the previous one to this amount.

References boost::attribute::set_impl().

template<typename T >
boost::attributes::counter< T >::counter ( cast_source const &  source)
inlineexplicit

Constructor for casting support.

Member Function Documentation

attribute_value boost::attribute::get_value ( ) const
inherited
Returns
The actual attribute value. It shall not return empty values (exceptions shall be used to indicate errors).
bool boost::attribute::operator! ( ) const
inlineinherited

Verifies that the factory is not in empty state.

Verifies that the factory is in empty state

void boost::attribute::set_impl ( intrusive_ptr< impl p)
inlineprotectedinherited

Sets the pointer to the factory implementation.

Parameters
pPointer to the implementation. Must not be NULL.

References boost::multiprecision::backends::p, and boost::intrusive_ptr< T >::swap().

Referenced by boost::attributes::counter< T >::counter().

void boost::attribute::swap ( attribute that)
inlineinherited

The documentation for this class was generated from the following file: