DamBreak++ Wave Simulator 0.3
DamBreak++ Simulation Framework
Loading...
Searching...
No Matches
dbpp::callCounter< CB > Class Template Reference

Generic class that wraps and counts calls of an arbitrary callback. More...

#include <dbpp_SimulationUtilities.hpp>

Public Member Functions

 callCounter (CB aCallBack)
 Ctor enables deduction of calback type as the template parameter.
template<typename ... Args>
decltype(auto) operator() (Args &&...args)
 call function
long count () const
 Counter.

Private Attributes

CB m_callBack
long m_count {}
std::atomic_long m_parCounter {}

Detailed Description

template<typename CB>
class dbpp::callCounter< CB >

Generic class that wraps and counts calls of an arbitrary callback.

Template Parameters
CBcallback function type NOTE Can instantiate with the type of a lambda (the closure type of a lambda) callCounter<TypeOfTheLambda>

Constructor & Destructor Documentation

◆ callCounter()

template<typename CB>
dbpp::callCounter< CB >::callCounter ( CB aCallBack)
inline

Ctor enables deduction of calback type as the template parameter.

Parameters
aCallBackcallback function to be called

Member Function Documentation

◆ count()

template<typename CB>
long dbpp::callCounter< CB >::count ( ) const
inline

Counter.

Returns
number of calls

◆ operator()()

template<typename CB>
template<typename ... Args>
decltype(auto) dbpp::callCounter< CB >::operator() ( Args &&... args)
inline

call function

Template Parameters
...Argsparameter pack
Parameters
...argspack expansion
Returns
callback function callback

Member Data Documentation

◆ m_callBack

template<typename CB>
CB dbpp::callCounter< CB >::m_callBack
private

callnack function

◆ m_count

template<typename CB>
long dbpp::callCounter< CB >::m_count {}
private

counter

◆ m_parCounter

template<typename CB>
std::atomic_long dbpp::callCounter< CB >::m_parCounter {}
private

parallel execution


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