The interface for a script that can be compiled to bytecode. More...
#include <script.h>
Public Member Functions | |
virtual iScriptCompilable * | GetAsScriptCompilable () |
If your only handle to this is a pointer of type iScript this can be called to get a pointer to an iScriptCompilable if it would be valid. More... | |
virtual BinaryTools::BinaryBuffer | GetByteCode () const =0 |
Get the compiled version of the code if it is available. More... | |
virtual iScriptCompilable * | GetMostDerived () |
Get a pointer to the most Derived type of this class. More... | |
virtual bool | IsCompilable () const |
Any script implementing this class is compilable. More... | |
virtual bool | IsCompiled () const =0 |
Has this script already been compiled into a bytecode. More... | |
virtual void | SetByteCode (BinaryTools::BinaryBuffer Code)=0 |
Set the bytecode used when this script is executed. More... | |
Public Member Functions inherited from Mezzanine::Scripting::iScript | |
iScript () | |
default constructor More... | |
virtual void | AddArgument (CountedPtr< iScriptArgument > Arg)=0 |
This adds an argument to be passed to the script. More... | |
virtual bool | CanReturnMultples () |
Does this script support multiple return values. More... | |
virtual void | ClearArguments ()=0 |
Remove all the ARGs!!! http://imgur.com/DJhw7. More... | |
Whole | DecrementReferenceCount () |
Decrease the reference count by one and return the updated count. More... | |
virtual CountedPtr < iScriptArgument > | GetArgument (Whole ArgNumber) const =0 |
Retrieve a argument previously passed in. More... | |
virtual Whole | GetArgumentCount () const =0 |
How many arguments have been attached to this script? More... | |
virtual iScriptMultipleReturn * | GetAsiScriptMultipleReturn () |
If your only handle to this is a pointer of type iScript this can be called to get a pointer to an iScriptMultipleReturn if it would be valid. More... | |
virtual iScriptCompilable * | GetAsScriptCompilable () const |
If your only handle to this is a pointer of type iScript this can be called to get a pointer to an iScriptCompilable if it would be valid. More... | |
Whole | GetReferenceCount () |
Get the current amount of references. More... | |
virtual iScript * | GetReferenceCountTargetAsPointer () |
Gets the actual pointer to the target. More... | |
virtual String | GetSourceCode () const =0 |
If present this returns the code of script. More... | |
Whole | IncrementReferenceCount () |
Increase the reference count by one and return the updated count. More... | |
virtual void | RemoveArgument (CountedPtr< iScriptArgument > Arg)=0 |
Remove an argument based on a CountedPtr to the script. More... | |
virtual void | RemoveArgument (Whole ArgNumber)=0 |
Remove a Script argument based on the order it will be passed into the Script at Execution. More... | |
virtual void | SetSourceCode (const String &Code)=0 |
Sets the string version of the script. More... | |
Additional Inherited Members | |
Protected Attributes inherited from Mezzanine::Scripting::iScript | |
Whole | RefCount |
This is the Counter that stores how many references exist. | |
The interface for a script that can be compiled to bytecode.
All the members that all script for all languages must implement that support dynamic compilation in the Mezzanine.
These are tiny pieces of data that can be run like miniature programs. In some cases they will be compiled to a bytecode that can swiftly be executed by the appropriate bytecode interpretter. This is generally faster than interpretting text, but slower than running machine code.
This class is designed for use with multiple inheritance. If a script returns true from IsCompilable then its pointer can safely be cast to a ScriptCompilable pointer.
Add sample code of safe cast in ScriptCompilable, becuase that is kinda wierd.
Put the Virtual inheritance back into the this class
|
inlinevirtual |
If your only handle to this is a pointer of type iScript this can be called to get a pointer to an iScriptCompilable if it would be valid.
Reimplemented from Mezzanine::Scripting::iScript.
|
pure virtual |
Get the compiled version of the code if it is available.
|
inlinevirtual |
Get a pointer to the most Derived type of this class.
Reimplemented from Mezzanine::Scripting::iScript.
|
inlinevirtual |
Any script implementing this class is compilable.
Reimplemented from Mezzanine::Scripting::iScript.
|
pure virtual |
Has this script already been compiled into a bytecode.
Reimplemented from Mezzanine::Scripting::iScript.
|
pure virtual |
Set the bytecode used when this script is executed.
Code | The Binary version of the script |
This is what will be executed. No reverse compiling support is provided, so it is advisable that implementations of this either clear the source code or set it to the source that matches the compiled binary.