/[svn]/linuxsampler/trunk/src/scriptvm/CoreVMFunctions.h
ViewVC logotype

Diff of /linuxsampler/trunk/src/scriptvm/CoreVMFunctions.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2727 by schoenebeck, Tue Mar 31 17:46:11 2015 UTC revision 2945 by schoenebeck, Thu Jul 14 00:22:26 2016 UTC
# Line 32  public: Line 32  public:
32      ExprType_t exprType() const { return EMPTY_EXPR; }      ExprType_t exprType() const { return EMPTY_EXPR; }
33      VMExpr* resultValue() { return this; }      VMExpr* resultValue() { return this; }
34      StmtFlags_t resultFlags() { return flags; }      StmtFlags_t resultFlags() { return flags; }
35        bool isConstExpr() const OVERRIDE { return false; }
36  };  };
37    
38  /**  /**
# Line 47  public: Line 48  public:
48      int evalInt() { return value; }      int evalInt() { return value; }
49      VMExpr* resultValue() { return this; }      VMExpr* resultValue() { return this; }
50      StmtFlags_t resultFlags() { return flags; }      StmtFlags_t resultFlags() { return flags; }
51        bool isConstExpr() const OVERRIDE { return false; }
52  };  };
53    
54  /**  /**
# Line 62  public: Line 64  public:
64      String evalStr() { return value; }      String evalStr() { return value; }
65      VMExpr* resultValue() { return this; }      VMExpr* resultValue() { return this; }
66      StmtFlags_t resultFlags() { return flags; }      StmtFlags_t resultFlags() { return flags; }
67        bool isConstExpr() const OVERRIDE { return false; }
68  };  };
69    
70  /**  /**
# Line 73  protected: Line 76  protected:
76      ExprType_t returnType() { return EMPTY_EXPR; }      ExprType_t returnType() { return EMPTY_EXPR; }
77      VMFnResult* errorResult();      VMFnResult* errorResult();
78      VMFnResult* successResult();      VMFnResult* successResult();
79        bool modifiesArg(int iArg) const OVERRIDE { return false; }
80  protected:  protected:
81      VMEmptyResult result;      VMEmptyResult result;
82  };  };
# Line 86  protected: Line 90  protected:
90      ExprType_t returnType() { return INT_EXPR; }      ExprType_t returnType() { return INT_EXPR; }
91      VMFnResult* errorResult(int i = 0);      VMFnResult* errorResult(int i = 0);
92      VMFnResult* successResult(int i = 0);      VMFnResult* successResult(int i = 0);
93        bool modifiesArg(int iArg) const OVERRIDE { return false; }
94  protected:  protected:
95      VMIntResult result;      VMIntResult result;
96  };  };
# Line 99  protected: Line 104  protected:
104      ExprType_t returnType() { return STRING_EXPR; }      ExprType_t returnType() { return STRING_EXPR; }
105      VMFnResult* errorResult(const String& s = "");      VMFnResult* errorResult(const String& s = "");
106      VMFnResult* successResult(const String& s = "");      VMFnResult* successResult(const String& s = "");
107        bool modifiesArg(int iArg) const OVERRIDE { return false; }
108  protected:  protected:
109      VMStringResult result;      VMStringResult result;
110  };  };
# Line 182  public: Line 188  public:
188      VMFnResult* exec(VMFnArgs* args);      VMFnResult* exec(VMFnArgs* args);
189  };  };
190    
191    /**
192     * Implements the built-in inc() script function.
193     */
194    class CoreVMFunction_inc : public VMIntResultFunction {
195    public:
196        int minRequiredArgs() const { return 1; }
197        int maxAllowedArgs() const { return 1; }
198        bool acceptsArgType(int iArg, ExprType_t type) const { return type == INT_EXPR; }
199        ExprType_t argType(int iArg) const { return INT_EXPR; }
200        bool modifiesArg(int iArg) const { return true; }
201        VMFnResult* exec(VMFnArgs* args);
202    };
203    
204    /**
205     * Implements the built-in dec() script function.
206     */
207    class CoreVMFunction_dec : public VMIntResultFunction {
208    public:
209        int minRequiredArgs() const { return 1; }
210        int maxAllowedArgs() const { return 1; }
211        bool acceptsArgType(int iArg, ExprType_t type) const { return type == INT_EXPR; }
212        ExprType_t argType(int iArg) const { return INT_EXPR; }
213        bool modifiesArg(int iArg) const { return true; }
214        VMFnResult* exec(VMFnArgs* args);
215    };
216    
217  } // namespace LinuxSampler  } // namespace LinuxSampler
218    
219  #endif // LS_COREVMFUNCTIONS_H  #endif // LS_COREVMFUNCTIONS_H

Legend:
Removed from v.2727  
changed lines
  Added in v.2945

  ViewVC Help
Powered by ViewVC