/[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 3076 by schoenebeck, Thu Jan 5 18:00:52 2017 UTC revision 3551 by schoenebeck, Thu Aug 1 10:22:56 2019 UTC
# Line 1  Line 1 
1  /*  /*
2   * Copyright (c) 2014-2016 Christian Schoenebeck   * Copyright (c) 2014-2019 Christian Schoenebeck
3   *   *
4   * http://www.linuxsampler.org   * http://www.linuxsampler.org
5   *   *
# Line 133  public: Line 133  public:
133   */   */
134  class CoreVMFunction_exit : public VMEmptyResultFunction {  class CoreVMFunction_exit : public VMEmptyResultFunction {
135  public:  public:
136      int minRequiredArgs() const { return 0; }      CoreVMFunction_exit(ScriptVM* vm) : vm(vm) {}
137      int maxAllowedArgs() const { return 0; }      int minRequiredArgs() const OVERRIDE { return 0; }
138      bool acceptsArgType(int iArg, ExprType_t type) const { return false; }      int maxAllowedArgs() const OVERRIDE;
139      ExprType_t argType(int iArg) const { return INT_EXPR; /*whatever*/ }      bool acceptsArgType(int iArg, ExprType_t type) const OVERRIDE;
140        ExprType_t argType(int iArg) const OVERRIDE { return INT_EXPR; }
141      VMFnResult* exec(VMFnArgs* args);      VMFnResult* exec(VMFnArgs* args);
142    protected:
143        ScriptVM* vm;
144  };  };
145    
146  /**  /**
# Line 277  public: Line 280  public:
280      VMFnResult* exec(VMFnArgs* args);      VMFnResult* exec(VMFnArgs* args);
281  };  };
282    
283    /**
284     * Implements the built-in array_equal() script function.
285     */
286    class CoreVMFunction_array_equal : public VMIntResultFunction {
287    public:
288        int minRequiredArgs() const { return 2; }
289        int maxAllowedArgs() const { return 2; }
290        bool acceptsArgType(int iArg, ExprType_t type) const { return type == INT_ARR_EXPR; }
291        ExprType_t argType(int iArg) const { return INT_ARR_EXPR; }
292        VMFnResult* exec(VMFnArgs* args);
293    };
294    
295    /**
296     * Implements the built-in search() script function.
297     */
298    class CoreVMFunction_search : public VMIntResultFunction {
299    public:
300        int minRequiredArgs() const { return 2; }
301        int maxAllowedArgs() const { return 2; }
302        bool acceptsArgType(int iArg, ExprType_t type) const;
303        ExprType_t argType(int iArg) const;
304        VMFnResult* exec(VMFnArgs* args);
305    };
306    
307    /**
308     * Implements the built-in sort() script function.
309     */
310    class CoreVMFunction_sort : public VMEmptyResultFunction {
311    public:
312        int minRequiredArgs() const { return 1; }
313        int maxAllowedArgs() const { return 2; }
314        bool acceptsArgType(int iArg, ExprType_t type) const;
315        ExprType_t argType(int iArg) const;
316        bool modifiesArg(int iArg) const { return iArg == 0; }
317        VMFnResult* exec(VMFnArgs* args);
318    };
319    
320  } // namespace LinuxSampler  } // namespace LinuxSampler
321    
322  #endif // LS_COREVMFUNCTIONS_H  #endif // LS_COREVMFUNCTIONS_H

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

  ViewVC Help
Powered by ViewVC