VR-Forces 4.6 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtSampleAggregator.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 
17 namespace makVrv
18 {
25  {
26  public:
29  static std::size_t calculateNumberOfSamples(float estimatedFrequency, float estimatedRunTimeSeconds);
30 
34  DtSampleAggregator(std::size_t numOfSamples, std::size_t numOfFields, const std::string& fileName, bool rowNumInOutput=true);
35 
38 
40  std::size_t numSamples() const;
41 
42  std::size_t currentSample() const;
43 
45  std::size_t numFields() const;
46 
48  void addSample(std::size_t field, double sample);
49 
51  void incrementSample();
52 
54  void reset();
55 
57  double* samples(std::size_t field);
58 
61  bool dumped(void) const;
62 
64  void dump();
65 
66 
67  void addToDumpFile(const std::string& str);
68 
71  bool valid() const;
72 
73  private:
74  // Unimplemented default CTOR
76 
77  protected:
78  std::string myFileName;
79 
80  const std::size_t myNumSamples;
81  const std::size_t myNumFields;
82  std::size_t myCurrentSample;
83  double** myData; // This is an array of pointers to doubles - each points to the start of an array of doubles of size numSamples
84 
85  bool isValid;
86  std::ofstream myDumpFile;
87  bool myDumped;
89  };
90 }
91 

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)