VR-Exchange 2.6 API Documentation
Home
Modules
Namespaces
Classes
Files
Examples
Libraries
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
include
broker
frameTimer.h
Go to the documentation of this file.
1
/****************************************************************************
2
* Copyright (c) 2013 VT MAK
3
* All rights reserved.
4
****************************************************************************/
5
9
10
#pragma once
11
12
#include <
broker/dllExport.h
>
13
#include <vlutil/vlTime.h>
14
#include <map>
15
16
class
DtString
;
17
18
namespace
MAKVrExchange
19
{
20
21
class
DtPortalConnection;
22
23
class
DT_DLL_BROKER
DtFrameTimer
24
{
25
public
:
26
28
typedef
DtFrameTimer
* (*DtFrameTimerCreator)(
DtPortalConnection
* );
29
31
enum
FrameSectionType
32
{
33
FRAME
,
34
INTERNAL
,
35
EXTERNAL
,
36
MESSAGE_PROC
,
37
TRANSLATION
,
38
OUT_OF_FRAME
,
39
EXTERNAL_OTHER
,
40
FRAME_OTHER
,
41
USER_START
42
};
43
45
struct
SectionInfo
46
{
47
SectionInfo
()
48
: startTime( -1 )
49
, duration( -1 )
50
, avgDuration( 0 )
51
, avgPercent( 0 )
52
{
53
}
54
55
DtTime
startTime
;
// Time the last section started.
56
DtTime
duration
;
// Duration of the last section.
57
DtTime
avgDuration
;
// Avg duration of section (or sum so far if still processing).
58
double
avgPercent
;
// Avg percent of frame spent in section (or sum so far if still processing).
59
};
60
62
typedef
std::map<FrameSectionType,SectionInfo>
SectionInfoMap
;
63
64
public
:
65
70
static
DtFrameTimerCreator
theFrameTimerCreator
;
71
73
static
DtFrameTimer
* create(
DtPortalConnection
* portalConn );
74
76
virtual
~
DtFrameTimer
();
77
79
virtual
void
markFrameStart();
80
82
virtual
void
markFrameEnd();
83
85
virtual
void
markStart(
FrameSectionType
section );
86
88
virtual
void
markEnd(
FrameSectionType
section );
89
93
virtual
void
generateReport();
94
96
virtual
void
printFrameStatistics();
97
101
virtual
const
SectionInfoMap
& sectionInfo()
const
;
102
106
virtual
double
fps()
const
;
107
108
protected
:
109
111
DtFrameTimer
(
DtPortalConnection
* portalConn );
112
114
virtual
DtString
roundPercent(
double
percent );
115
116
protected
:
117
118
SectionInfoMap
mySectionInfo
;
119
120
unsigned
int
myFrameCounter
;
121
unsigned
int
myLastFrameCount
;
122
DtTime
myLastReportTime
;
123
double
myFps
;
124
125
DtPortalConnection
*
myPortalConn
;
126
127
};
128
129
}
Document ID: Generated on Wed Jan 30 18:15:18 EST 2019 from SVN revision 195534
Copyright © 2005-2019 VT MÄK. All Rights Reserved (
www.mak.com
)