-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathCalculation.h
50 lines (42 loc) · 927 Bytes
/
Calculation.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
// Calculation.h
#ifndef CALCULATION_H
#define CALCULATION_H
#include <kernel/OS.h>
#include <support/List.h>
#include "Thread.h"
// PreCalc - the base class for precalculation
class PreCalc
{
public:
PreCalc() {};
virtual ~PreCalc() {};
virtual void CalculatePoints(BPoint *points, BPoint *results, int32 count)
= 0;
};
// PreCalcList
class PreCalcList : public BList
{
public:
PreCalcList();
~PreCalcList();
void CalculatePoints(BPoint *points, BPoint *results, int32 count)
{
for (int i = 0; PreCalc *item = (PreCalc *)ItemAt(i); i++)
{
item->CalculatePoints(points, results, count);
points = results;
}
};
};
// PostCalc - the base class for postcalculation
class PostCalc : public CmdThread
{
public:
PostCalc();
virtual ~PostCalc();
virtual int32 CmdThreadFunction();
protected:
virtual void CalculatePoints(BPoint *points, float *results, int32 count)
= 0;
};
#endif // CALCULATION_H