Tomographer  v1.0a
Tomographer C++ Framework Documentation
Tomographer::MultipleMHRWStatsCollectors< MHRWStatsCollectors > Class Template Reference

A simple MHRWStatsCollector interface which combines several stats collectors. More...

#include <tomographer/mhrw.h>

Public Types

typedef std::tuple< MHRWStatsCollectors &...> MHRWStatsCollectorsRefTupleType
 
typedef std::tuple< MHRWStatsCollectors...> MHRWStatsCollectorsTupleType
 

Public Member Functions

 MultipleMHRWStatsCollectors (MHRWStatsCollectors &...statscollectors_)
 
template<int I>
const std::tuple_element< I, MHRWStatsCollectorsTupleType >::type & getStatsCollector ()
 

Static Public Attributes

static constexpr int NumStatColl = sizeof...(MHRWStatsCollectors)
 The number of stats collectors we are tracking.
 

Detailed Description

template<typename... MHRWStatsCollectors>
class Tomographer::MultipleMHRWStatsCollectors< MHRWStatsCollectors >

A simple MHRWStatsCollector interface which combines several stats collectors.

A MHRandomWalk object expects one instance of a MHRWStatsCollector (see MHRWStatsCollector Interface); in case you wish to provide several stats collectors, you should use a MultipleMHRWStatsCollectors instance which combines all your preferred stats collectors.

The obscure variadic templating of this class should not scare you—it's relatively straightforward to use:

// some stat collectors
MyStatCollector1 statcoll1(..);
MyStatCollector2 statcoll2(..);
MyStatCollector3 statcoll3(..);
// we combine them into one single "stat collector interface", which we can then
// give as argument to the MHRandomWalk object:
MultipleMHRWStatsCollectors<MyStatCollector1,MyStatCollector2,MyStatCollector3>
multistatcollector(statcoll1, statcoll2, statcoll3);
MHRandomWalk<...> myrandomwalk(..., multistatcollector,...);
// now, the random walk will call the callbacks in `multistatcollector', which
// will relay the callbacks to all the given stat collectors `statcoll*'.

The number of stat collectors that were defined is accessible through the constant enumeration value NumStatColl.

Definition at line 583 of file mhrw.h.


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