16 #include <vlutil/vlPerformanceStats.h>
17 #include <boost/preprocessor/seq/for_each.hpp>
18 #include <boost/preprocessor/facilities/expand.hpp>
38 #define DT_DECLARE_STATS_SET(name, id, stats_elements)\
39 DT_STATSSET_DECLARE_ENUM(id, stats_elements)\
41 void init##id##Stats(makVrv::DtPerformanceStatsManager& mgr)\
43 static bool guard = false;\
45 makVrv::DtStatsSet* id##_statsSet = new makVrv::DtStatsSet();\
46 id##_statsSet->myName = name;\
47 BOOST_PP_SEQ_FOR_EACH(DT_STATSSET_ADD, id##_statsSet, stats_elements)\
48 mgr.add(name, id##_statsSet);\
51 #define DT_STATSSET_QUOTE(x) #x
52 #define DT_STATSSET_ENUM(r, name, elem) BOOST_PP_CAT(timer, BOOST_PP_CAT(_, BOOST_PP_CAT(name, BOOST_PP_CAT(_, elem)))),
53 #define DT_STATSSET_ADD(r, stats_set_ptr, elem) stats_set_ptr->addStats(DT_STATSSET_QUOTE(elem));
54 #define DT_STATSSET_DECLARE_ENUM(name, seq) enum TimerStats_##name { BOOST_PP_SEQ_FOR_EACH(DT_STATSSET_ENUM, name, seq) timer_##name##_end};
69 void addStats(
const std::string& name);
79 void endFrame(
double frameDuration);
84 void addTime(
unsigned int index,
double t);
115 #define DT_SCOPED_STAT_TIMER(stats_element, stats_set_id, stats_set_ref)\
116 ScopedStatTimer scopedStatTimer_##stats_element(timer_##stats_set_id##_##stats_element, stats_set_ref)
std::vector< DtTimeStat > myStats
Definition: DtStatsSet.h:86
std::string myName
Definition: DtStatsSet.h:90
Utility class for timing a scope block.
Definition: DtStatsSet.h:98
unsigned int myIndex
Definition: DtStatsSet.h:110
Set of performance statistics for display.
Definition: DtStatsSet.h:65
double myTotalTime
Definition: DtStatsSet.h:87
DtPerformanceStats myStatsTimer
Definition: DtStatsSet.h:89
std::string myDescription
Definition: DtStatsSet.h:59
makVrv::DtStatsSet & myStatsSet
Definition: DtStatsSet.h:109
#define DT_DLL_VRVCORE
Definition: vrvCore.h:20
std::vector< double > myPerFrameStats
Definition: DtStatsSet.h:88
Definition of a names set of timing samples.
Definition: DtStatsSet.h:57
DtTimeStatistic myStatistic
Definition: DtStatsSet.h:60
DtTimedSection myTimedSection
Definition: DtStatsSet.h:108
Contains DLL export macros.