VR-Forces 4.7 Class Documentation
Home
Modules
Namespaces
Classes
Files
Examples
Behavior Models
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Groups
Pages
include
vrfutil
profiler.h
Go to the documentation of this file.
1
/*********************************************************************************
2
** Copyright (c) 2014 MAK Technologies, Inc.
3
** All rights reserved.
4
*********************************************************************************/
5
10
11
#pragma once
12
13
#include "
vrfutil/vrfutilDefines.h
"
14
#include "
vrfutil/profileManager.h
"
15
16
#include <boost/type_traits/integral_constant.hpp>
17
18
//easy to use macro to profile a section, only active in profile or debug builds
19
#define DtVRF_PROFILE_RESTRICTED(name, target) makVrf::DtProfileTarget<target> _profileTarget##line(name);
20
#define DtVRF_PROFILE(name) DtVRF_PROFILE_X(name, __LINE__, makVrf::DtProfileNode::ENONE)
21
#define DtVRF_PROFILE_FILE(name) DtVRF_PROFILE_X(name, __LINE__, makVrf::DtProfileNode::EVIRTUAL)
22
#define DtVRF_PROFILE_X(name, line, attr) DtVRF_PROFILE_ACTUAL(name, line, attr)
23
#define DtVRF_PROFILE_ACTUAL(name, line, attr) makVrf::DtProfileSample _profileSample##line(name, attr);
24
25
namespace
makVrf
26
{
31
class
DT_DLL_vrfutil
DtProfileSample
32
{
33
public
:
35
explicit
DtProfileSample
(
36
const
char
* name = 0,
DtProfileNode::Attributes
=
DtProfileNode::ENONE
);
37
explicit
DtProfileSample
(
38
const
std::string& n,
DtProfileNode::Attributes
=
DtProfileNode::ENONE
);
39
41
~
DtProfileSample
();
42
43
private
:
44
bool
enabled
;
45
const
char
*
name
;
46
const
DtProfileNode::Attributes
attr
;
47
DtProfileTimestamp
start
;
48
};
49
54
template
<
bool
Enabled>
55
class
DtProfileTarget
56
{
57
public
:
58
explicit
DtProfileTarget
(
59
const
char
* name = 0,
60
DtProfileNode::Attributes
=
DtProfileNode::ENONE
) {}
61
62
void
reset
(
const
char
* = 0) {}
63
};
64
65
template
<>
66
class
DtProfileTarget
<true> :
public
DtProfileSample
67
{
68
public
:
70
explicit
DtProfileTarget
(
71
const
char
* name = 0,
72
DtProfileNode::Attributes
attr =
DtProfileNode::ENONE
)
73
:
DtProfileSample
(name, attr) { }
74
};
75
}
76
Document ID: Generated on Fri Apr 26 21:53:14 EDT 2019 from SVN revision 197883
Copyright © 2005-2019 VT MAK. All Rights Reserved (
www.mak.com
)