VR-Forces 4.6 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
vrvUtil
DtInMemoryProfiler.h
Go to the documentation of this file.
1
/*********************************************************************************
2
** Copyright (c) 2017 MAK Technologies, Inc.
3
** All rights reserved.
4
*********************************************************************************/
5
9
10
#pragma once
11
12
#include <
vrvUtil/vrvUtil.h
>
13
14
#include <string>
15
#include <deque>
16
17
class
DtTimedSection;
18
19
namespace
makVrv
20
{
21
class
DtSampleAggregator;
22
25
class
DT_DLL_VRVUTIL
DtInMemoryProfiler
26
{
27
public
:
30
static
std::size_t calculateNumberOfSamples(
float
estimatedFrequency,
float
estimatedRunTimeSeconds);
31
35
DtInMemoryProfiler
();
36
38
~
DtInMemoryProfiler
();
39
40
void
init
(std::size_t numOfSamples,
const
std::string& fileName);
41
43
std::size_t numSamples()
const
;
44
46
void
start();
47
49
void
stop();
50
52
void
reset();
53
56
bool
dumped()
const
;
57
58
// dump stats and force a dump of the underlying data; called if stopping and not dumped()
59
void
dump();
60
63
bool
valid()
const
;
64
65
protected
:
66
68
void
dumpStats();
69
70
DtTimedSection*
myTimer
;
71
DtSampleAggregator
*
myAggregator
;
72
bool
myStarted
;
73
};
74
75
class
DT_DLL_VRVUTIL
DtInMemoryProfilerHelper
76
{
77
public
:
78
DtInMemoryProfilerHelper
(std::size_t numOfSamples,
const
std::string& fileName);
79
80
void
addProfile(
double
fStart,
double
fEndAt);
81
void
clearProfiles(
void
);
82
83
void
profilerPre(
double
elapsedTime);
84
void
profilerPost();
85
private
:
86
DtInMemoryProfiler
myProfiler
;
87
88
struct
ProfileData
89
{
90
ProfileData
()
91
: myStartAt(0), myEndAt(0), myLoggedStart(false), myDumped(false), myID(0) {}
92
double
myStartAt
;
93
double
myEndAt
;
94
bool
myLoggedStart
;
95
bool
myDumped
;
96
std::size_t
myID
;
97
};
98
99
typedef
std::deque<ProfileData>
Profiles
;
100
Profiles
myProfiles
;
101
102
bool
myIsProfiling
;
103
};
104
}
105
Document ID: Generated on Thu Apr 12 03:15:37 EDT 2018 from SVN revision 187986
Copyright © 2005-2018 VT MÄK. All Rights Reserved (
www.mak.com
)