Spinning Topp Logo BlackTopp Studios
inc
Public Member Functions | Protected Attributes | List of all members
Mezzanine::Physics::SimulationMonopolyWorkUnit Class Reference

This is a Mezzanine::Threading::iWorkUnit for the multi-threaded processing of physics simulations. More...

#include <physicsmanager.h>

+ Inheritance diagram for Mezzanine::Physics::SimulationMonopolyWorkUnit:
+ Collaboration diagram for Mezzanine::Physics::SimulationMonopolyWorkUnit:

Public Member Functions

 SimulationMonopolyWorkUnit (PhysicsManager *Target)
 Class constructor. More...
 
virtual ~SimulationMonopolyWorkUnit ()
 Class destructor.
 
virtual void DoWork (Threading::DefaultThreadSpecificStorage::Type &CurrentThreadStorage)
 This does any required update of the Graphical Scene graph and REnders one frame. More...
 
virtual void UseThreads (const Whole &AmountToUse)
 A no-op but declared for compatibility with Monopoly work unit. More...
 
virtual Whole UsingThreadCount ()
 Gets the number of threads this work unit will attempt to use during it's monopoly. More...
 
- Public Member Functions inherited from Mezzanine::Threading::MonopolyWorkUnit
virtual ~MonopolyWorkUnit ()
 A virtual destructor, currently empty.
 
- 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.
 

Protected Attributes

PhysicsManagerTargetManager
 A pointer to the manager this work unit is processing. More...
 
- 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

This is a Mezzanine::Threading::iWorkUnit for the multi-threaded processing of physics simulations.

Definition at line 145 of file physicsmanager.h.

Constructor & Destructor Documentation

Mezzanine::Physics::SimulationMonopolyWorkUnit::SimulationMonopolyWorkUnit ( PhysicsManager Target)

Class constructor.

Parameters
TargetThe PhysicsManager this work unit will process during the frame.

Definition at line 289 of file physicsmanager.cpp.

Member Function Documentation

void Mezzanine::Physics::SimulationMonopolyWorkUnit::DoWork ( Threading::DefaultThreadSpecificStorage::Type CurrentThreadStorage)
virtual

This does any required update of the Graphical Scene graph and REnders one frame.

Parameters
CurrentThreadStorageThe storage class for all resources owned by this work unit during it's execution.

Implements Mezzanine::Threading::iWorkUnit.

Definition at line 304 of file physicsmanager.cpp.

void Mezzanine::Physics::SimulationMonopolyWorkUnit::UseThreads ( const Whole AmountToUse)
virtual

A no-op but declared for compatibility with Monopoly work unit.

Parameters
AmountToUseThe number of threads permitted for use, if this were implemented

Implements Mezzanine::Threading::MonopolyWorkUnit.

Definition at line 298 of file physicsmanager.cpp.

Whole Mezzanine::Physics::SimulationMonopolyWorkUnit::UsingThreadCount ( )
virtual

Gets the number of threads this work unit will attempt to use during it's monopoly.

Returns
Returns a Whole representing the number of threads that will be attempted to be created during running of this monopoly.

Implements Mezzanine::Threading::MonopolyWorkUnit.

Definition at line 301 of file physicsmanager.cpp.

Member Data Documentation

PhysicsManager* Mezzanine::Physics::SimulationMonopolyWorkUnit::TargetManager
protected

A pointer to the manager this work unit is processing.

Definition at line 150 of file physicsmanager.h.


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