All Classes Namespaces Files Functions Variables Typedefs Macros
clizAccumulator.h
Go to the documentation of this file.
1 // clizAccumulator.h - ClusterLizard header file - Module: Accumulator
2 
3 // Copyright (C) 2013, 2014 Simeon Knieling, M.Sc.
4 //
5 // This Source Code Form is subject to the terms of the Mozilla Public
6 // License, v. 2.0. If a copy of the MPL was not distributed with this
7 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 //
9 
10 //Accumulator Class
11 
12 #pragma once
13 #ifndef _INCLUDE_CLIZACCUMULATOR
14 #define _INCLUDE_CLIZACCUMULATOR
15 
16 #include "clizSave.h"
17 
20 namespace cliz
21 {
22 
26  {
27  unsigned int extChunkSize; //maximum value of numValidSamples that feedExtChunk() will be called with.
28  unsigned int intChunkSize; //internal data chunk size. Greater values mean greater delays but less frequent calculations (less CPU usage)
29  double aDBitMuVolts; //Factor to convert the int16 values from the Data Aquisition System to µV
30  };
31 
45  {
46  private:
47  AccumulatorHandle handle; //Parameter handle
48  std::vector<IndicesStruct> indicesOut; //Which Modules that receive output from this module need which output?
49  std::vector<Save*> outputSaveVec; //Output Saves
50 
51  float *data; //Data buffer
52  unsigned int dataPos; //Current position (end) of data buffer
53  uint64_t currentTime; //Current time in µs
54  MemoryManager memMan;
55 
56  public:
61  Accumulator(AccumulatorHandle iHandle, std::vector<Save*> &iOutputSaveVec, std::vector<IndicesStruct> &iIndicesOut);
62 
69  void feedExtChunk(signed __int16 *iExtChunk, unsigned int numValidSamples, uint64_t iCurrentTime);
70 
72  {
73  memMan.free(data);
74  };
75  };
76 }
77 
78 #endif
Accumulator(AccumulatorHandle iHandle, std::vector< Save * > &iOutputSaveVec, std::vector< IndicesStruct > &iIndicesOut)
Definition: clizAccumulator.cpp:23
unsigned int intChunkSize
Definition: clizAccumulator.h:28
Definition: cliz.h:55
double aDBitMuVolts
Definition: clizAccumulator.h:29
void feedExtChunk(signed __int16 *iExtChunk, unsigned int numValidSamples, uint64_t iCurrentTime)
Definition: clizAccumulator.cpp:42
unsigned int extChunkSize
Definition: clizAccumulator.h:27
Definition: clizFunctions.h:268
Definition: clizAccumulator.h:25
void free(memPtr *memAdr)
Definition: clizFunctions.h:331
~Accumulator()
Definition: clizAccumulator.h:71
Definition: clizAccumulator.h:44