The interface for a container of script that can be executed each frame. More...
#include <scriptworkunit.h>
Public Member Functions | |
virtual | ~iScriptWorkUnit () |
Virtual deconstructor. | |
virtual void | AddScript (CountedPtr< iScript > ScriptToAdd)=0 |
This adds a script to list to be run each frame. More... | |
virtual void | ClearScripts ()=0 |
Remove all the Scripts!!! http://imgur.com/PI8YiyG. More... | |
virtual CountedPtr< iScript > | GetScript (Whole Index)=0 |
Retrieve a Script previously passed in. More... | |
virtual Whole | GetScriptCount () const =0 |
How many Scripts have been added to this workunit. More... | |
virtual void | RemoveScript (CountedPtr< iScript > ScriptToRemove)=0 |
Remove a Script. More... | |
virtual void | RemoveScript (Whole Index)=0 |
Remove Script based on index. More... | |
Public Member Functions inherited from Mezzanine::Threading::DefaultWorkUnit | |
DefaultWorkUnit () | |
Simple constructor. | |
virtual | ~DefaultWorkUnit () |
Virtual destructor, doesn't actually do much. | |
virtual void | AddDependency (iWorkUnit *NewDependency) |
Force this WorkUnit to Start after another has completed. More... | |
virtual void | ClearDependencies () |
Drop any information about what work units this one depends on. | |
virtual iWorkUnit * | GetDependency (Whole Index) const |
This is used to iterate of all the dependencies. More... | |
virtual Whole | GetDependencyCount () const |
How many other WorkUnits does this one depend on? More... | |
virtual Whole | GetDependentCount (FrameScheduler &SchedulerToCount) |
This returns the count workunits that depend on this work unit. More... | |
virtual Whole | GetImmediateDependencyCount () const |
Get the amount of dependencies that directly count on this for access purposes. More... | |
virtual Whole | GetPerformance () const |
Get the internal rolling average for querying. More... | |
virtual RollingAverage< Whole > & | GetPerformanceLog () |
Get the internal rolling average for querying. More... | |
virtual RunningState | GetRunningState () const |
Retrieves the current RunningState of the thread. More... | |
virtual WorkUnitKey | GetSortingKey (FrameScheduler &SchedulerToCount) |
Get the sorting metadata. More... | |
virtual bool | IsEveryDependencyComplete () |
Check if this WorkUnit could concievably run right now. More... | |
virtual void | operator() (DefaultThreadSpecificStorage::Type &CurrentThreadStorage) |
This does everything required to track metadata and log work. More... | |
virtual void | PrepareForNextFrame () |
This resets the running state and takes any further action required to use the WorkUnit again. | |
virtual void | RemoveDependency (iWorkUnit *RemoveDependency) |
Remove a dependency. More... | |
virtual RunningState | TakeOwnerShip () |
Attempts to atomically start the work unit in the current thread. More... | |
Public Member Functions inherited from Mezzanine::Threading::iWorkUnit | |
virtual | ~iWorkUnit () |
Virtual destructor. | |
virtual void | DoWork (DefaultThreadSpecificStorage::Type &CurrentThreadStorage)=0 |
WorkUnits Must implement these to do the work. | |
Additional Inherited Members | |
Protected Attributes inherited from Mezzanine::Threading::DefaultWorkUnit | |
Int32 | CurrentRunningState |
This controls do work with this after it has. | |
std::vector< iWorkUnit * > | Dependencies |
A collection of of workunits that must be complete before this one can start. | |
DefaultRollingAverage< Whole >::Type | PerformanceLog |
A rolling average of execution times. | |
The interface for a container of script that can be executed each frame.
All the methods that all script wokunits for all languages must implement. These are minimalistic containers which will execute some of all of the scripts the container every frame.
This uses multiple inheritance to minimize the amount of features a scripting langauge with need to implement.
Definition at line 68 of file scriptworkunit.h.
|
pure virtual |
This adds a script to list to be run each frame.
ScriptToAdd | A CountedPtr to a script |
Implemented in Mezzanine::Scripting::Lua::Lua51WorkUnit.
|
pure virtual |
Remove all the Scripts!!! http://imgur.com/PI8YiyG.
This should run in constant time. It still might be slower than removing and reading just one a few Scripts.
Implemented in Mezzanine::Scripting::Lua::Lua51WorkUnit.
|
pure virtual |
Retrieve a Script previously passed in.
Index | The index of the passed parameter to retrun. |
Implemented in Mezzanine::Scripting::Lua::Lua51WorkUnit.
|
pure virtual |
How many Scripts have been added to this workunit.
Implemented in Mezzanine::Scripting::Lua::Lua51WorkUnit.
|
pure virtual |
Remove a Script.
ScriptToRemove | A CountedPtr matching the one to be removed. |
Implemented in Mezzanine::Scripting::Lua::Lua51WorkUnit.
|
pure virtual |
Remove Script based on index.
This removes the specified Script from the internal list. This should be treated as taking linear time, relative to the total count of scripts assigned to this workunit, to run.
Index | The number of the Script to be removed. This behaves similar to an array or vector as it starts counting at 0. |
Implemented in Mezzanine::Scripting::Lua::Lua51WorkUnit.