VR-Forces 4.6.1 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtProfiler.h
Go to the documentation of this file.
1 /*********************************************************************************
2 ** Copyright (c) 2015 MAK Technologies, Inc.
3 ** All rights reserved.
4 *********************************************************************************/
5 
10 
11 #pragma once
12 
13 #include <vrvUtil/vrvUtil.h>
15 
16 #include <boost/type_traits/integral_constant.hpp>
17 
18 //easy to use macro to profile a section
19 #define DtPROFILE_RESTRICTED(name, target) makVrv::DtProfileTarget<target> _profileTarget##line(name);
20 #define DtPROFILE(name) DtPROFILE_X(name, __LINE__)
21 #define DtPROFILE_X(name, line) DtPROFILE_ACTUAL(name, line)
22 #define DtPROFILE_ACTUAL(name, line) makVrv::DtProfileSample _profileSample##line(name);
23 #define DtPROFILE_FUNCTION(name, func) {makVrv::DtProfileSample _profileSample(name); (func);}
24 #define DtPROFILE_SECTION(name) { makVrv::DtProfileSample _profileSample(name);
25 #define DtPROFILE_SECTION_END }
26 
27 #define DtPERFORMANCE_STAT(name) DtPERFORMANCE_STAT_X(name, __LINE__)
28 #define DtPERFORMANCE_STAT_X(name, line) DtPERFORMANCE_STAT_ACTUAL(name, line)
29 #define DtPERFORMANCE_STAT_ACTUAL(name, line) makVrv::DtPerfomanceStatSample _performanceStatSample##line(name);
30 
31 
32 // These constants configure DtPROFILE_RESTRICTED
33 //
34 // Define them to boost::true_type to enable profiling of those sections
35 const bool Profile_DtSceneObjectUpdater = false;
37 const bool Profile_DtOsgCullVisitor = false;
38 
39 namespace makVrv
40 {
46  {
47  public:
49  DtProfileSample(const char* name )
50  {
52  }
53 
56  {
58  }
59  };
60 
65  template <bool Enabled>
67  {
68  DtProfileTarget(const char* name) {}
69  };
70 
71  template <>
72  struct DtProfileTarget<true>
73  {
75  DtProfileTarget(const char* name )
76  {
78  }
79 
82  {
84  }
85  };
86 
92  {
93  public:
95  DtPerfomanceStatSample(const char* name )
96  {
98  }
99 
102  {
104  }
105  };
106 }
107 

Document ID: Generated on Wed Jul 25 16:57:45 EDT 2018 from SVN revision 190790
Copyright © 2005-2018 VT MÄK. All Rights Reserved (www.mak.com)