VR-Forces 4.1.1 Class Documentation
Classes | Namespaces | Macros
DtStatsSet.h File Reference

Contains makVrv::DtStatsSet class. More...

Go to the source code of this file.

Classes

struct  makVrv::DtTimeStat
 Definition of a names set of timing samples. More...
class  makVrv::DtStatsSet
 Set of performance statistics for display. More...
class  makVrv::ScopedStatTimer
 Utility class for timing a scope block. More...

Namespaces

namespace  makVrv
 #include <vrvCoreQt/DtPersistenceControlsInterface.h>

Macros

#define DT_DECLARE_STATS_SET(name, id, stats_elements)
 Helper macro for creating DtStatsSets with an enum to index the contents.
#define DT_STATSSET_QUOTE(x)   #x
#define DT_STATSSET_ENUM(r, name, elem)   BOOST_PP_CAT(timer, BOOST_PP_CAT(_, BOOST_PP_CAT(name, BOOST_PP_CAT(_, elem)))),
#define DT_STATSSET_ADD(r, stats_set_ptr, elem)   stats_set_ptr->addStats(DT_STATSSET_QUOTE(elem));
#define DT_STATSSET_DECLARE_ENUM(name, seq)   enum TimerStats_##name { BOOST_PP_SEQ_FOR_EACH(DT_STATSSET_ENUM, name, seq) timer_##name##_end};
#define DT_SCOPED_STAT_TIMER(stats_element, stats_set_id, stats_set_ref)   ScopedStatTimer scopedStatTimer_##stats_element(timer_##stats_set_id##_##stats_element, stats_set_ref)
 Helper macro for creating ScopedStatTimer objects for a DtStatsSet created with the DT_DECLARE_STATS_SET macro.

Detailed Description

Contains makVrv::DtStatsSet class.

Macro Definition Documentation

#define DT_DECLARE_STATS_SET (   name,
  id,
  stats_elements 
)
Value:
DT_STATSSET_DECLARE_ENUM(id, stats_elements)\
\
void init##id##Stats(makVrv::DtPerformanceStatsManager& mgr)\
{\
static bool guard = false;\
guard = true;\
makVrv::DtStatsSet* id##_statsSet = new makVrv::DtStatsSet();\
id##_statsSet->myName = name;\
BOOST_PP_SEQ_FOR_EACH(DT_STATSSET_ADD, id##_statsSet, stats_elements)\
mgr.add(name, id##_statsSet);\
}\

Helper macro for creating DtStatsSets with an enum to index the contents.

Takes a display name for the new stats set, an identifier to name the stats enumeration, and a list of the stats items. Declares a stats set initialization function named init##id##Stats (with ##id## replaced by the passed in id) that must be called before using the stats set with a reference to a DtPerformanceStatsManager.

For example, to create a stats set to time methods "foo" and "bar" of the class MyClass, you might call: DT_DECLARE_STATS_SET("MyClass Stats", MyClass, (foo)(bar)) and then initialize the set by calling initMyClassStats(DtPerformanceStatsManager::instance(de));

See examplePerformanceStats for sample usage.

#define DT_STATSSET_QUOTE (   x)    #x
#define DT_STATSSET_ENUM (   r,
  name,
  elem 
)    BOOST_PP_CAT(timer, BOOST_PP_CAT(_, BOOST_PP_CAT(name, BOOST_PP_CAT(_, elem)))),
#define DT_STATSSET_ADD (   r,
  stats_set_ptr,
  elem 
)    stats_set_ptr->addStats(DT_STATSSET_QUOTE(elem));
#define DT_STATSSET_DECLARE_ENUM (   name,
  seq 
)    enum TimerStats_##name { BOOST_PP_SEQ_FOR_EACH(DT_STATSSET_ENUM, name, seq) timer_##name##_end};
#define DT_SCOPED_STAT_TIMER (   stats_element,
  stats_set_id,
  stats_set_ref 
)    ScopedStatTimer scopedStatTimer_##stats_element(timer_##stats_set_id##_##stats_element, stats_set_ref)

Helper macro for creating ScopedStatTimer objects for a DtStatsSet created with the DT_DECLARE_STATS_SET macro.


Document ID: Generated on Mon Apr 8 19:24:01 EDT 2013 from SVN revision 125877
Copyright © 2005-2013 VT MÄK. All Rights Reserved (www.mak.com)