A manager responsible for the storage and management of all actors that exist in a world. More...
#include <actormanager.h>
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 Member Functions | |||
ActorManager () | |||
Class constructor. | |||
ActorManager (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... | |||
Actor * | CreateActor (const String &TypeName, const String &InstanceName, const NameValuePairMap &Params) | ||
Creates a new Actor. More... | |||
Actor * | CreateActor (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. | |||
virtual Actor * | GetActor (const Whole Index) const | ||
Gets an Actor by Index. More... | |||
virtual Actor * | GetActor (const String &Name) const | ||
Gets an Actor by Name. More... | |||
ActorUpdateWorkUnit * | GetActorUpdateWork () | ||
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 () | |||
Class constructor. | |||
virtual | ~WorldManager () | ||
Class destructor. | |||
virtual void | _SetWorld (World *Parent) | ||
Sets the world this manager belongs to.
| |||
virtual World * | GetWorld () 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 | ActorFactories |
A map containing all registered Actor type factories. More... | |
ActorContainer | Actors |
Container storing all Actors belonging to this manager. More... | |
ActorUpdateWorkUnit * | ActorUpdateWork |
The work unit that updates all the actors stored by this manager. More... | |
Threading::DefaultThreadSpecificStorage::Type * | ThreadResources |
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... | |
World * | ParentWorld |
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... | |
Entresol * | TheEntresol |
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... | |
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 92 of file actormanager.h.
Mezzanine::ActorManager::ActorManager | ( | XML::Node & | XMLNode) |
XML constructor.
XMLNode | The node of the xml document to construct from. |
Definition at line 89 of file actormanager.cpp.
|
virtual |
Adds/registers a Actor factory with this manager, allowing it to be constructed through this API.
ToBeAdded | The Actor factory to be added. |
Definition at line 205 of file actormanager.cpp.
Actor * Mezzanine::ActorManager::CreateActor | ( | const String & | TypeName, |
const String & | InstanceName, | ||
const NameValuePairMap & | Params | ||
) |
Creates a new Actor.
TypeName | A string containing the name of the type of Actor to be constructed. |
InstanceName | A string containing the name to be given to the created Actor. |
Params | A container of additional parameters to be used for the construction of the new Actor. |
Definition at line 112 of file actormanager.cpp.
Creates a new Actor class from an XML node.
Definition at line 124 of file actormanager.cpp.
|
virtual |
Removes this manager from any necessary configuration so it can be safely disposed of.
Implements Mezzanine::ManagerBase.
Definition at line 267 of file actormanager.cpp.
|
virtual |
Destroys an Actor at the specified index.
Index | The index at which to destroy the Actor. |
Definition at line 156 of file actormanager.cpp.
|
virtual |
Destroys an Actor.
ToBeDestroyed | The Actor to be destroyed. |
Definition at line 172 of file actormanager.cpp.
|
virtual |
Removes and destroys a Actor factory in this manager.
ToBeDestroyed | A pointer to the Actor factory that is to be removed and destroyed. |
Definition at line 222 of file actormanager.cpp.
|
virtual |
Removes and destroys a Actor factory in this manager.
ImplName | The name of the Actor implementation created by the factory to be removed and destroyed. |
Definition at line 227 of file actormanager.cpp.
|
virtual |
Destroys all Actor factories in this manager.
Definition at line 236 of file actormanager.cpp.
Gets an Actor by Index.
Index | The index of the Actor you wish to retrieve. |
Definition at line 136 of file actormanager.cpp.
Gets an Actor by Name.
Name | The name of the Actor you wish to retrieve. |
Definition at line 141 of file actormanager.cpp.
ActorUpdateWorkUnit * Mezzanine::ActorManager::GetActorUpdateWork | ( | ) |
Gets the work unit responsible for updating actors stored by this manager.
Definition at line 278 of file actormanager.cpp.
|
virtual |
This Allows any manager name to be sent to a stream. Primarily used for logging.
Implements Mezzanine::ManagerBase.
Definition at line 287 of file actormanager.cpp.
|
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.
Implements Mezzanine::ManagerBase.
Definition at line 284 of file actormanager.cpp.
|
virtual |
Gets the number of Actors stored in this manager.
Definition at line 151 of file actormanager.cpp.
|
virtual |
Configures this manager for use prior to entering the main loop.
If | this is called while no valid world is set, this will throw an "INVALID_STATE_EXCEPTION". |
Reimplemented from Mezzanine::WorldManager.
Definition at line 251 of file actormanager.cpp.
|
virtual |
Sets the pause state of this manager, or has no effect depending on the value passed in.
PL | A bitfield describing the pause level being assigned to the parent world of this manager. |
Implements Mezzanine::WorldManager.
Definition at line 246 of file actormanager.cpp.
|
virtual |
Removes a Actor factory from this manager.
ToBeRemoved | A pointer to the Actor factory that is to be removed. |
Definition at line 210 of file actormanager.cpp.
|
virtual |
Removes a Actor factory from this manager.
ImplName | The name of the Actor implementation created by the factory to be removed. |
Definition at line 215 of file actormanager.cpp.
|
protected |
A map containing all registered Actor type factories.
Definition at line 112 of file actormanager.h.
|
protected |
Container storing all Actors belonging to this manager.
Definition at line 115 of file actormanager.h.
|
protected |
The work unit that updates all the actors stored by this manager.
Definition at line 119 of file actormanager.h.
|
protected |
Can be used for thread safe logging and other thread specific resources.
Definition at line 122 of file actormanager.h.