rpa::binary_function_count< Ftor > Class Template Reference

#include <functional.h>

List of all members.

Public Types

typedef Ftor::result_type result_type
typedef Ftor::first_argument_type first_argument_type
typedef Ftor::second_argument_type second_argument_type

Public Member Functions

 binary_function_count ()
result_type operator() (const first_argument_type &aX, const second_argument_type &aY)
bool operator== (const binary_function_count &aUFC) const

Private Types

typedef atomic< size_t > atom_type
 This atomic type used a a counter of function calls.

Private Attributes

atom_type::atomic_type _cnt


Detailed Description

template<class Ftor>
class rpa::binary_function_count< Ftor >

Counts the number of times that a functor was called. This allows to check that algorithms work correctly : Typically, a functor must be called once per input element, whatever the number of threads is, or if the algorithm is called sequentially. Therefore, we can have a better proof that at the end of a parallel computation, things worked properly.


Member Typedef Documentation

template<class Ftor>
typedef atomic<size_t> rpa::binary_function_count< Ftor >::atom_type [private]

This atomic type used a a counter of function calls.

template<class Ftor>
typedef Ftor::first_argument_type rpa::binary_function_count< Ftor >::first_argument_type

template<class Ftor>
typedef Ftor::result_type rpa::binary_function_count< Ftor >::result_type

template<class Ftor>
typedef Ftor::second_argument_type rpa::binary_function_count< Ftor >::second_argument_type


Constructor & Destructor Documentation

template<class Ftor>
rpa::binary_function_count< Ftor >::binary_function_count (  )  [inline]

The same functor may be called simultaneously by several threads. Therefore the need of an atomic counter.


Member Function Documentation

template<class Ftor>
result_type rpa::binary_function_count< Ftor >::operator() ( const first_argument_type aX,
const second_argument_type aY 
) [inline]

template<class Ftor>
bool rpa::binary_function_count< Ftor >::operator== ( const binary_function_count< Ftor > &  aUFC  )  const [inline]


Member Data Documentation

template<class Ftor>
atom_type::atomic_type rpa::binary_function_count< Ftor >::_cnt [private]


The documentation for this class was generated from the following file:
Generated on Tue Sep 25 10:20:38 2007 for rpa by  doxygen 1.4.7