Spinning Topp Logo BlackTopp Studios
inc
Public Types | Public Member Functions | Static Public Attributes | 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 Types inherited from Mezzanine::ManagerBase
enum  ManagerType {
  MT_Undefined = 0, MT_AudioManager = 1, MT_AnimationManager = 2, MT_CollisionShapeManager = 3,
  MT_CompositorManager = 4, MT_GraphicsManager = 5, MT_EventManager = 6, MT_InputManager = 7,
  MT_LogManager = 8, MT_MaterialManager = 9, MT_MeshManager = 10, MT_NetworkManager = 11,
  MT_ResourceManager = 12, MT_ScriptingManager = 13, MT_TextureManager = 14, MT_UIManager = 15,
  MT_ActorManager = 101, MT_AreaEffectManager = 102, MT_DebrisManager = 103, MT_PagingManager = 104,
  MT_PhysicsManager = 105, MT_SceneManager = 106, MT_SoundScapeManager = 107, MT_TerrainManager = 108,
  MT_VehicleManager = 109, MT_UserCreated = 512
}
 A listing of Manager Types. More...
 

Public Member Functions

 DebrisManager (World *Creator)
 Class constructor. More...
 
 DebrisManager (World *Creator, const 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...
 
DebrisIterator BeginDebris ()
 Gets an iterator to the first Debris in this manager. More...
 
ConstDebrisIterator BeginDebris () const
 Gets a const iterator to the first Debris in this manager. More...
 
DebrisCreateDebris (const String &TypeName, const String &InstanceName, const NameValuePairMap &Params, const Boole AddToWorld=true)
 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, const Boole AddToWorld=true)
 Creates a new RigidDebris. More...
 
RigidDebrisCreateRigidDebris (const String &Name, const Real Mass, Graphics::Mesh *DebMesh, Physics::CollisionShape *DebShape, const Boole AddToWorld=true)
 Creates a new RigidDebris. More...
 
RigidDebrisCreateRigidDebris (const XML::Node &SelfRoot)
 Creates a new RigidDebris. More...
 
SoftDebrisCreateSoftDebris (const String &Name, const Real Mass, const Boole AddToWorld=true)
 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...
 
DebrisIterator EndDebris ()
 Gets an iterator to one passed the last Debris in this manager. More...
 
ConstDebrisIterator EndDebris () const
 Gets a const iterator to one passed the last Debris 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 (World *Creator)
 Class constructor. More...
 
virtual ~WorldManager ()
 Class destructor.
 
virtual WorldGetWorld () const
 Gets the world this manager belongs to. More...
 
virtual Boole 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...
 
Boole IsInitialized () const
 Gets whether or not this manager has been initialized. More...
 

Static Public Attributes

static const String ImplementationName = "DefaultDebrisManager"
 A String containing the name of this manager implementation.
 
static const ManagerBase::ManagerType InterfaceType = ManagerBase::MT_DebrisManager
 A ManagerType enum value used to describe the type of interface/functionality this manager provides.
 

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
Boole 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
Boole Initialized
 Simple Boole 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 104 of file debrismanager.h.

Constructor & Destructor Documentation

Mezzanine::DebrisManager::DebrisManager ( World Creator)

Class constructor.

Parameters
CreatorThe parent world that is creating the manager.

Definition at line 88 of file debrismanager.cpp.

Mezzanine::DebrisManager::DebrisManager ( World Creator,
const XML::Node XMLNode 
)

XML constructor.

Parameters
CreatorThe parent world that is creating the manager.
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 97 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 300 of file debrismanager.cpp.

DebrisManager::DebrisIterator Mezzanine::DebrisManager::BeginDebris ( )

Gets an iterator to the first Debris in this manager.

Returns
Returns an iterator to the first Debris being stored by this manager.

Definition at line 285 of file debrismanager.cpp.

DebrisManager::ConstDebrisIterator Mezzanine::DebrisManager::BeginDebris ( ) const

Gets a const iterator to the first Debris in this manager.

Returns
Returns a const iterator to the first Debris being stored by this manager.

Definition at line 291 of file debrismanager.cpp.

Debris * Mezzanine::DebrisManager::CreateDebris ( const String TypeName,
const String InstanceName,
const NameValuePairMap Params,
const Boole  AddToWorld = true 
)

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.
AddToWorldWether or not the new Debris should be added to the world after it has been created.
Returns
Returns a pointer to the created Debris.

Definition at line 192 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 207 of file debrismanager.cpp.

RigidDebris * Mezzanine::DebrisManager::CreateRigidDebris ( const String Name,
const Real  Mass,
const Boole  AddToWorld = true 
)

Creates a new RigidDebris.

Parameters
NameThe name to be given to the new RigidDebris.
MassThe mass of the debris object.
AddToWorldWether or not the new Debris should be added to the world after it has been created.
Returns
Returns a pointer to the created Debris.

Definition at line 120 of file debrismanager.cpp.

RigidDebris * Mezzanine::DebrisManager::CreateRigidDebris ( const String Name,
const Real  Mass,
Graphics::Mesh DebMesh,
Physics::CollisionShape DebShape,
const Boole  AddToWorld = true 
)

Creates a new RigidDebris.

Parameters
NameThe name to be given to the new RigidDebris.
MassThe mass of the debris object.
DebMeshA pointer to the Graphics mesh that will be applied to the new RigidDebris.
DebShapeA pointer to the Collision shape that will be applied to the new RigidDebris.
AddToWorldWether or not the new Debris should be added to the world after it has been created.
Returns
Returns a pointer to the created Debris.

Definition at line 135 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 150 of file debrismanager.cpp.

SoftDebris * Mezzanine::DebrisManager::CreateSoftDebris ( const String Name,
const Real  Mass,
const Boole  AddToWorld = true 
)

Creates a new SoftDebris.

Parameters
NameThe name to be given to the new SoftDebris.
MassThe mass of the debris object.
AddToWorldWether or not the new Debris should be added to the world after it has been created.
Returns
Returns a pointer to the created Debris.

Definition at line 162 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 177 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 361 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 331 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 239 of file debrismanager.cpp.

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

Destroys an Debris.

Parameters
ToBeDestroyedThe Debris to be destroyed.

Definition at line 255 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 317 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 322 of file debrismanager.cpp.

DebrisManager::DebrisIterator Mezzanine::DebrisManager::EndDebris ( )

Gets an iterator to one passed the last Debris in this manager.

Returns
Returns an iterator to one passed the last Debris being stored by this manager.

Definition at line 288 of file debrismanager.cpp.

DebrisManager::ConstDebrisIterator Mezzanine::DebrisManager::EndDebris ( ) const

Gets a const iterator to one passed the last Debris in this manager.

Returns
Returns a const iterator to one passed the last Debris being stored by this manager.

Definition at line 294 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 219 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 224 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 371 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 380 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 377 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 234 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 346 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 341 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 305 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 310 of file debrismanager.cpp.

Member Data Documentation

FactoryMap Mezzanine::DebrisManager::DebrisFactories
protected

A map containing all registered Debris type factories.

Definition at line 129 of file debrismanager.h.

DebrisContainer Mezzanine::DebrisManager::Debriss
protected

Container storing all Debris belonging to this manager.

Definition at line 132 of file debrismanager.h.

DebrisUpdateWorkUnit* Mezzanine::DebrisManager::DebrisUpdateWork
protected

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

Definition at line 136 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 139 of file debrismanager.h.


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