-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCOpChain.h
49 lines (31 loc) · 795 Bytes
/
COpChain.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#pragma once
#include "ViewTypes.h"
#include "ISignalOp.h"
#define OP_CHAIN_MAX_OPERATION_LENGTH 10
namespace SignalProcessing
{
ref class OpChain {
unsigned int cursor;
array<Operation ^> ^pChain;
public:
OpChain() {
cursor = 0;
pChain = gcnew array<Operation ^>(OP_CHAIN_MAX_OPERATION_LENGTH);
}
void InsertOp(Operation ^p_val) {
if (cursor < OP_CHAIN_MAX_OPERATION_LENGTH) {
pChain[cursor] = p_val;
cursor++;
}
}
double Apply(double new_sample, unsigned int sensor_data_type_index, array<ViewSerialEvent> ^p_flow) {
double ret_val = 0;
for (int i = 0; i < pChain->Length; i++) {
if (pChain[i] != nullptr) {
// ret_val = pChain[i]->Apply(new_sample, sensor_data_type_index, p_flow);
}
}
return ret_val;
}
};
}