Spinning Topp Logo BlackTopp Studios
inc
Public Member Functions | List of all members
Mezzanine::Scripting::iScriptWorkUnit Class Referenceabstract

The interface for a container of script that can be executed each frame. More...

#include <scriptworkunit.h>

+ Inheritance diagram for Mezzanine::Scripting::iScriptWorkUnit:
+ Collaboration diagram for Mezzanine::Scripting::iScriptWorkUnit:

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< iScriptGetScript (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 iWorkUnitGetDependency (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.
 

Detailed Description

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.

Member Function Documentation

virtual void Mezzanine::Scripting::iScriptWorkUnit::AddScript ( CountedPtr< iScript ScriptToAdd)
pure virtual

This adds a script to list to be run each frame.

Parameters
ScriptToAddA CountedPtr to a script

Implemented in Mezzanine::Scripting::Lua::Lua51WorkUnit.

virtual void Mezzanine::Scripting::iScriptWorkUnit::ClearScripts ( )
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.

virtual CountedPtr<iScript> Mezzanine::Scripting::iScriptWorkUnit::GetScript ( Whole  Index)
pure virtual

Retrieve a Script previously passed in.

Parameters
IndexThe index of the passed parameter to retrun.
Returns
A reference counted pointer to an iScript.

Implemented in Mezzanine::Scripting::Lua::Lua51WorkUnit.

virtual Whole Mezzanine::Scripting::iScriptWorkUnit::GetScriptCount ( ) const
pure virtual

How many Scripts have been added to this workunit.

Returns
A Whole containing the amount of iScripts passed in so far.

Implemented in Mezzanine::Scripting::Lua::Lua51WorkUnit.

virtual void Mezzanine::Scripting::iScriptWorkUnit::RemoveScript ( CountedPtr< iScript ScriptToRemove)
pure virtual

Remove a Script.

Parameters
ScriptToRemoveA CountedPtr matching the one to be removed.

Implemented in Mezzanine::Scripting::Lua::Lua51WorkUnit.

virtual void Mezzanine::Scripting::iScriptWorkUnit::RemoveScript ( Whole  Index)
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.

Parameters
IndexThe 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.


The documentation for this class was generated from the following file: