VR-Forces 5.0.1 Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Classes | Namespaces | Macros
DtStatsSet.h File Reference

Go to the source code of this file.

Classes

struct  makVrv::DtTimeStat
 
class  makVrv::DtStatsSet
 
class  makVrv::ScopedStatTimer
 

Namespaces

 makVrv
 

Macros

#define DT_DECLARE_STATS_SET(name, id, stats_elements)
 
#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)
 

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);\
}\
Manager for sets of performance stats.
Definition: DtPerformanceStatsManager.h:28
Set of performance statistics for display.
Definition: DtStatsSet.h:65
#define DT_STATSSET_ADD(r, stats_set_ptr, elem)
Definition: DtStatsSet.h:53
DT_DLL_DEBUGDRAWRENDERER void init(makVrv::DtDe &de)
Work function for the plugin initialization.
#define DT_STATSSET_DECLARE_ENUM(name, seq)
Definition: DtStatsSet.h:54

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 Jun 20 00:38:30 EDT 2022 from SVN revision 244029
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)