10 #ifndef __PION_PIONCOUNTER_HEADER__
11 #define __PION_PIONCOUNTER_HEADER__
13 #include <pion/PionConfig.hpp>
14 #include <boost/cstdint.hpp>
15 #include <boost/thread/mutex.hpp>
29 boost::mutex::scoped_lock counter_lock(m_mutex);
35 boost::mutex::scoped_lock counter_lock(m_mutex);
40 template <
typename IntegerType>
41 inline void add(
const IntegerType& n) {
42 boost::mutex::scoped_lock counter_lock(m_mutex);
47 template <
typename IntegerType>
49 boost::mutex::scoped_lock counter_lock(m_mutex);
54 template <
typename IntegerType>
55 inline void assign(
const IntegerType& n) {
56 boost::mutex::scoped_lock counter_lock(m_mutex);
84 template <
typename IntegerType>
88 template <
typename IntegerType>
92 template <
typename IntegerType>
96 template <
typename IntegerType>
100 template <
typename IntegerType>
104 template <
typename IntegerType>
108 template <
typename IntegerType>
112 template <
typename IntegerType>
127 boost::mutex m_mutex;
130 boost::uint64_t m_value;
bool operator==(const IntegerType &n) const
compares an integer value to the counter
const PionCounter & operator=(const PionCounter &c)
assignment operator
bool operator>=(const IntegerType &n) const
compares an integer value to the counter
const PionCounter & operator-=(const IntegerType &n)
subtracts integer value from the counter
const PionCounter & operator++(void)
prefix increment
PionCounter(unsigned long n=0)
default constructor initializes counter
boost::uint64_t getValue(void) const
returns the value of the counter
void increment(void)
increments the value of the counter
bool operator>(const IntegerType &n) const
compares an integer value to the counter
void add(const IntegerType &n)
adds a value to the counter
void decrement(void)
decrement the value of the counter
const PionCounter & operator=(const IntegerType &n)
assigns integer value to the counter
void subtract(const IntegerType &n)
subtracts a value from the counter
void assign(const IntegerType &n)
assigns a new value to the counter
void reset(void)
resets the counter to zero
PionCounter(const PionCounter &c)
copy constructor
const PionCounter & operator+=(const IntegerType &n)
adds integer value to the counter
const PionCounter & operator--(void)
prefix decrement
bool operator<(const IntegerType &n) const
compares an integer value to the counter
bool operator<=(const IntegerType &n) const
compares an integer value to the counter
virtual ~PionCounter()
virtual destructor: class may be extended