CFx SDK Documentation  2022 SP0
OdPerfTimer.h
Go to the documentation of this file.
1 // Copyright (C) 2002-2017, Open Design Alliance (the "Alliance").
3 // All rights reserved.
4 //
5 // This software and its documentation and related materials are owned by
6 // the Alliance. The software may only be incorporated into application
7 // programs owned by members of the Alliance, subject to a signed
8 // Membership Agreement and Supplemental Software License Agreement with the
9 // Alliance. The structure and organization of this software are the valuable
10 // trade secrets of the Alliance and its suppliers. The software is also
11 // protected by copyright law and international treaty provisions. Application
12 // programs incorporating this software must include the following statement
13 // with their copyright notices:
14 //
15 // This application incorporates Teigha(R) software pursuant to a license
16 // agreement with Open Design Alliance.
17 // Teigha(R) Copyright (C) 2002-2017 by Open Design Alliance.
18 // All rights reserved.
19 //
20 // By use of this software, its documentation or related materials, you
21 // acknowledge and accept the above terms.
23 
24 // AMark : PerfTest timing classes
25 
26 #ifndef _OdPerfTimer_INCLUDED_
27 #define _OdPerfTimer_INCLUDED_
28 
29 
30 #include "OdPlatformSettings.h"
31 #include "TD_PackPush.h"
32 
39 {
40  protected:
41  struct InternalData
42  {
46  OdUInt8 flags[4];
48  : started(0)
49  , stopped(0)
50  , freq(0)
51  {
52  flags[0] = flags[1] = flags[2] = flags[3] = 0;
53  }
54  } gData;
56  public:
57  OdPerfTimerBase() : data(&gData) { }
58 
59  virtual ~OdPerfTimerBase() { }
60  virtual void initialize() = 0;
61  virtual void destroy() = 0;
65  virtual void clear() = 0;
69  virtual void start() = 0;
73  virtual void stop() = 0;
77  virtual double countedSec() = 0;
81  virtual OdUInt32 countedMSec() = 0;
85  virtual double permanentSec() = 0;
89  virtual OdUInt32 permanentMSec() = 0;
93  virtual bool isStarted() = 0;
94 
96  static void destroyTiming(OdPerfTimerBase *ptr);
97 };
98 
105 {
107  OdPerfTimerWrapper& operator=(const OdPerfTimerWrapper& );
108  OdPerfTimerBase* m_pTimer;
109 public:
110 
112  {
113  m_pTimer = OdPerfTimerBase::createTiming();
114  }
115 
117  {
118  OdPerfTimerBase::destroyTiming( m_pTimer );
119  }
120 
122  {
123  return m_pTimer;
124  }
125 };
126 
127 #include "TD_PackPop.h"
128 
129 #endif
unsigned int OdUInt32
unsigned char OdUInt8
#define FIRSTDLL_EXPORT
Definition: RootExport.h:39
Definition: Int64.h:43
static void destroyTiming(OdPerfTimerBase *ptr)
virtual OdUInt32 countedMSec()=0
virtual bool isStarted()=0
virtual OdUInt32 permanentMSec()=0
virtual void destroy()=0
virtual void stop()=0
InternalData * data
Definition: OdPerfTimer.h:55
virtual void initialize()=0
virtual double countedSec()=0
virtual void clear()=0
virtual ~OdPerfTimerBase()
Definition: OdPerfTimer.h:59
virtual double permanentSec()=0
virtual void start()=0
static OdPerfTimerBase * createTiming()
OdPerfTimerBase * getTimer()
Definition: OdPerfTimer.h:121
GLint GLenum GLsizei GLsizei GLint GLsizei const void * data
Definition: gles2_ext.h:110