VR-Forces 4.6 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 
26  {
27  public:
30  static std::size_t calculateNumberOfSamples(float estimatedFrequency, float estimatedRunTimeSeconds);
31 
36 
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;
72  bool myStarted;
73  };
74 
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:
87 
88  struct ProfileData
89  {
91  : myStartAt(0), myEndAt(0), myLoggedStart(false), myDumped(false), myID(0) {}
92  double myStartAt;
93  double myEndAt;
95  bool myDumped;
96  std::size_t myID;
97  };
98 
99  typedef std::deque<ProfileData> Profiles;
101 
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)