/[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 3746 by schoenebeck, Sat Feb 15 11:50:02 2020 UTC revision 3747 by schoenebeck, Sun Feb 16 11:31:46 2020 UTC
# Line 99  public: Line 99  public:
99   */   */
100  class VMEmptyResultFunction : public VMFunction {  class VMEmptyResultFunction : public VMFunction {
101  protected:  protected:
102        VMEmptyResultFunction() : result(NULL) {}
103      virtual ~VMEmptyResultFunction() {}      virtual ~VMEmptyResultFunction() {}
104      ExprType_t returnType(VMFnArgs* args) OVERRIDE { return EMPTY_EXPR; }      ExprType_t returnType(VMFnArgs* args) OVERRIDE { return EMPTY_EXPR; }
105      StdUnit_t returnUnitType(VMFnArgs* args) OVERRIDE { return VM_NO_UNIT; }      StdUnit_t returnUnitType(VMFnArgs* args) OVERRIDE { return VM_NO_UNIT; }
# Line 106  protected: Line 107  protected:
107      VMFnResult* errorResult();      VMFnResult* errorResult();
108      VMFnResult* successResult();      VMFnResult* successResult();
109      bool modifiesArg(vmint iArg) const OVERRIDE { return false; }      bool modifiesArg(vmint iArg) const OVERRIDE { return false; }
110        VMFnResult* allocResult(VMFnArgs* args) OVERRIDE { return new VMEmptyResult(); }
111        void bindResult(VMFnResult* res) OVERRIDE;
112        VMFnResult* boundResult() const OVERRIDE;
113  protected:  protected:
114      VMEmptyResult result;      VMEmptyResult* result;
115  };  };
116    
117  struct VMIntFnResDef {  struct VMIntFnResDef {
# Line 126  struct VMRealFnResDef { Line 130  struct VMRealFnResDef {
130   */   */
131  class VMIntResultFunction : public VMFunction {  class VMIntResultFunction : public VMFunction {
132  protected:  protected:
133        VMIntResultFunction() : result(NULL) {}
134      virtual ~VMIntResultFunction() {}      virtual ~VMIntResultFunction() {}
135      ExprType_t returnType(VMFnArgs* args) OVERRIDE { return INT_EXPR; }      ExprType_t returnType(VMFnArgs* args) OVERRIDE { return INT_EXPR; }
136      VMFnResult* errorResult(vmint i = 0);      VMFnResult* errorResult(vmint i = 0);
# Line 133  protected: Line 138  protected:
138      VMFnResult* successResult(vmint i = 0);      VMFnResult* successResult(vmint i = 0);
139      VMFnResult* successResult(VMIntFnResDef res);      VMFnResult* successResult(VMIntFnResDef res);
140      bool modifiesArg(vmint iArg) const OVERRIDE { return false; }      bool modifiesArg(vmint iArg) const OVERRIDE { return false; }
141        VMFnResult* allocResult(VMFnArgs* args) OVERRIDE { return new VMIntResult(); }
142        void bindResult(VMFnResult* res) OVERRIDE;
143        VMFnResult* boundResult() const OVERRIDE;
144  protected:  protected:
145      VMIntResult result;      VMIntResult* result;
146  };  };
147    
148  /**  /**
# Line 143  protected: Line 151  protected:
151   */   */
152  class VMRealResultFunction : public VMFunction {  class VMRealResultFunction : public VMFunction {
153  protected:  protected:
154        VMRealResultFunction() : result(NULL) {}
155      virtual ~VMRealResultFunction() {}      virtual ~VMRealResultFunction() {}
156      ExprType_t returnType(VMFnArgs* args) OVERRIDE { return REAL_EXPR; }      ExprType_t returnType(VMFnArgs* args) OVERRIDE { return REAL_EXPR; }
157      VMFnResult* errorResult(vmfloat f = 0);      VMFnResult* errorResult(vmfloat f = 0);
# Line 150  protected: Line 159  protected:
159      VMFnResult* successResult(vmfloat f = 0);      VMFnResult* successResult(vmfloat f = 0);
160      VMFnResult* successResult(VMRealFnResDef res);      VMFnResult* successResult(VMRealFnResDef res);
161      bool modifiesArg(vmint iArg) const OVERRIDE { return false; }      bool modifiesArg(vmint iArg) const OVERRIDE { return false; }
162        VMFnResult* allocResult(VMFnArgs* args) OVERRIDE { return new VMRealResult(); }
163        void bindResult(VMFnResult* res) OVERRIDE;
164        VMFnResult* boundResult() const OVERRIDE;
165  protected:  protected:
166      VMRealResult result;      VMRealResult* result;
167  };  };
168    
169  /**  /**
# Line 160  protected: Line 172  protected:
172   */   */
173  class VMStringResultFunction : public VMFunction {  class VMStringResultFunction : public VMFunction {
174  protected:  protected:
175        VMStringResultFunction() : result(NULL) {}
176      virtual ~VMStringResultFunction() {}      virtual ~VMStringResultFunction() {}
177      ExprType_t returnType(VMFnArgs* args) OVERRIDE { return STRING_EXPR; }      ExprType_t returnType(VMFnArgs* args) OVERRIDE { return STRING_EXPR; }
178      VMFnResult* errorResult(const String& s = "");      VMFnResult* errorResult(const String& s = "");
179      VMFnResult* successResult(const String& s = "");      VMFnResult* successResult(const String& s = "");
180      bool modifiesArg(vmint iArg) const OVERRIDE { return false; }      bool modifiesArg(vmint iArg) const OVERRIDE { return false; }
181        VMFnResult* allocResult(VMFnArgs* args) OVERRIDE { return new VMStringResult(); }
182        void bindResult(VMFnResult* res) OVERRIDE;
183        VMFnResult* boundResult() const OVERRIDE;
184  protected:  protected:
185      VMStringResult result;      VMStringResult* result;
186  };  };
187    
188  /**  /**
# Line 177  protected: Line 193  protected:
193   */   */
194  class VMNumberResultFunction : public VMFunction {  class VMNumberResultFunction : public VMFunction {
195  protected:  protected:
196        VMNumberResultFunction() : intResult(NULL), realResult(NULL) {}
197      virtual ~VMNumberResultFunction() {}      virtual ~VMNumberResultFunction() {}
198      VMFnResult* errorResult(vmint i);      VMFnResult* errorResult(vmint i);
199      VMFnResult* errorResult(vmfloat f);      VMFnResult* errorResult(vmfloat f);
# Line 187  protected: Line 204  protected:
204      VMFnResult* successIntResult(VMIntFnResDef res);      VMFnResult* successIntResult(VMIntFnResDef res);
205      VMFnResult* successRealResult(VMRealFnResDef res);      VMFnResult* successRealResult(VMRealFnResDef res);
206      bool modifiesArg(vmint iArg) const OVERRIDE { return false; }      bool modifiesArg(vmint iArg) const OVERRIDE { return false; }
207        VMFnResult* allocResult(VMFnArgs* args) OVERRIDE;
208        void bindResult(VMFnResult* res) OVERRIDE;
209        VMFnResult* boundResult() const OVERRIDE;
210  protected:  protected:
211      VMIntResult intResult;      VMIntResult* intResult;
212      VMRealResult realResult;      VMRealResult* realResult;
213  };  };
214    
215    

Legend:
Removed from v.3746  
changed lines
  Added in v.3747

  ViewVC Help
Powered by ViewVC