VR-Forces 4.5 Class Documentation
Home
Modules
Namespaces
Classes
Files
Examples
Behavior Models
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
include
vrvUtil
DtInMemoryProfiler.h
Go to the documentation of this file.
1
/*********************************************************************************
2
** Copyright (c) 2015 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 <fstream>
16
#include <deque>
17
18
class
DtTimedSection;
19
20
namespace
makVrv
21
{
24
class
DT_DLL_VRVUTIL
DtInMemoryProfiler
25
{
26
public
:
29
static
std::size_t calculateNumberOfSamples(
float
estimatedFrequency,
float
estimatedRunTimeSeconds);
30
35
DtInMemoryProfiler
(std::size_t numOfSamples,
const
std::string& fileName);
36
38
~
DtInMemoryProfiler
();
39
41
std::size_t numSamples(
void
)
const
;
42
44
void
start();
45
47
void
stop();
48
50
void
reset();
51
54
bool
dumped(
void
)
const
;
55
57
void
dump();
58
61
bool
valid()
const
;
62
private
:
63
std::string
myFileName
;
64
65
const
std::size_t
myNumSamples
;
66
std::size_t
myCurrentSample
;
67
double
*
mySamples
;
68
69
bool
isValid
;
70
71
DtTimedSection*
myTimer
;
72
73
std::ofstream
myDumpFile
;
74
bool
myDumped
;
75
};
76
77
class
DT_DLL_VRVUTIL
DtInMemoryProfilerHelper
78
{
79
public
:
80
DtInMemoryProfilerHelper
(std::size_t numOfSamples,
const
std::string& fileName);
81
82
void
addProfile(
double
fStart,
double
fEndAt);
83
void
clearProfiles(
void
);
84
85
void
profilerPre(
double
elapsedTime);
86
void
profilerPost();
87
private
:
88
DtInMemoryProfiler
myProfiler
;
89
90
struct
ProfileData
91
{
92
ProfileData
()
93
: myStartAt(0), myEndAt(0), myLoggedStart(false), myDumped(false), myID(0) {}
94
double
myStartAt
;
95
double
myEndAt
;
96
bool
myLoggedStart
;
97
bool
myDumped
;
98
std::size_t
myID
;
99
};
100
101
typedef
std::deque<ProfileData>
Profiles
;
102
Profiles
myProfiles
;
103
104
bool
myIsProfiling
;
105
};
106
}
107
Document ID: Generated on Thu Mar 23 18:54:12 EDT 2017 from SVN revision 174804
Copyright © 2005-2017 VT MÄK. All Rights Reserved (
www.mak.com
)