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

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

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

revision 3746 by schoenebeck, Fri Jan 31 10:57:53 2020 UTC revision 3747 by schoenebeck, Sun Feb 16 11:31:46 2020 UTC
# Line 817  namespace LinuxSampler { Line 817  namespace LinuxSampler {
817       */       */
818      class VMFnResult {      class VMFnResult {
819      public:      public:
820            virtual ~VMFnResult();
821    
822          /**          /**
823           * Returns the result value of the function call, represented by a high           * Returns the result value of the function call, represented by a high
824           * level expression object.           * level expression object.
# Line 1057  namespace LinuxSampler { Line 1059  namespace LinuxSampler {
1059                                 std::function<void(String)> err,                                 std::function<void(String)> err,
1060                                 std::function<void(String)> wrn);                                 std::function<void(String)> wrn);
1061    
1062          /**          /** @brief Allocate storage location for function's result value.
1063             *
1064             * This method is invoked at parse time to allocate object(s) suitable
1065             * to store a result value returned after executing this function
1066             * implementation. Function implementation returns an instance of some
1067             * type (being subclass of @c VMFnArgs) which allows it to store its
1068             * result value to appropriately. Life time of the returned object is
1069             * controlled by caller which will call delete on returned object once
1070             * it no longer needs the storage location anymore (usually when script
1071             * is unloaded).
1072             *
1073             * @param args - function arguments for executing this built-in function
1074             * @returns storage location for storing a result value of this function
1075             */
1076            virtual VMFnResult* allocResult(VMFnArgs* args) = 0;
1077    
1078            /** @brief Bind storage location for a result value to this function.
1079             *
1080             * This method is called to tell this function implementation where it
1081             * shall store its result value to when @c exec() is called
1082             * subsequently.
1083             *
1084             * @param res - storage location for a result value, previously
1085             *              allocated by calling @c allocResult()
1086             */
1087            virtual void bindResult(VMFnResult* res) = 0;
1088    
1089            /** @brief Current storage location bound to this function for result.
1090             *
1091             * Returns storage location currently being bound for result value of
1092             * this function.
1093             */
1094            virtual VMFnResult* boundResult() const = 0;
1095    
1096            /** @brief Execute this function.
1097             *
1098           * Implements the actual function execution. This exec() method is           * Implements the actual function execution. This exec() method is
1099           * called by the VM whenever this function implementation shall be           * called by the VM whenever this function implementation shall be
1100           * executed at script runtime. This method blocks until the function           * executed at script runtime. This method blocks until the function
1101           * call completed.           * call completed.
1102           *           *
1103             * @remarks The actual storage location for returning a result value is
1104             * assigned by calling @c bindResult() before invoking @c exec().
1105             *
1106           * @param args - function arguments for executing this built-in function           * @param args - function arguments for executing this built-in function
1107           * @returns function's return value (if any) and general status           * @returns function's return value (if any) and general status
1108           *          informations (i.e. whether the function call caused a           *          informations (i.e. whether the function call caused a

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

  ViewVC Help
Powered by ViewVC