forked from paulscherrerinstitute/exprtk-ecmc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexprtkWrap.h
65 lines (57 loc) · 2.03 KB
/
exprtkWrap.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
/*
* exprtkWrap.h
*
* Created on: May 8, 2018
* Author: anderssandstrom
*/
#ifndef M_EPICS_EXPRTK_EXPRTKWRAP_H_
#define M_EPICS_EXPRTK_EXPRTKWRAP_H_
#include "exprtkIF.h"
#include <string>
#include <vector>
#define ERROR_ALLOCATION_FAILED 0x30008
#define generate_add_function_wrap_h(NN) \
int addFunction(const std::string& function_name, ff##NN##_functor function); \
class exprtkWrap: public exprtkIF
{
public:
exprtkWrap ();
virtual ~exprtkWrap();
int addVariable(const std::string& variable_name, double& d);
generate_add_function_wrap_h(00)
generate_add_function_wrap_h(01)
generate_add_function_wrap_h(02)
generate_add_function_wrap_h(03)
generate_add_function_wrap_h(04)
generate_add_function_wrap_h(05)
generate_add_function_wrap_h(06)
generate_add_function_wrap_h(07)
generate_add_function_wrap_h(08)
generate_add_function_wrap_h(09)
generate_add_function_wrap_h(10)
generate_add_function_wrap_h(11)
generate_add_function_wrap_h(12)
generate_add_function_wrap_h(13)
generate_add_function_wrap_h(14)
generate_add_function_wrap_h(15)
int addFunction(const std::string& function_name, void* function);
int addVector(const std::string& vector_name, double* v, const std::size_t& size);
int addConstants();
int addConstant(const std::string& constant_name,double& d);
int addStringvar(const std::string& stringvarName, std::string& s, const bool isConstant);
int addFileIO();
int compile(std::string expressionString);
int compile();
int setExpression(std::string expressionString);
std::string getExpression();
void refresh(void);
int collectVariables(std::vector<std::string> &varList);
int collectFunctions(std::vector<std::string> &funcList);
std::string getParserError();
int addCompositionFunction(const std::string& function_name,
const std::string& functionExpression,
std::vector<std::string> &varList);
private:
exprtkIF *exprtk_;
};
#endif /* M_EPICS_EXPRTK_EXPRTKWRAP_H_ */