Spinning Topp Logo BlackTopp Studios
inc
Public Types | Public Member Functions | Static Public Attributes | Protected Attributes | Friends | List of all members
Mezzanine::ActorManager Class Reference

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

#include <actormanager.h>

+ Inheritance diagram for Mezzanine::ActorManager:
+ Collaboration diagram for Mezzanine::ActorManager:

Public Types

typedef std::vector< Actor * > ActorContainer
 Basic container type for Actor storage by this class.
 
typedef ActorContainer::iterator ActorIterator
 Iterator type for Actor instances stored by this class.
 
typedef ActorContainer::const_iterator ConstActorIterator
 Const Iterator type for Actor instances stored by this class.
 
typedef FactoryMap::const_iterator ConstFactoryIterator
 Const Iterator type for ActorFactory instances stored by this class.
 
typedef FactoryMap::iterator FactoryIterator
 Iterator type for ActorFactory instances stored by this class.
 
typedef std::map< String, ActorFactory * > FactoryMap
 Basic container type for ActorFactory 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

 ActorManager (World *Creator)
 Class constructor. More...
 
 ActorManager (World *Creator, const XML::Node &XMLNode)
 XML constructor. More...
 
virtual ~ActorManager ()
 Class destructor.
 
virtual void AddActorFactory (ActorFactory *ToBeAdded)
 Adds/registers a Actor factory with this manager, allowing it to be constructed through this API. More...
 
ActorIterator BeginActor ()
 Gets an iterator to the first Actor in this manager. More...
 
ConstActorIterator BeginActor () const
 Gets a const iterator to the first Actor in this manager. More...
 
ActorCreateActor (const String &TypeName, const String &InstanceName, const NameValuePairMap &Params)
 Creates a new Actor. More...
 
ActorCreateActor (const XML::Node &SelfRoot)
 Creates a new Actor class from an XML node. More...
 
virtual void Deinitialize ()
 Removes this manager from any necessary configuration so it can be safely disposed of. More...
 
virtual void DestroyActor (const Whole Index)
 Destroys an Actor at the specified index. More...
 
virtual void DestroyActor (Actor *ToBeDestroyed)
 Destroys an Actor. More...
 
virtual void DestroyActorFactory (ActorFactory *ToBeDestroyed)
 Removes and destroys a Actor factory in this manager. More...
 
virtual void DestroyActorFactory (const String &ImplName)
 Removes and destroys a Actor factory in this manager. More...
 
virtual void DestroyAllActorFactories ()
 Destroys all Actor factories in this manager. More...
 
virtual void DestroyAllActors ()
 Destroys all Actors currently within this manager.
 
ActorIterator EndActor ()
 Gets an iterator to one passed the last Actor in this manager. More...
 
ConstActorIterator EndActor () const
 Gets a const iterator to one passed the last Actor in this manager. More...
 
virtual ActorGetActor (const Whole Index) const
 Gets an Actor by Index. More...
 
virtual ActorGetActor (const String &Name) const
 Gets an Actor by Name. More...
 
ActorUpdateWorkUnitGetActorUpdateWork ()
 Gets the work unit responsible for updating actors 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 GetNumActors () const
 Gets the number of Actors 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 RemoveActorFactory (ActorFactory *ToBeRemoved)
 Removes a Actor factory from this manager. More...
 
virtual void RemoveActorFactory (const String &ImplName)
 Removes a Actor 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 = "DefaultActorManager"
 A String containing the name of this manager implementation.
 
static const ManagerBase::ManagerType InterfaceType = ManagerBase::MT_ActorManager
 A ManagerType enum value used to describe the type of interface/functionality this manager provides.
 

Protected Attributes

FactoryMap ActorFactories
 A map containing all registered Actor type factories. More...
 
ActorContainer Actors
 Container storing all Actors belonging to this manager. More...
 
ActorUpdateWorkUnitActorUpdateWork
 The work unit that updates all the actors 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 ActorUpdateWorkUnit
 

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 actors that exist in a world.

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

Definition at line 94 of file actormanager.h.

Constructor & Destructor Documentation

Mezzanine::ActorManager::ActorManager ( World Creator)

Class constructor.

Parameters
CreatorThe parent world that is creating the manager.

Definition at line 86 of file actormanager.cpp.

Mezzanine::ActorManager::ActorManager ( 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 94 of file actormanager.cpp.

Member Function Documentation

void Mezzanine::ActorManager::AddActorFactory ( ActorFactory ToBeAdded)
virtual

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

Parameters
ToBeAddedThe Actor factory to be added.

Definition at line 223 of file actormanager.cpp.

ActorManager::ActorIterator Mezzanine::ActorManager::BeginActor ( )

Gets an iterator to the first Actor in this manager.

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

Definition at line 208 of file actormanager.cpp.

ActorManager::ConstActorIterator Mezzanine::ActorManager::BeginActor ( ) const

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

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

Definition at line 214 of file actormanager.cpp.

Actor * Mezzanine::ActorManager::CreateActor ( const String TypeName,
const String InstanceName,
const NameValuePairMap Params 
)

Creates a new Actor.

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

Definition at line 118 of file actormanager.cpp.

Actor * Mezzanine::ActorManager::CreateActor ( const XML::Node SelfRoot)

Creates a new Actor class from an XML node.

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

Definition at line 130 of file actormanager.cpp.

void Mezzanine::ActorManager::Deinitialize ( )
virtual

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

Implements Mezzanine::ManagerBase.

Definition at line 285 of file actormanager.cpp.

void Mezzanine::ActorManager::DestroyActor ( const Whole  Index)
virtual

Destroys an Actor at the specified index.

Parameters
IndexThe index at which to destroy the Actor.

Definition at line 162 of file actormanager.cpp.

void Mezzanine::ActorManager::DestroyActor ( Actor ToBeDestroyed)
virtual

Destroys an Actor.

Parameters
ToBeDestroyedThe Actor to be destroyed.

Definition at line 178 of file actormanager.cpp.

void Mezzanine::ActorManager::DestroyActorFactory ( ActorFactory ToBeDestroyed)
virtual

Removes and destroys a Actor factory in this manager.

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

Definition at line 240 of file actormanager.cpp.

void Mezzanine::ActorManager::DestroyActorFactory ( const String ImplName)
virtual

Removes and destroys a Actor factory in this manager.

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

Definition at line 245 of file actormanager.cpp.

void Mezzanine::ActorManager::DestroyAllActorFactories ( )
virtual

Destroys all Actor factories in this manager.

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

Definition at line 254 of file actormanager.cpp.

ActorManager::ActorIterator Mezzanine::ActorManager::EndActor ( )

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

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

Definition at line 211 of file actormanager.cpp.

ActorManager::ConstActorIterator Mezzanine::ActorManager::EndActor ( ) const

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

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

Definition at line 217 of file actormanager.cpp.

Actor * Mezzanine::ActorManager::GetActor ( const Whole  Index) const
virtual

Gets an Actor by Index.

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

Definition at line 142 of file actormanager.cpp.

Actor * Mezzanine::ActorManager::GetActor ( const String Name) const
virtual

Gets an Actor by Name.

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

Definition at line 147 of file actormanager.cpp.

ActorUpdateWorkUnit * Mezzanine::ActorManager::GetActorUpdateWork ( )

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

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

Definition at line 296 of file actormanager.cpp.

String Mezzanine::ActorManager::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 305 of file actormanager.cpp.

ManagerBase::ManagerType Mezzanine::ActorManager::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 302 of file actormanager.cpp.

Whole Mezzanine::ActorManager::GetNumActors ( ) const
virtual

Gets the number of Actors stored in this manager.

Returns
Returns a whole representing the current Actor count.

Definition at line 157 of file actormanager.cpp.

void Mezzanine::ActorManager::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 269 of file actormanager.cpp.

void Mezzanine::ActorManager::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 264 of file actormanager.cpp.

void Mezzanine::ActorManager::RemoveActorFactory ( ActorFactory ToBeRemoved)
virtual

Removes a Actor factory from this manager.

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

Definition at line 228 of file actormanager.cpp.

void Mezzanine::ActorManager::RemoveActorFactory ( const String ImplName)
virtual

Removes a Actor factory from this manager.

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

Definition at line 233 of file actormanager.cpp.

Member Data Documentation

FactoryMap Mezzanine::ActorManager::ActorFactories
protected

A map containing all registered Actor type factories.

Definition at line 119 of file actormanager.h.

ActorContainer Mezzanine::ActorManager::Actors
protected

Container storing all Actors belonging to this manager.

Definition at line 122 of file actormanager.h.

ActorUpdateWorkUnit* Mezzanine::ActorManager::ActorUpdateWork
protected

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

Definition at line 126 of file actormanager.h.

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

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

Definition at line 129 of file actormanager.h.


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