/[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 3551 by schoenebeck, Thu Aug 1 10:22:56 2019 UTC revision 3678 by schoenebeck, Fri Dec 27 22:46:08 2019 UTC
# Line 24  class ScriptVM; Line 24  class ScriptVM;
24   * An instance of this class is returned by built-in function implementations   * An instance of this class is returned by built-in function implementations
25   * which do not return a function return value.   * which do not return a function return value.
26   */   */
27  class VMEmptyResult : public VMFnResult, public VMExpr {  class VMEmptyResult FINAL : public VMFnResult, public VMExpr {
28  public:  public:
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    
# Line 39  public: Line 39  public:
39   * An instance of this class is returned by built-in function implementations   * An instance of this class is returned by built-in function implementations
40   * which return an integer value as function return value.   * which return an integer value as function return value.
41   */   */
42  class VMIntResult : public VMFnResult, public VMIntExpr {  class VMIntResult FINAL : public VMFnResult, public VMIntExpr {
43  public:  public:
44      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
45      int value; ///< result value of the function call      vmint value; ///< result value of the function call
46        vmfloat unitPrefixFactor; ///< unit factor of result value of the function call
47    
48      VMIntResult() : flags(STMT_SUCCESS) {}      VMIntResult() : flags(STMT_SUCCESS), value(0), unitPrefixFactor(VM_NO_FACTOR) {}
49      int evalInt() OVERRIDE { return value; }      vmint evalInt() OVERRIDE { return value; }
50      VMExpr* resultValue() OVERRIDE { return this; }      VMExpr* resultValue() OVERRIDE { return this; }
51      StmtFlags_t resultFlags() OVERRIDE { return flags; }      StmtFlags_t resultFlags() OVERRIDE { return flags; }
52      bool isConstExpr() const OVERRIDE { return false; }      bool isConstExpr() const OVERRIDE { return false; }
53        vmfloat unitFactor() const OVERRIDE { return unitPrefixFactor; }
54        StdUnit_t unitType() const OVERRIDE { return VM_NO_UNIT; } // actually never called, VMFunction::returnUnitType() is always used instead
55        bool isFinal() const OVERRIDE { return false; } // actually never called, VMFunction::returnsFinal() is always used instead
56    };
57    
58    /**
59     * An instance of this class is returned by built-in function implementations
60     * which return a real number (floating point) value as function return value.
61     */
62    class VMRealResult FINAL : public VMFnResult, public VMRealExpr {
63    public:
64        StmtFlags_t flags; ///< general completion status (i.e. success or failure) of the function call
65        vmfloat value; ///< result value of the function call
66        vmfloat unitPrefixFactor; ///< unit factor of result value of the function call
67    
68        VMRealResult() : flags(STMT_SUCCESS), value(0), unitPrefixFactor(VM_NO_FACTOR) {}
69        vmfloat evalReal() OVERRIDE { return value; }
70        VMExpr* resultValue() OVERRIDE { return this; }
71        StmtFlags_t resultFlags() OVERRIDE { return flags; }
72        bool isConstExpr() const OVERRIDE { return false; }
73        vmfloat unitFactor() const OVERRIDE { return unitPrefixFactor; }
74        StdUnit_t unitType() const OVERRIDE { return VM_NO_UNIT; } // actually never called, VMFunction::returnUnitType() is always used instead
75        bool isFinal() const OVERRIDE { return false; } // actually never called, VMFunction::returnsFinal() is always used instead
76  };  };
77    
78  /**  /**
79   * An instance of this class is returned by built-in function implementations   * An instance of this class is returned by built-in function implementations
80   * which return a string value as function return value.   * which return a string value as function return value.
81   */   */
82  class VMStringResult : public VMFnResult, public VMStringExpr {  class VMStringResult FINAL : public VMFnResult, public VMStringExpr {
83  public:  public:
84      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
85      String value; ///< result value of the function call      String value; ///< result value of the function call
# Line 74  public: Line 98  public:
98  class VMEmptyResultFunction : public VMFunction {  class VMEmptyResultFunction : public VMFunction {
99  protected:  protected:
100      virtual ~VMEmptyResultFunction() {}      virtual ~VMEmptyResultFunction() {}
101      ExprType_t returnType() OVERRIDE { return EMPTY_EXPR; }      ExprType_t returnType(VMFnArgs* args) OVERRIDE { return EMPTY_EXPR; }
102        StdUnit_t returnUnitType(VMFnArgs* args) OVERRIDE { return VM_NO_UNIT; }
103        bool returnsFinal(VMFnArgs* args) OVERRIDE { return false; }
104      VMFnResult* errorResult();      VMFnResult* errorResult();
105      VMFnResult* successResult();      VMFnResult* successResult();
106      bool modifiesArg(int iArg) const OVERRIDE { return false; }      bool modifiesArg(vmint iArg) const OVERRIDE { return false; }
107  protected:  protected:
108      VMEmptyResult result;      VMEmptyResult result;
109  };  };
110    
111    struct VMIntFnResDef {
112        vmint value = 0; //NOTE: sequence matters! Since this is usually initialized with VMIntExpr::evalInt() it should be before member unitFactor, since the latter is usually initialized with VMIntExpr::unitFactor() which does not evaluate the expression.
113        vmfloat unitFactor = VM_NO_FACTOR;
114    };
115    
116    struct VMRealFnResDef {
117        vmfloat value = vmfloat(0); //NOTE: sequence matters! Since this is usually initialized with VMRealExpr::evalReal() it should be before member unitFactor, since the latter is usually initialized with VMRealExpr::unitFactor() which does not evaluate the expression.
118        vmfloat unitFactor = VM_NO_FACTOR;
119    };
120    
121  /**  /**
122   * Abstract base class for built-in script functions which return an integer   * Abstract base class for built-in script functions which return an integer
123   * (scalar) as their function return value.   * (scalar) as their function return value.
# Line 89  protected: Line 125  protected:
125  class VMIntResultFunction : public VMFunction {  class VMIntResultFunction : public VMFunction {
126  protected:  protected:
127      virtual ~VMIntResultFunction() {}      virtual ~VMIntResultFunction() {}
128      ExprType_t returnType() OVERRIDE { return INT_EXPR; }      ExprType_t returnType(VMFnArgs* args) OVERRIDE { return INT_EXPR; }
129      VMFnResult* errorResult(int i = 0);      VMFnResult* errorResult(vmint i = 0);
130      VMFnResult* successResult(int i = 0);      VMFnResult* errorResult(VMIntFnResDef res);
131      bool modifiesArg(int iArg) const OVERRIDE { return false; }      VMFnResult* successResult(vmint i = 0);
132        VMFnResult* successResult(VMIntFnResDef res);
133        bool modifiesArg(vmint iArg) const OVERRIDE { return false; }
134  protected:  protected:
135      VMIntResult result;      VMIntResult result;
136  };  };
137    
138  /**  /**
139     * Abstract base class for built-in script functions which return a real number
140     * (floating point scalar) as their function return value.
141     */
142    class VMRealResultFunction : public VMFunction {
143    protected:
144        virtual ~VMRealResultFunction() {}
145        ExprType_t returnType(VMFnArgs* args) OVERRIDE { return REAL_EXPR; }
146        VMFnResult* errorResult(vmfloat f = 0);
147        VMFnResult* errorResult(VMRealFnResDef res);
148        VMFnResult* successResult(vmfloat f = 0);
149        VMFnResult* successResult(VMRealFnResDef res);
150        bool modifiesArg(vmint iArg) const OVERRIDE { return false; }
151    protected:
152        VMRealResult result;
153    };
154    
155    /**
156   * Abstract base class for built-in script functions which return a string as   * Abstract base class for built-in script functions which return a string as
157   * their function return value.   * their function return value.
158   */   */
159  class VMStringResultFunction : public VMFunction {  class VMStringResultFunction : public VMFunction {
160  protected:  protected:
161      virtual ~VMStringResultFunction() {}      virtual ~VMStringResultFunction() {}
162      ExprType_t returnType() OVERRIDE { return STRING_EXPR; }      ExprType_t returnType(VMFnArgs* args) OVERRIDE { return STRING_EXPR; }
163      VMFnResult* errorResult(const String& s = "");      VMFnResult* errorResult(const String& s = "");
164      VMFnResult* successResult(const String& s = "");      VMFnResult* successResult(const String& s = "");
165      bool modifiesArg(int iArg) const OVERRIDE { return false; }      bool modifiesArg(vmint iArg) const OVERRIDE { return false; }
166  protected:  protected:
167      VMStringResult result;      VMStringResult result;
168  };  };
169    
170    /**
171     * Abstract base class for built-in script functions which either return an
172     * integer or a real number (floating point scalar) as their function return
173     * value. The actual return type is determined at parse time once after
174     * potential arguments were associated with the respective function call.
175     */
176    class VMNumberResultFunction : public VMFunction {
177    protected:
178        virtual ~VMNumberResultFunction() {}
179        VMFnResult* errorResult(vmint i);
180        VMFnResult* errorResult(vmfloat f);
181        VMFnResult* successResult(vmint i);
182        VMFnResult* successResult(vmfloat f);
183        VMFnResult* errorIntResult(VMIntFnResDef res);
184        VMFnResult* errorRealResult(VMRealFnResDef res);
185        VMFnResult* successIntResult(VMIntFnResDef res);
186        VMFnResult* successRealResult(VMRealFnResDef res);
187        bool modifiesArg(vmint iArg) const OVERRIDE { return false; }
188    protected:
189        VMIntResult intResult;
190        VMRealResult realResult;
191    };
192    
193    
194  ///////////////////////////////////////////////////////////////////////////  ///////////////////////////////////////////////////////////////////////////
195  // implementations of core built-in script functions ...  // implementations of core built-in script functions ...
# Line 119  protected: Line 197  protected:
197  /**  /**
198   * Implements the built-in message() script function.   * Implements the built-in message() script function.
199   */   */
200  class CoreVMFunction_message : public VMEmptyResultFunction {  class CoreVMFunction_message FINAL : public VMEmptyResultFunction {
201  public:  public:
202      int minRequiredArgs() const { return 1; }      vmint minRequiredArgs() const OVERRIDE { return 1; }
203      int maxAllowedArgs() const { return 1; }      vmint maxAllowedArgs() const OVERRIDE { return 1; }
204      bool acceptsArgType(int iArg, ExprType_t type) const;      bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE;
205      ExprType_t argType(int iArg) const { return STRING_EXPR; }      VMFnResult* exec(VMFnArgs* args) OVERRIDE;
     VMFnResult* exec(VMFnArgs* args);  
206  };  };
207    
208  /**  /**
209   * Implements the built-in exit() script function.   * Implements the built-in exit() script function.
210   */   */
211  class CoreVMFunction_exit : public VMEmptyResultFunction {  class CoreVMFunction_exit FINAL : public VMEmptyResultFunction {
212  public:  public:
213      CoreVMFunction_exit(ScriptVM* vm) : vm(vm) {}      CoreVMFunction_exit(ScriptVM* vm) : vm(vm) {}
214      int minRequiredArgs() const OVERRIDE { return 0; }      vmint minRequiredArgs() const OVERRIDE { return 0; }
215      int maxAllowedArgs() const OVERRIDE;      vmint maxAllowedArgs() const OVERRIDE;
216      bool acceptsArgType(int iArg, ExprType_t type) const OVERRIDE;      bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE;
217      ExprType_t argType(int iArg) const OVERRIDE { return INT_EXPR; }      bool acceptsArgUnitType(vmint iArg, StdUnit_t type) const OVERRIDE;
218      VMFnResult* exec(VMFnArgs* args);      bool acceptsArgUnitPrefix(vmint iArg, StdUnit_t type) const OVERRIDE;
219        bool acceptsArgFinal(vmint iArg) const OVERRIDE;
220        VMFnResult* exec(VMFnArgs* args) OVERRIDE;
221  protected:  protected:
222      ScriptVM* vm;      ScriptVM* vm;
223  };  };
# Line 149  protected: Line 228  protected:
228  class CoreVMFunction_wait : public VMEmptyResultFunction {  class CoreVMFunction_wait : public VMEmptyResultFunction {
229  public:  public:
230      CoreVMFunction_wait(ScriptVM* vm) : vm(vm) {}      CoreVMFunction_wait(ScriptVM* vm) : vm(vm) {}
231      int minRequiredArgs() const { return 1; }      vmint minRequiredArgs() const OVERRIDE { return 1; }
232      int maxAllowedArgs() const { return 1; }      vmint maxAllowedArgs() const OVERRIDE { return 1; }
233      bool acceptsArgType(int iArg, ExprType_t type) const { return type == INT_EXPR; }      bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE;
234      ExprType_t argType(int iArg) const { return INT_EXPR; }      bool acceptsArgUnitType(vmint iArg, StdUnit_t type) const OVERRIDE;
235      VMFnResult* exec(VMFnArgs* args);      bool acceptsArgUnitPrefix(vmint iArg, StdUnit_t type) const OVERRIDE;
236        VMFnResult* exec(VMFnArgs* args) OVERRIDE;
237  protected:  protected:
238      ScriptVM* vm;      ScriptVM* vm;
239  };  };
# Line 161  protected: Line 241  protected:
241  /**  /**
242   * Implements the built-in abs() script function.   * Implements the built-in abs() script function.
243   */   */
244  class CoreVMFunction_abs : public VMIntResultFunction {  class CoreVMFunction_abs FINAL : public VMNumberResultFunction {
245  public:  public:
246      int minRequiredArgs() const { return 1; }      ExprType_t returnType(VMFnArgs* args) OVERRIDE;
247      int maxAllowedArgs() const { return 1; }      StdUnit_t returnUnitType(VMFnArgs* args) OVERRIDE;
248      bool acceptsArgType(int iArg, ExprType_t type) const;      bool returnsFinal(VMFnArgs* args) OVERRIDE;
249      ExprType_t argType(int iArg) const { return INT_EXPR; }      vmint minRequiredArgs() const OVERRIDE { return 1; }
250      VMFnResult* exec(VMFnArgs* args);      vmint maxAllowedArgs() const OVERRIDE { return 1; }
251        bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE;
252        bool acceptsArgUnitType(vmint iArg, StdUnit_t type) const OVERRIDE { return true; }
253        bool acceptsArgUnitPrefix(vmint iArg, StdUnit_t type) const OVERRIDE { return true; }
254        bool acceptsArgFinal(vmint iArg) const OVERRIDE { return true; }
255        VMFnResult* exec(VMFnArgs* args) OVERRIDE;
256  };  };
257    
258  /**  /**
259   * Implements the built-in random() script function.   * Implements the built-in random() script function.
260   */   */
261  class CoreVMFunction_random : public VMIntResultFunction {  class CoreVMFunction_random FINAL : public VMNumberResultFunction {
262        using Super = VMNumberResultFunction; // just an alias for the super class
263  public:  public:
264      int minRequiredArgs() const { return 2; }      ExprType_t returnType(VMFnArgs* args) OVERRIDE;
265      int maxAllowedArgs() const { return 2; }      StdUnit_t returnUnitType(VMFnArgs* args) OVERRIDE;
266      bool acceptsArgType(int iArg, ExprType_t type) const;      bool returnsFinal(VMFnArgs* args) OVERRIDE;
267      ExprType_t argType(int iArg) const { return INT_EXPR; }      vmint minRequiredArgs() const OVERRIDE { return 2; }
268      VMFnResult* exec(VMFnArgs* args);      vmint maxAllowedArgs() const OVERRIDE { return 2; }
269        bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE;
270        bool acceptsArgUnitType(vmint iArg, StdUnit_t type) const OVERRIDE { return true; }
271        bool acceptsArgUnitPrefix(vmint iArg, StdUnit_t type) const OVERRIDE { return true; }
272        bool acceptsArgFinal(vmint iArg) const OVERRIDE { return true; }
273        void checkArgs(VMFnArgs* args, std::function<void(String)> err,
274                                       std::function<void(String)> wrn) OVERRIDE;
275        VMFnResult* exec(VMFnArgs* args) OVERRIDE;
276  };  };
277    
278  /**  /**
279   * Implements the built-in num_elements() script function.   * Implements the built-in num_elements() script function.
280   */   */
281  class CoreVMFunction_num_elements : public VMIntResultFunction {  class CoreVMFunction_num_elements FINAL : public VMIntResultFunction {
282  public:  public:
283      int minRequiredArgs() const { return 1; }      StdUnit_t returnUnitType(VMFnArgs* args) OVERRIDE { return VM_NO_UNIT; }
284      int maxAllowedArgs() const { return 1; }      bool returnsFinal(VMFnArgs* args) OVERRIDE { return false; }
285      bool acceptsArgType(int iArg, ExprType_t type) const;      vmint minRequiredArgs() const OVERRIDE { return 1; }
286      ExprType_t argType(int iArg) const { return INT_ARR_EXPR; }      vmint maxAllowedArgs() const OVERRIDE { return 1; }
287      VMFnResult* exec(VMFnArgs* args);      bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE;
288        VMFnResult* exec(VMFnArgs* args) OVERRIDE;
289  };  };
290    
291  /**  /**
292   * Implements the built-in inc() script function.   * Implements the built-in inc() script function.
293   */   */
294  class CoreVMFunction_inc : public VMIntResultFunction {  class CoreVMFunction_inc FINAL : public VMIntResultFunction {
295        using Super = VMIntResultFunction; // just an alias for the super class
296  public:  public:
297      int minRequiredArgs() const { return 1; }      StdUnit_t returnUnitType(VMFnArgs* args) OVERRIDE;
298      int maxAllowedArgs() const { return 1; }      bool returnsFinal(VMFnArgs* args) OVERRIDE;
299      bool acceptsArgType(int iArg, ExprType_t type) const { return type == INT_EXPR; }      vmint minRequiredArgs() const OVERRIDE { return 1; }
300      ExprType_t argType(int iArg) const { return INT_EXPR; }      vmint maxAllowedArgs() const OVERRIDE { return 1; }
301      bool modifiesArg(int iArg) const { return true; }      bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE { return type == INT_EXPR; }
302      VMFnResult* exec(VMFnArgs* args);      bool acceptsArgUnitType(vmint iArg, StdUnit_t type) const OVERRIDE { return true; }
303        bool acceptsArgUnitPrefix(vmint iArg, StdUnit_t type) const OVERRIDE { return true; }
304        bool acceptsArgFinal(vmint iArg) const OVERRIDE { return true; }
305        bool modifiesArg(vmint iArg) const OVERRIDE { return true; }
306        void checkArgs(VMFnArgs* args, std::function<void(String)> err,
307                                       std::function<void(String)> wrn) OVERRIDE;
308        VMFnResult* exec(VMFnArgs* args) OVERRIDE;
309  };  };
310    
311  /**  /**
312   * Implements the built-in dec() script function.   * Implements the built-in dec() script function.
313   */   */
314  class CoreVMFunction_dec : public VMIntResultFunction {  class CoreVMFunction_dec FINAL : public VMIntResultFunction {
315        using Super = VMIntResultFunction; // just an alias for the super class
316  public:  public:
317      int minRequiredArgs() const { return 1; }      StdUnit_t returnUnitType(VMFnArgs* args) OVERRIDE;
318      int maxAllowedArgs() const { return 1; }      bool returnsFinal(VMFnArgs* args) OVERRIDE;
319      bool acceptsArgType(int iArg, ExprType_t type) const { return type == INT_EXPR; }      vmint minRequiredArgs() const OVERRIDE { return 1; }
320      ExprType_t argType(int iArg) const { return INT_EXPR; }      vmint maxAllowedArgs() const OVERRIDE { return 1; }
321      bool modifiesArg(int iArg) const { return true; }      bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE { return type == INT_EXPR; }
322      VMFnResult* exec(VMFnArgs* args);      bool acceptsArgUnitType(vmint iArg, StdUnit_t type) const OVERRIDE { return true; }
323        bool acceptsArgUnitPrefix(vmint iArg, StdUnit_t type) const OVERRIDE { return true; }
324        bool acceptsArgFinal(vmint iArg) const OVERRIDE { return true; }
325        bool modifiesArg(vmint iArg) const OVERRIDE { return true; }
326        void checkArgs(VMFnArgs* args, std::function<void(String)> err,
327                                       std::function<void(String)> wrn) OVERRIDE;
328        VMFnResult* exec(VMFnArgs* args) OVERRIDE;
329  };  };
330    
331  /**  /**
332   * Implements the built-in in_range() script function.   * Implements the built-in in_range() script function.
333   */   */
334  class CoreVMFunction_in_range : public VMIntResultFunction {  class CoreVMFunction_in_range FINAL : public VMIntResultFunction {
335        using Super = VMIntResultFunction; // just an alias for the super class
336  public:  public:
337      int minRequiredArgs() const { return 3; }      StdUnit_t returnUnitType(VMFnArgs* args) OVERRIDE { return VM_NO_UNIT; }
338      int maxAllowedArgs() const { return 3; }      bool returnsFinal(VMFnArgs* args) OVERRIDE { return false; }
339      bool acceptsArgType(int iArg, ExprType_t type) const { return type == INT_EXPR; }      vmint minRequiredArgs() const OVERRIDE { return 3; }
340      ExprType_t argType(int iArg) const { return INT_EXPR; }      vmint maxAllowedArgs() const OVERRIDE { return 3; }
341      VMFnResult* exec(VMFnArgs* args);      bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE;
342        bool acceptsArgUnitType(vmint iArg, StdUnit_t type) const OVERRIDE { return true; }
343        bool acceptsArgUnitPrefix(vmint iArg, StdUnit_t type) const OVERRIDE { return true; }
344        bool acceptsArgFinal(vmint iArg) const OVERRIDE { return true; }
345        void checkArgs(VMFnArgs* args, std::function<void(String)> err,
346                                       std::function<void(String)> wrn) OVERRIDE;
347        VMFnResult* exec(VMFnArgs* args) OVERRIDE;
348  };  };
349    
350  /**  /**
351   * Implements the built-in sh_left() script function.   * Implements the built-in sh_left() script function.
352   */   */
353  class CoreVMFunction_sh_left : public VMIntResultFunction {  class CoreVMFunction_sh_left FINAL : public VMIntResultFunction {
354  public:  public:
355      int minRequiredArgs() const { return 2; }      StdUnit_t returnUnitType(VMFnArgs* args) OVERRIDE { return VM_NO_UNIT; }
356      int maxAllowedArgs() const { return 2; }      bool returnsFinal(VMFnArgs* args) OVERRIDE;
357      bool acceptsArgType(int iArg, ExprType_t type) const { return type == INT_EXPR; }      vmint minRequiredArgs() const OVERRIDE { return 2; }
358      ExprType_t argType(int iArg) const { return INT_EXPR; }      vmint maxAllowedArgs() const OVERRIDE { return 2; }
359      VMFnResult* exec(VMFnArgs* args);      bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE { return type == INT_EXPR; }
360        bool acceptsArgFinal(vmint iArg) const OVERRIDE { return true; }
361        VMFnResult* exec(VMFnArgs* args) OVERRIDE;
362  };  };
363    
364  /**  /**
365   * Implements the built-in sh_right() script function.   * Implements the built-in sh_right() script function.
366   */   */
367  class CoreVMFunction_sh_right : public VMIntResultFunction {  class CoreVMFunction_sh_right FINAL : public VMIntResultFunction {
368  public:  public:
369      int minRequiredArgs() const { return 2; }      StdUnit_t returnUnitType(VMFnArgs* args) OVERRIDE { return VM_NO_UNIT; }
370      int maxAllowedArgs() const { return 2; }      bool returnsFinal(VMFnArgs* args) OVERRIDE;
371      bool acceptsArgType(int iArg, ExprType_t type) const { return type == INT_EXPR; }      vmint minRequiredArgs() const OVERRIDE { return 2; }
372      ExprType_t argType(int iArg) const { return INT_EXPR; }      vmint maxAllowedArgs() const OVERRIDE { return 2; }
373      VMFnResult* exec(VMFnArgs* args);      bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE { return type == INT_EXPR; }
374        bool acceptsArgFinal(vmint iArg) const OVERRIDE { return true; }
375        VMFnResult* exec(VMFnArgs* args) OVERRIDE;
376    };
377    
378    /**
379     * Implements the built-in msb() script function.
380     */
381    class CoreVMFunction_msb FINAL : public VMIntResultFunction {
382    public:
383        StdUnit_t returnUnitType(VMFnArgs* args) OVERRIDE { return VM_NO_UNIT; }
384        bool returnsFinal(VMFnArgs* args) OVERRIDE { return false; }
385        vmint minRequiredArgs() const OVERRIDE { return 1; }
386        vmint maxAllowedArgs() const OVERRIDE { return 1; }
387        bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE { return type == INT_EXPR; }
388        bool acceptsArgFinal(vmint iArg) const OVERRIDE { return false; }
389        VMFnResult* exec(VMFnArgs* args) OVERRIDE;
390    };
391    
392    /**
393     * Implements the built-in lsb() script function.
394     */
395    class CoreVMFunction_lsb FINAL : public VMIntResultFunction {
396    public:
397        StdUnit_t returnUnitType(VMFnArgs* args) OVERRIDE { return VM_NO_UNIT; }
398        bool returnsFinal(VMFnArgs* args) OVERRIDE { return false; }
399        vmint minRequiredArgs() const OVERRIDE { return 1; }
400        vmint maxAllowedArgs() const OVERRIDE { return 1; }
401        bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE { return type == INT_EXPR; }
402        bool acceptsArgFinal(vmint iArg) const OVERRIDE { return false; }
403        VMFnResult* exec(VMFnArgs* args) OVERRIDE;
404  };  };
405    
406  /**  /**
407   * Implements the built-in min() script function.   * Implements the built-in min() script function.
408   */   */
409  class CoreVMFunction_min : public VMIntResultFunction {  class CoreVMFunction_min FINAL : public VMNumberResultFunction {
410        using Super = VMNumberResultFunction; // just an alias for the super class
411  public:  public:
412      int minRequiredArgs() const { return 2; }      ExprType_t returnType(VMFnArgs* args) OVERRIDE;
413      int maxAllowedArgs() const { return 2; }      StdUnit_t returnUnitType(VMFnArgs* args) OVERRIDE;
414      bool acceptsArgType(int iArg, ExprType_t type) const { return type == INT_EXPR; }      bool returnsFinal(VMFnArgs* args) OVERRIDE;
415      ExprType_t argType(int iArg) const { return INT_EXPR; }      vmint minRequiredArgs() const OVERRIDE { return 2; }
416      VMFnResult* exec(VMFnArgs* args);      vmint maxAllowedArgs() const OVERRIDE { return 2; }
417        bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE;
418        bool acceptsArgUnitType(vmint iArg, StdUnit_t type) const OVERRIDE { return true; }
419        bool acceptsArgUnitPrefix(vmint iArg, StdUnit_t type) const OVERRIDE { return true; }
420        bool acceptsArgFinal(vmint iArg) const OVERRIDE { return true; }
421        void checkArgs(VMFnArgs* args, std::function<void(String)> err,
422                                       std::function<void(String)> wrn) OVERRIDE;
423        VMFnResult* exec(VMFnArgs* args) OVERRIDE;
424  };  };
425    
426  /**  /**
427   * Implements the built-in max() script function.   * Implements the built-in max() script function.
428   */   */
429  class CoreVMFunction_max : public VMIntResultFunction {  class CoreVMFunction_max FINAL : public VMNumberResultFunction {
430        using Super = VMNumberResultFunction; // just an alias for the super class
431  public:  public:
432      int minRequiredArgs() const { return 2; }      ExprType_t returnType(VMFnArgs* args) OVERRIDE;
433      int maxAllowedArgs() const { return 2; }      StdUnit_t returnUnitType(VMFnArgs* args) OVERRIDE;
434      bool acceptsArgType(int iArg, ExprType_t type) const { return type == INT_EXPR; }      bool returnsFinal(VMFnArgs* args) OVERRIDE;
435      ExprType_t argType(int iArg) const { return INT_EXPR; }      vmint minRequiredArgs() const OVERRIDE { return 2; }
436      VMFnResult* exec(VMFnArgs* args);      vmint maxAllowedArgs() const OVERRIDE { return 2; }
437        bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE;
438        bool acceptsArgUnitType(vmint iArg, StdUnit_t type) const OVERRIDE { return true; }
439        bool acceptsArgUnitPrefix(vmint iArg, StdUnit_t type) const OVERRIDE { return true; }
440        bool acceptsArgFinal(vmint iArg) const OVERRIDE { return true; }
441        void checkArgs(VMFnArgs* args, std::function<void(String)> err,
442                                       std::function<void(String)> wrn) OVERRIDE;
443        VMFnResult* exec(VMFnArgs* args) OVERRIDE;
444  };  };
445    
446  /**  /**
447   * Implements the built-in array_equal() script function.   * Implements the built-in array_equal() script function.
448   */   */
449  class CoreVMFunction_array_equal : public VMIntResultFunction {  class CoreVMFunction_array_equal FINAL : public VMIntResultFunction {
450        using Super = VMIntResultFunction; // just an alias for the super class
451  public:  public:
452      int minRequiredArgs() const { return 2; }      StdUnit_t returnUnitType(VMFnArgs* args) OVERRIDE { return VM_NO_UNIT; }
453      int maxAllowedArgs() const { return 2; }      bool returnsFinal(VMFnArgs* args) OVERRIDE { return false; }
454      bool acceptsArgType(int iArg, ExprType_t type) const { return type == INT_ARR_EXPR; }      vmint minRequiredArgs() const OVERRIDE { return 2; }
455      ExprType_t argType(int iArg) const { return INT_ARR_EXPR; }      vmint maxAllowedArgs() const OVERRIDE { return 2; }
456      VMFnResult* exec(VMFnArgs* args);      bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE;
457        void checkArgs(VMFnArgs* args, std::function<void(String)> err,
458                                       std::function<void(String)> wrn) OVERRIDE;
459        VMFnResult* exec(VMFnArgs* args) OVERRIDE;
460  };  };
461    
462  /**  /**
463   * Implements the built-in search() script function.   * Implements the built-in search() script function.
464   */   */
465  class CoreVMFunction_search : public VMIntResultFunction {  class CoreVMFunction_search FINAL : public VMIntResultFunction {
466        using Super = VMIntResultFunction; // just an alias for the super class
467  public:  public:
468      int minRequiredArgs() const { return 2; }      StdUnit_t returnUnitType(VMFnArgs* args) OVERRIDE { return VM_NO_UNIT; }
469      int maxAllowedArgs() const { return 2; }      bool returnsFinal(VMFnArgs* args) OVERRIDE { return false; }
470      bool acceptsArgType(int iArg, ExprType_t type) const;      vmint minRequiredArgs() const OVERRIDE { return 2; }
471      ExprType_t argType(int iArg) const;      vmint maxAllowedArgs() const OVERRIDE { return 2; }
472      VMFnResult* exec(VMFnArgs* args);      bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE;
473        void checkArgs(VMFnArgs* args, std::function<void(String)> err,
474                                       std::function<void(String)> wrn) OVERRIDE;
475        VMFnResult* exec(VMFnArgs* args) OVERRIDE;
476  };  };
477    
478  /**  /**
479   * Implements the built-in sort() script function.   * Implements the built-in sort() script function.
480   */   */
481  class CoreVMFunction_sort : public VMEmptyResultFunction {  class CoreVMFunction_sort FINAL : public VMEmptyResultFunction {
482    public:
483        vmint minRequiredArgs() const OVERRIDE { return 1; }
484        vmint maxAllowedArgs() const OVERRIDE { return 2; }
485        bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE;
486        bool modifiesArg(vmint iArg) const OVERRIDE { return iArg == 0; }
487        VMFnResult* exec(VMFnArgs* args) OVERRIDE;
488    };
489    
490    /**
491     * Implements the built-in real_to_int() script function and its short hand
492     * variant int(). The behaviour of the two built-in script functions are
493     * identical ATM.
494     */
495    class CoreVMFunction_real_to_int FINAL : public VMIntResultFunction {
496    public:
497        StdUnit_t returnUnitType(VMFnArgs* args) OVERRIDE;
498        bool returnsFinal(VMFnArgs* args) OVERRIDE;
499        vmint minRequiredArgs() const OVERRIDE { return 1; }
500        vmint maxAllowedArgs() const OVERRIDE { return 1; }
501        bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE { return type == REAL_EXPR; }
502        bool acceptsArgUnitType(vmint iArg, StdUnit_t type) const OVERRIDE { return true; }
503        bool acceptsArgUnitPrefix(vmint iArg, StdUnit_t type) const OVERRIDE { return true; }
504        bool acceptsArgFinal(vmint iArg) const OVERRIDE { return true; }
505        VMFnResult* exec(VMFnArgs* args) OVERRIDE;
506    };
507    
508    /**
509     * Implements the built-in int_to_real() script function and its short hand
510     * variant real(). The behaviour of the two built-in script functions are
511     * identical ATM.
512     */
513    class CoreVMFunction_int_to_real FINAL : public VMRealResultFunction {
514    public:
515        StdUnit_t returnUnitType(VMFnArgs* args) OVERRIDE;
516        bool returnsFinal(VMFnArgs* args) OVERRIDE;
517        vmint minRequiredArgs() const OVERRIDE { return 1; }
518        vmint maxAllowedArgs() const OVERRIDE { return 1; }
519        bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE { return type == INT_EXPR; }
520        bool acceptsArgUnitType(vmint iArg, StdUnit_t type) const OVERRIDE { return true; }
521        bool acceptsArgUnitPrefix(vmint iArg, StdUnit_t type) const OVERRIDE { return true; }
522        bool acceptsArgFinal(vmint iArg) const OVERRIDE { return true; }
523        VMFnResult* exec(VMFnArgs* args) OVERRIDE;
524    };
525    
526    /**
527     * Implements the built-in round() script function.
528     */
529    class CoreVMFunction_round FINAL : public VMRealResultFunction {
530    public:
531        StdUnit_t returnUnitType(VMFnArgs* args) OVERRIDE;
532        bool returnsFinal(VMFnArgs* args) OVERRIDE;
533        vmint minRequiredArgs() const OVERRIDE { return 1; }
534        vmint maxAllowedArgs() const OVERRIDE { return 1; }
535        bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE { return type == REAL_EXPR; }
536        bool acceptsArgUnitType(vmint iArg, StdUnit_t type) const OVERRIDE { return true; }
537        bool acceptsArgUnitPrefix(vmint iArg, StdUnit_t type) const OVERRIDE { return true; }
538        bool acceptsArgFinal(vmint iArg) const OVERRIDE { return true; }
539        VMFnResult* exec(VMFnArgs* args) OVERRIDE;
540    };
541    
542    /**
543     * Implements the built-in ceil() script function.
544     */
545    class CoreVMFunction_ceil FINAL : public VMRealResultFunction {
546    public:
547        StdUnit_t returnUnitType(VMFnArgs* args) OVERRIDE;
548        bool returnsFinal(VMFnArgs* args) OVERRIDE;
549        vmint minRequiredArgs() const OVERRIDE { return 1; }
550        vmint maxAllowedArgs() const OVERRIDE { return 1; }
551        bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE { return type == REAL_EXPR; }
552        bool acceptsArgUnitType(vmint iArg, StdUnit_t type) const OVERRIDE { return true; }
553        bool acceptsArgUnitPrefix(vmint iArg, StdUnit_t type) const OVERRIDE { return true; }
554        bool acceptsArgFinal(vmint iArg) const OVERRIDE { return true; }
555        VMFnResult* exec(VMFnArgs* args) OVERRIDE;
556    };
557    
558    /**
559     * Implements the built-in floor() script function.
560     */
561    class CoreVMFunction_floor FINAL : public VMRealResultFunction {
562    public:
563        StdUnit_t returnUnitType(VMFnArgs* args) OVERRIDE;
564        bool returnsFinal(VMFnArgs* args) OVERRIDE;
565        vmint minRequiredArgs() const OVERRIDE { return 1; }
566        vmint maxAllowedArgs() const OVERRIDE { return 1; }
567        bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE { return type == REAL_EXPR; }
568        bool acceptsArgUnitType(vmint iArg, StdUnit_t type) const OVERRIDE { return true; }
569        bool acceptsArgUnitPrefix(vmint iArg, StdUnit_t type) const OVERRIDE { return true; }
570        bool acceptsArgFinal(vmint iArg) const OVERRIDE { return true; }
571        VMFnResult* exec(VMFnArgs* args) OVERRIDE;
572    };
573    
574    /**
575     * Implements the built-in sqrt() script function.
576     */
577    class CoreVMFunction_sqrt FINAL : public VMRealResultFunction {
578    public:
579        StdUnit_t returnUnitType(VMFnArgs* args) OVERRIDE;
580        bool returnsFinal(VMFnArgs* args) OVERRIDE;
581        vmint minRequiredArgs() const OVERRIDE { return 1; }
582        vmint maxAllowedArgs() const OVERRIDE { return 1; }
583        bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE { return type == REAL_EXPR; }
584        bool acceptsArgUnitType(vmint iArg, StdUnit_t type) const OVERRIDE { return true; }
585        bool acceptsArgUnitPrefix(vmint iArg, StdUnit_t type) const OVERRIDE { return true; }
586        bool acceptsArgFinal(vmint iArg) const OVERRIDE { return true; }
587        VMFnResult* exec(VMFnArgs* args) OVERRIDE;
588    };
589    
590    /**
591     * Implements the built-in log() script function.
592     */
593    class CoreVMFunction_log FINAL : public VMRealResultFunction {
594    public:
595        StdUnit_t returnUnitType(VMFnArgs* args) OVERRIDE;
596        bool returnsFinal(VMFnArgs* args) OVERRIDE;
597        vmint minRequiredArgs() const OVERRIDE { return 1; }
598        vmint maxAllowedArgs() const OVERRIDE { return 1; }
599        bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE { return type == REAL_EXPR; }
600        bool acceptsArgUnitType(vmint iArg, StdUnit_t type) const OVERRIDE { return true; }
601        bool acceptsArgUnitPrefix(vmint iArg, StdUnit_t type) const OVERRIDE { return true; }
602        bool acceptsArgFinal(vmint iArg) const OVERRIDE { return true; }
603        VMFnResult* exec(VMFnArgs* args) OVERRIDE;
604    };
605    
606    /**
607     * Implements the built-in log2() script function.
608     */
609    class CoreVMFunction_log2 FINAL : public VMRealResultFunction {
610    public:
611        StdUnit_t returnUnitType(VMFnArgs* args) OVERRIDE;
612        bool returnsFinal(VMFnArgs* args) OVERRIDE;
613        vmint minRequiredArgs() const OVERRIDE { return 1; }
614        vmint maxAllowedArgs() const OVERRIDE { return 1; }
615        bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE { return type == REAL_EXPR; }
616        bool acceptsArgUnitType(vmint iArg, StdUnit_t type) const OVERRIDE { return true; }
617        bool acceptsArgUnitPrefix(vmint iArg, StdUnit_t type) const OVERRIDE { return true; }
618        bool acceptsArgFinal(vmint iArg) const OVERRIDE { return true; }
619        VMFnResult* exec(VMFnArgs* args) OVERRIDE;
620    };
621    
622    /**
623     * Implements the built-in log10() script function.
624     */
625    class CoreVMFunction_log10 FINAL : public VMRealResultFunction {
626    public:
627        StdUnit_t returnUnitType(VMFnArgs* args) OVERRIDE;
628        bool returnsFinal(VMFnArgs* args) OVERRIDE;
629        vmint minRequiredArgs() const OVERRIDE { return 1; }
630        vmint maxAllowedArgs() const OVERRIDE { return 1; }
631        bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE { return type == REAL_EXPR; }
632        bool acceptsArgUnitType(vmint iArg, StdUnit_t type) const OVERRIDE { return true; }
633        bool acceptsArgUnitPrefix(vmint iArg, StdUnit_t type) const OVERRIDE { return true; }
634        bool acceptsArgFinal(vmint iArg) const OVERRIDE { return true; }
635        VMFnResult* exec(VMFnArgs* args) OVERRIDE;
636    };
637    
638    /**
639     * Implements the built-in exp() script function.
640     */
641    class CoreVMFunction_exp FINAL : public VMRealResultFunction {
642    public:
643        StdUnit_t returnUnitType(VMFnArgs* args) OVERRIDE;
644        bool returnsFinal(VMFnArgs* args) OVERRIDE;
645        vmint minRequiredArgs() const OVERRIDE { return 1; }
646        vmint maxAllowedArgs() const OVERRIDE { return 1; }
647        bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE { return type == REAL_EXPR; }
648        bool acceptsArgUnitType(vmint iArg, StdUnit_t type) const OVERRIDE { return true; }
649        bool acceptsArgUnitPrefix(vmint iArg, StdUnit_t type) const OVERRIDE { return true; }
650        bool acceptsArgFinal(vmint iArg) const OVERRIDE { return true; }
651        VMFnResult* exec(VMFnArgs* args) OVERRIDE;
652    };
653    
654    /**
655     * Implements the built-in pow() script function.
656     */
657    class CoreVMFunction_pow FINAL : public VMRealResultFunction {
658        using Super = VMRealResultFunction; // just an alias for the super class
659    public:
660        StdUnit_t returnUnitType(VMFnArgs* args) OVERRIDE;
661        bool returnsFinal(VMFnArgs* args) OVERRIDE;
662        vmint minRequiredArgs() const OVERRIDE { return 2; }
663        vmint maxAllowedArgs() const OVERRIDE { return 2; }
664        bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE { return type == REAL_EXPR; }
665        bool acceptsArgUnitType(vmint iArg, StdUnit_t type) const OVERRIDE;
666        bool acceptsArgUnitPrefix(vmint iArg, StdUnit_t type) const OVERRIDE;
667        bool acceptsArgFinal(vmint iArg) const OVERRIDE { return iArg == 0; }
668        VMFnResult* exec(VMFnArgs* args) OVERRIDE;
669    };
670    
671    /**
672     * Implements the built-in sin() script function.
673     */
674    class CoreVMFunction_sin FINAL : public VMRealResultFunction {
675    public:
676        StdUnit_t returnUnitType(VMFnArgs* args) OVERRIDE;
677        bool returnsFinal(VMFnArgs* args) OVERRIDE;
678        vmint minRequiredArgs() const OVERRIDE { return 1; }
679        vmint maxAllowedArgs() const OVERRIDE { return 1; }
680        bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE { return type == REAL_EXPR; }
681        bool acceptsArgUnitType(vmint iArg, StdUnit_t type) const OVERRIDE { return true; }
682        bool acceptsArgUnitPrefix(vmint iArg, StdUnit_t type) const OVERRIDE { return true; }
683        bool acceptsArgFinal(vmint iArg) const OVERRIDE { return true; }
684        VMFnResult* exec(VMFnArgs* args) OVERRIDE;
685    };
686    
687    /**
688     * Implements the built-in cos() script function.
689     */
690    class CoreVMFunction_cos FINAL : public VMRealResultFunction {
691    public:
692        StdUnit_t returnUnitType(VMFnArgs* args) OVERRIDE;
693        bool returnsFinal(VMFnArgs* args) OVERRIDE;
694        vmint minRequiredArgs() const OVERRIDE { return 1; }
695        vmint maxAllowedArgs() const OVERRIDE { return 1; }
696        bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE { return type == REAL_EXPR; }
697        bool acceptsArgUnitType(vmint iArg, StdUnit_t type) const OVERRIDE { return true; }
698        bool acceptsArgUnitPrefix(vmint iArg, StdUnit_t type) const OVERRIDE { return true; }
699        bool acceptsArgFinal(vmint iArg) const OVERRIDE { return true; }
700        VMFnResult* exec(VMFnArgs* args) OVERRIDE;
701    };
702    
703    /**
704     * Implements the built-in tan() script function.
705     */
706    class CoreVMFunction_tan FINAL : public VMRealResultFunction {
707    public:
708        StdUnit_t returnUnitType(VMFnArgs* args) OVERRIDE;
709        bool returnsFinal(VMFnArgs* args) OVERRIDE;
710        vmint minRequiredArgs() const OVERRIDE { return 1; }
711        vmint maxAllowedArgs() const OVERRIDE { return 1; }
712        bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE { return type == REAL_EXPR; }
713        bool acceptsArgUnitType(vmint iArg, StdUnit_t type) const OVERRIDE { return true; }
714        bool acceptsArgUnitPrefix(vmint iArg, StdUnit_t type) const OVERRIDE { return true; }
715        bool acceptsArgFinal(vmint iArg) const OVERRIDE { return true; }
716        VMFnResult* exec(VMFnArgs* args) OVERRIDE;
717    };
718    
719    /**
720     * Implements the built-in asin() script function.
721     */
722    class CoreVMFunction_asin FINAL : public VMRealResultFunction {
723    public:
724        StdUnit_t returnUnitType(VMFnArgs* args) OVERRIDE;
725        bool returnsFinal(VMFnArgs* args) OVERRIDE;
726        vmint minRequiredArgs() const OVERRIDE { return 1; }
727        vmint maxAllowedArgs() const OVERRIDE { return 1; }
728        bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE { return type == REAL_EXPR; }
729        bool acceptsArgUnitType(vmint iArg, StdUnit_t type) const OVERRIDE { return true; }
730        bool acceptsArgUnitPrefix(vmint iArg, StdUnit_t type) const OVERRIDE { return true; }
731        bool acceptsArgFinal(vmint iArg) const OVERRIDE { return true; }
732        VMFnResult* exec(VMFnArgs* args) OVERRIDE;
733    };
734    
735    /**
736     * Implements the built-in acos() script function.
737     */
738    class CoreVMFunction_acos FINAL : public VMRealResultFunction {
739    public:
740        StdUnit_t returnUnitType(VMFnArgs* args) OVERRIDE;
741        bool returnsFinal(VMFnArgs* args) OVERRIDE;
742        vmint minRequiredArgs() const OVERRIDE { return 1; }
743        vmint maxAllowedArgs() const OVERRIDE { return 1; }
744        bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE { return type == REAL_EXPR; }
745        bool acceptsArgUnitType(vmint iArg, StdUnit_t type) const OVERRIDE { return true; }
746        bool acceptsArgUnitPrefix(vmint iArg, StdUnit_t type) const OVERRIDE { return true; }
747        bool acceptsArgFinal(vmint iArg) const OVERRIDE { return true; }
748        VMFnResult* exec(VMFnArgs* args) OVERRIDE;
749    };
750    
751    /**
752     * Implements the built-in atan() script function.
753     */
754    class CoreVMFunction_atan FINAL : public VMRealResultFunction {
755  public:  public:
756      int minRequiredArgs() const { return 1; }      StdUnit_t returnUnitType(VMFnArgs* args) OVERRIDE;
757      int maxAllowedArgs() const { return 2; }      bool returnsFinal(VMFnArgs* args) OVERRIDE;
758      bool acceptsArgType(int iArg, ExprType_t type) const;      vmint minRequiredArgs() const OVERRIDE { return 1; }
759      ExprType_t argType(int iArg) const;      vmint maxAllowedArgs() const OVERRIDE { return 1; }
760      bool modifiesArg(int iArg) const { return iArg == 0; }      bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE { return type == REAL_EXPR; }
761      VMFnResult* exec(VMFnArgs* args);      bool acceptsArgUnitType(vmint iArg, StdUnit_t type) const OVERRIDE { return true; }
762        bool acceptsArgUnitPrefix(vmint iArg, StdUnit_t type) const OVERRIDE { return true; }
763        bool acceptsArgFinal(vmint iArg) const OVERRIDE { return true; }
764        VMFnResult* exec(VMFnArgs* args) OVERRIDE;
765  };  };
766    
767  } // namespace LinuxSampler  } // namespace LinuxSampler

Legend:
Removed from v.3551  
changed lines
  Added in v.3678

  ViewVC Help
Powered by ViewVC