1 |
/* |
/* |
2 |
* Copyright (c) 2014-2015 Christian Schoenebeck |
* Copyright (c) 2014-2016 Christian Schoenebeck |
3 |
* |
* |
4 |
* http://www.linuxsampler.org |
* http://www.linuxsampler.org |
5 |
* |
* |
29 |
StmtFlags_t flags; ///< general completion status (i.e. success or failure) of the function call |
StmtFlags_t flags; ///< general completion status (i.e. success or failure) of the function call |
30 |
|
|
31 |
VMEmptyResult() : flags(STMT_SUCCESS) {} |
VMEmptyResult() : flags(STMT_SUCCESS) {} |
32 |
ExprType_t exprType() const { return EMPTY_EXPR; } |
ExprType_t exprType() const OVERRIDE { return EMPTY_EXPR; } |
33 |
VMExpr* resultValue() { return this; } |
VMExpr* resultValue() OVERRIDE { return this; } |
34 |
StmtFlags_t resultFlags() { return flags; } |
StmtFlags_t resultFlags() OVERRIDE { return flags; } |
35 |
bool isConstExpr() const OVERRIDE { return false; } |
bool isConstExpr() const OVERRIDE { return false; } |
36 |
}; |
}; |
37 |
|
|
45 |
int value; ///< result value of the function call |
int value; ///< result value of the function call |
46 |
|
|
47 |
VMIntResult() : flags(STMT_SUCCESS) {} |
VMIntResult() : flags(STMT_SUCCESS) {} |
48 |
int evalInt() { return value; } |
int evalInt() OVERRIDE { return value; } |
49 |
VMExpr* resultValue() { return this; } |
VMExpr* resultValue() OVERRIDE { return this; } |
50 |
StmtFlags_t resultFlags() { return flags; } |
StmtFlags_t resultFlags() OVERRIDE { return flags; } |
51 |
bool isConstExpr() const OVERRIDE { return false; } |
bool isConstExpr() const OVERRIDE { return false; } |
52 |
}; |
}; |
53 |
|
|
61 |
String value; ///< result value of the function call |
String value; ///< result value of the function call |
62 |
|
|
63 |
VMStringResult() : flags(STMT_SUCCESS) {} |
VMStringResult() : flags(STMT_SUCCESS) {} |
64 |
String evalStr() { return value; } |
String evalStr() OVERRIDE { return value; } |
65 |
VMExpr* resultValue() { return this; } |
VMExpr* resultValue() OVERRIDE { return this; } |
66 |
StmtFlags_t resultFlags() { return flags; } |
StmtFlags_t resultFlags() OVERRIDE { return flags; } |
67 |
bool isConstExpr() const OVERRIDE { return false; } |
bool isConstExpr() const OVERRIDE { return false; } |
68 |
}; |
}; |
69 |
|
|
74 |
class VMEmptyResultFunction : public VMFunction { |
class VMEmptyResultFunction : public VMFunction { |
75 |
protected: |
protected: |
76 |
virtual ~VMEmptyResultFunction() {} |
virtual ~VMEmptyResultFunction() {} |
77 |
ExprType_t returnType() { return EMPTY_EXPR; } |
ExprType_t returnType() OVERRIDE { return EMPTY_EXPR; } |
78 |
VMFnResult* errorResult(); |
VMFnResult* errorResult(); |
79 |
VMFnResult* successResult(); |
VMFnResult* successResult(); |
80 |
bool modifiesArg(int iArg) const OVERRIDE { return false; } |
bool modifiesArg(int iArg) const OVERRIDE { return false; } |
89 |
class VMIntResultFunction : public VMFunction { |
class VMIntResultFunction : public VMFunction { |
90 |
protected: |
protected: |
91 |
virtual ~VMIntResultFunction() {} |
virtual ~VMIntResultFunction() {} |
92 |
ExprType_t returnType() { return INT_EXPR; } |
ExprType_t returnType() OVERRIDE { return INT_EXPR; } |
93 |
VMFnResult* errorResult(int i = 0); |
VMFnResult* errorResult(int i = 0); |
94 |
VMFnResult* successResult(int i = 0); |
VMFnResult* successResult(int i = 0); |
95 |
bool modifiesArg(int iArg) const OVERRIDE { return false; } |
bool modifiesArg(int iArg) const OVERRIDE { return false; } |
104 |
class VMStringResultFunction : public VMFunction { |
class VMStringResultFunction : public VMFunction { |
105 |
protected: |
protected: |
106 |
virtual ~VMStringResultFunction() {} |
virtual ~VMStringResultFunction() {} |
107 |
ExprType_t returnType() { return STRING_EXPR; } |
ExprType_t returnType() OVERRIDE { return STRING_EXPR; } |
108 |
VMFnResult* errorResult(const String& s = ""); |
VMFnResult* errorResult(const String& s = ""); |
109 |
VMFnResult* successResult(const String& s = ""); |
VMFnResult* successResult(const String& s = ""); |
110 |
bool modifiesArg(int iArg) const OVERRIDE { return false; } |
bool modifiesArg(int iArg) const OVERRIDE { return false; } |