MezzanineEngine 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Types | Public Member Functions | Protected Attributes | Friends | List of all members
Mezzanine::DebrisManager Class Reference

A manager responsible for the storage and management of all Debris that exist in a world. More...

#include <debrismanager.h>

+ Inheritance diagram for Mezzanine::DebrisManager:
+ Collaboration diagram for Mezzanine::DebrisManager:

Public Types

typedef
DebrisContainer::const_iterator 
ConstDebrisIterator
 Const Iterator type for Debris instances stored by this class.
 
typedef FactoryMap::const_iterator ConstFactoryIterator
 Const Iterator type for DebrisFactory instances stored by this class.
 
typedef std::vector< Debris * > DebrisContainer
 Basic container type for Debris storage by this class.
 
typedef DebrisContainer::iterator DebrisIterator
 Iterator type for Debris instances stored by this class.
 
typedef FactoryMap::iterator FactoryIterator
 Iterator type for DebrisFactory instances stored by this class.
 
typedef std::map< String,
DebrisFactory * > 
FactoryMap
 Basic container type for DebrisFactory storage by this class.
 

Public Member Functions

 DebrisManager ()
 Class constructor.
 
 DebrisManager (XML::Node &XMLNode)
 XML constructor. More...
 
virtual ~DebrisManager ()
 Class destructor.
 
virtual void AddDebrisFactory (DebrisFactory *ToBeAdded)
 Adds/registers a Debris factory with this manager, allowing it to be constructed through this API. More...
 
DebrisCreateDebris (const String &TypeName, const String &InstanceName, const NameValuePairMap &Params)
 Creates a new Debris. More...
 
DebrisCreateDebris (const XML::Node &SelfRoot)
 Creates a new Debris class from an XML node. More...
 
RigidDebrisCreateRigidDebris (const String &Name, const Real Mass)
 Creates a new RigidDebris. More...
 
RigidDebrisCreateRigidDebris (const XML::Node &SelfRoot)
 Creates a new RigidDebris. More...
 
SoftDebrisCreateSoftDebris (const String &Name, const Real Mass)
 Creates a new SoftDebris. More...
 
SoftDebrisCreateSoftDebris (const XML::Node &SelfRoot)
 Creates a new SoftDebris. More...
 
virtual void Deinitialize ()
 Removes this manager from any necessary configuration so it can be safely disposed of. More...
 
virtual void DestroyAllDebris ()
 Destroys all Debriss currently within this manager.
 
virtual void DestroyAllDebrisFactories ()
 Destroys all Debris factories in this manager. More...
 
virtual void DestroyDebris (const Whole Index)
 Destroys an Debris at the specified index. More...
 
virtual void DestroyDebris (Debris *ToBeDestroyed)
 Destroys an Debris. More...
 
virtual void DestroyDebrisFactory (DebrisFactory *ToBeDestroyed)
 Removes and destroys a Debris factory in this manager. More...
 
virtual void DestroyDebrisFactory (const String &ImplName)
 Removes and destroys a Debris factory in this manager. More...
 
virtual DebrisGetDebris (const Whole Index) const
 Gets an Debris by Index. More...
 
virtual DebrisGetDebris (const String &Name) const
 Gets an Debris by Name. More...
 
DebrisUpdateWorkUnitGetDebrisUpdateWork ()
 Gets the work unit responsible for updating Debriss stored by this manager. More...
 
virtual String GetImplementationTypeName () const
 This Allows any manager name to be sent to a stream. Primarily used for logging. More...
 
virtual ManagerType GetInterfaceType () const
 This returns the type of this manager. More...
 
virtual Whole GetNumDebris () const
 Gets the number of Debriss stored in this manager. More...
 
virtual void Initialize ()
 Configures this manager for use prior to entering the main loop. More...
 
virtual void Pause (const UInt32 PL)
 Sets the pause state of this manager, or has no effect depending on the value passed in. More...
 
virtual void RemoveDebrisFactory (DebrisFactory *ToBeRemoved)
 Removes a Debris factory from this manager. More...
 
virtual void RemoveDebrisFactory (const String &ImplName)
 Removes a Debris factory from this manager. More...
 
- Public Member Functions inherited from Mezzanine::WorldManager
 WorldManager ()
 Class constructor.
 
virtual ~WorldManager ()
 Class destructor.
 
virtual void _SetWorld (World *Parent)
 Sets the world this manager belongs to.

Exceptions
Ifthis manager is already initialized, this method will throw an "INVALID_STATE_EXCEPTION".
More...
 
virtual WorldGetWorld () const
 Gets the world this manager belongs to. More...
 
virtual bool IsPaused () const
 Gets whether or not this manager is currently paused. More...
 
- Public Member Functions inherited from Mezzanine::ManagerBase
 ManagerBase ()
 Class constructor.
 
virtual ~ManagerBase ()
 Class destructor.
 
virtual String GetInterfaceTypeAsString () const
 Gets a string of the interface type of this manager. More...
 
bool IsInitialized () const
 Gets whether or not this manager has been initialized. More...
 

Protected Attributes

FactoryMap DebrisFactories
 A map containing all registered Debris type factories. More...
 
DebrisContainer Debriss
 Container storing all Debris belonging to this manager. More...
 
DebrisUpdateWorkUnitDebrisUpdateWork
 The work unit that updates all the Debris stored by this manager. More...
 
Threading::DefaultThreadSpecificStorage::TypeThreadResources
 Can be used for thread safe logging and other thread specific resources. More...
 
- Protected Attributes inherited from Mezzanine::WorldManager
bool OperationsPaused
 This stores whether or not processing for some or all objects in this manager has been paused. More...
 
WorldParentWorld
 A pointer to the world that created this manager. More...
 
- Protected Attributes inherited from Mezzanine::ManagerBase
bool Initialized
 Simple bool indicating whether or not this manager has been initialized. More...
 
EntresolTheEntresol
 The actual pointer to the Entresol core class. More...
 

Friends

class DebrisUpdateWorkUnit
 

Additional Inherited Members

- Static Public Member Functions inherited from Mezzanine::ManagerBase
static String GetTypeAsString (const ManagerType &ManagerType)
 Gets the string form of the type of manager. More...
 
static ManagerType GetTypeFromString (const String &ManagerName)
 Gets the type of manager requested from a string. More...
 

Detailed Description

A manager responsible for the storage and management of all Debris that exist in a world.

More or less Management point for a container of Debris to help keep them sorted.

Definition at line 95 of file debrismanager.h.

Constructor & Destructor Documentation

Mezzanine::DebrisManager::DebrisManager ( XML::Node XMLNode)

XML constructor.

Parameters
XMLNodeThe node of the xml document to construct from.
Todo:
This class currently doesn't initialize anything from XML, if that changes this constructor needs to be expanded.

Definition at line 92 of file debrismanager.cpp.

Member Function Documentation

void Mezzanine::DebrisManager::AddDebrisFactory ( DebrisFactory ToBeAdded)
virtual

Adds/registers a Debris factory with this manager, allowing it to be constructed through this API.

Parameters
ToBeAddedThe Debris factory to be added.

Definition at line 258 of file debrismanager.cpp.

Debris * Mezzanine::DebrisManager::CreateDebris ( const String TypeName,
const String InstanceName,
const NameValuePairMap Params 
)

Creates a new Debris.

Parameters
TypeNameA string containing the name of the type of Debris to be constructed.
InstanceNameA string containing the name to be given to the created Debris.
ParamsA container of additional parameters to be used for the construction of the new Debris.
Returns
Returns a pointer to the created Debris.

Definition at line 165 of file debrismanager.cpp.

Debris * Mezzanine::DebrisManager::CreateDebris ( const XML::Node SelfRoot)

Creates a new Debris class from an XML node.

Remarks
This is mostly useful for deserialization.
Returns
Returns a pointer to the created Debris.

Definition at line 177 of file debrismanager.cpp.

RigidDebris * Mezzanine::DebrisManager::CreateRigidDebris ( const String Name,
const Real  Mass 
)

Creates a new RigidDebris.

Parameters
NameThe name to be given to the new RigidDebris.
MassThe mass of the debris object.
Returns
Returns a pointer to the created Debris.

Definition at line 114 of file debrismanager.cpp.

RigidDebris * Mezzanine::DebrisManager::CreateRigidDebris ( const XML::Node SelfRoot)

Creates a new RigidDebris.

Parameters
SelfRootAn XML::Node containing the data to populate this class with.
Returns
Returns a pointer to the created Debris.

Definition at line 126 of file debrismanager.cpp.

SoftDebris * Mezzanine::DebrisManager::CreateSoftDebris ( const String Name,
const Real  Mass 
)

Creates a new SoftDebris.

Parameters
NameThe name to be given to the new SoftDebris.
MassThe mass of the debris object.
Returns
Returns a pointer to the created Debris.

Definition at line 138 of file debrismanager.cpp.

SoftDebris * Mezzanine::DebrisManager::CreateSoftDebris ( const XML::Node SelfRoot)

Creates a new SoftDebris.

Parameters
SelfRootAn XML::Node containing the data to populate this class with.
Returns
Returns a pointer to the created Debris.

Definition at line 150 of file debrismanager.cpp.

void Mezzanine::DebrisManager::Deinitialize ( )
virtual

Removes this manager from any necessary configuration so it can be safely disposed of.

Implements Mezzanine::ManagerBase.

Definition at line 320 of file debrismanager.cpp.

void Mezzanine::DebrisManager::DestroyAllDebrisFactories ( )
virtual

Destroys all Debris factories in this manager.

Warning
The destruction of Debris factories should only be done after all the Debris have been destroyed, otherwise this will cause an exception.

Definition at line 289 of file debrismanager.cpp.

void Mezzanine::DebrisManager::DestroyDebris ( const Whole  Index)
virtual

Destroys an Debris at the specified index.

Parameters
IndexThe index at which to destroy the Debris.

Definition at line 209 of file debrismanager.cpp.

void Mezzanine::DebrisManager::DestroyDebris ( Debris ToBeDestroyed)
virtual

Destroys an Debris.

Parameters
ToBeDestroyedThe Debris to be destroyed.

Definition at line 225 of file debrismanager.cpp.

void Mezzanine::DebrisManager::DestroyDebrisFactory ( DebrisFactory ToBeDestroyed)
virtual

Removes and destroys a Debris factory in this manager.

Parameters
ToBeDestroyedA pointer to the Debris factory that is to be removed and destroyed.

Definition at line 275 of file debrismanager.cpp.

void Mezzanine::DebrisManager::DestroyDebrisFactory ( const String ImplName)
virtual

Removes and destroys a Debris factory in this manager.

Parameters
ImplNameThe name of the Debris implementation created by the factory to be removed and destroyed.

Definition at line 280 of file debrismanager.cpp.

Debris * Mezzanine::DebrisManager::GetDebris ( const Whole  Index) const
virtual

Gets an Debris by Index.

Parameters
IndexThe index of the Debris you wish to retrieve.
Returns
Returns a pointer to the Debris at the specified index.

Definition at line 189 of file debrismanager.cpp.

Debris * Mezzanine::DebrisManager::GetDebris ( const String Name) const
virtual

Gets an Debris by Name.

Parameters
NameThe name of the Debris you wish to retrieve.
Returns
Returns a pointer to the Debris of the specified name.

Definition at line 194 of file debrismanager.cpp.

DebrisUpdateWorkUnit * Mezzanine::DebrisManager::GetDebrisUpdateWork ( )

Gets the work unit responsible for updating Debriss stored by this manager.

Returns
Returns a pointer to the ActorUpdateWorkUnit used by this manager.

Definition at line 331 of file debrismanager.cpp.

String Mezzanine::DebrisManager::GetImplementationTypeName ( ) const
virtual

This Allows any manager name to be sent to a stream. Primarily used for logging.

Returns
This returns a String that contains the name.

Implements Mezzanine::ManagerBase.

Definition at line 340 of file debrismanager.cpp.

ManagerBase::ManagerType Mezzanine::DebrisManager::GetInterfaceType ( ) const
virtual

This returns the type of this manager.

This is intended to make using and casting from Manager base easier. With this is is possible to cast from ManagerBase to the correct Manager Type.

Returns
This returns a ManagerTypeName to identify what this can be safely cast to.

Implements Mezzanine::ManagerBase.

Definition at line 337 of file debrismanager.cpp.

Whole Mezzanine::DebrisManager::GetNumDebris ( ) const
virtual

Gets the number of Debriss stored in this manager.

Returns
Returns a whole representing the current Debris count.

Definition at line 204 of file debrismanager.cpp.

void Mezzanine::DebrisManager::Initialize ( )
virtual

Configures this manager for use prior to entering the main loop.

Exceptions
Ifthis is called while no valid world is set, this will throw an "INVALID_STATE_EXCEPTION".

Reimplemented from Mezzanine::WorldManager.

Definition at line 304 of file debrismanager.cpp.

void Mezzanine::DebrisManager::Pause ( const UInt32  PL)
virtual

Sets the pause state of this manager, or has no effect depending on the value passed in.

Parameters
PLA bitfield describing the pause level being assigned to the parent world of this manager.

Implements Mezzanine::WorldManager.

Definition at line 299 of file debrismanager.cpp.

void Mezzanine::DebrisManager::RemoveDebrisFactory ( DebrisFactory ToBeRemoved)
virtual

Removes a Debris factory from this manager.

Parameters
ToBeRemovedA pointer to the Debris factory that is to be removed.

Definition at line 263 of file debrismanager.cpp.

void Mezzanine::DebrisManager::RemoveDebrisFactory ( const String ImplName)
virtual

Removes a Debris factory from this manager.

Parameters
ImplNameThe name of the Debris implementation created by the factory to be removed.

Definition at line 268 of file debrismanager.cpp.

Member Data Documentation

FactoryMap Mezzanine::DebrisManager::DebrisFactories
protected

A map containing all registered Debris type factories.

Definition at line 115 of file debrismanager.h.

DebrisContainer Mezzanine::DebrisManager::Debriss
protected

Container storing all Debris belonging to this manager.

Definition at line 118 of file debrismanager.h.

DebrisUpdateWorkUnit* Mezzanine::DebrisManager::DebrisUpdateWork
protected

The work unit that updates all the Debris stored by this manager.

Definition at line 122 of file debrismanager.h.

Threading::DefaultThreadSpecificStorage::Type* Mezzanine::DebrisManager::ThreadResources
protected

Can be used for thread safe logging and other thread specific resources.

Definition at line 125 of file debrismanager.h.


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