amino::Counter< Num_Type, copier_num > Class Template Reference

#include <counter.h>

List of all members.

Public Member Functions

 Counter ()
void increment (int rand)
 increment the count by '1'
void increment (int rand, int value)
 increment the count by value.
void decrement (int rand)
 decrement the count by '1'
void decrement (int rand, int value)
 decrement the count by value.
Num_Type load ()
 This will return the total count. The result might be inaccurate if parallel execution occured. In such case, it's possible for this method to return value that never appears in any moment.
void store (Num_Type value)
 This method set the counter to certain value. The result is inaccurate if parallel execution occured.

template<typename Num_Type, int copier_num>
class amino::Counter< Num_Type, copier_num >


Constructor & Destructor Documentation

template<typename Num_Type, int copier_num>
amino::Counter< Num_Type, copier_num >::Counter (  )  [inline]


Member Function Documentation

template<typename Num_Type, int copier_num>
void amino::Counter< Num_Type, copier_num >::increment ( int  rand  )  [inline]

increment the count by '1'

Parameters:
rand a random number which helps to choose a random slot to operate

template<typename Num_Type, int copier_num>
void amino::Counter< Num_Type, copier_num >::increment ( int  rand,
int  value 
) [inline]

increment the count by value.

Parameters:
rand a random number which helps to choose a random slot to operate
value operation arguments

Two shif operation to avoid common patter which can cause performance problem.

template<typename Num_Type, int copier_num>
void amino::Counter< Num_Type, copier_num >::decrement ( int  rand  )  [inline]

decrement the count by '1'

Parameters:
rand a random number which helps to choose a random slot to operate

template<typename Num_Type, int copier_num>
void amino::Counter< Num_Type, copier_num >::decrement ( int  rand,
int  value 
) [inline]

decrement the count by value.

Parameters:
rand a random number which helps to choose a random slot to operate
value operation arguments

template<typename Num_Type, int copier_num>
Num_Type amino::Counter< Num_Type, copier_num >::load (  )  [inline]

This will return the total count. The result might be inaccurate if parallel execution occured. In such case, it's possible for this method to return value that never appears in any moment.

template<typename Num_Type, int copier_num>
void amino::Counter< Num_Type, copier_num >::store ( Num_Type  value  )  [inline]

This method set the counter to certain value. The result is inaccurate if parallel execution occured.

Parameters:
value The new value of counter


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

Generated on Tue Dec 9 13:39:39 2008 for Amino by  doxygen 1.5.6