40 #ifndef actormanager_cpp
41 #define actormanager_cpp
43 #include "actormanager.h"
45 #include "Physics/physicsmanager.h"
64 TargetManager(Target) { }
88 ActorUpdateWork(NULL),
96 ActorUpdateWork(NULL),
122 Actor* Ret = (*ActFactIt).second->CreateActor( InstanceName, this->
ParentWorld, Params );
123 this->
Actors.push_back( Ret );
134 Actor* Ret = (*ActFactIt).second->CreateActor( SelfRoot, this->
ParentWorld );
135 this->
Actors.push_back( Ret );
144 return this->
Actors.at(Index);
151 if( (*ActIt)->GetName() == Name )
159 return this->
Actors.size();
165 if( ActIt != this->
Actors.end() )
169 (*ActFactIt).second->DestroyActor( (*ActIt) );
174 this->
Actors.erase(ActIt);
181 if( ActIt != this->
Actors.end() )
185 (*ActFactIt).second->DestroyActor( (*ActIt) );
190 this->
Actors.erase(ActIt);
200 (*ActFactIt).second->DestroyActor( (*ActIt) );
209 {
return this->
Actors.begin(); }
212 {
return this->
Actors.end(); }
215 {
return this->
Actors.begin(); }
218 {
return this->
Actors.end(); }
249 delete ActFactIt->second;
257 {
delete (*ActFactIt).second; }
330 {
delete ToBeDestroyed; }
Actor * CreateActor(const String &TypeName, const String &InstanceName, const NameValuePairMap &Params)
Creates a new Actor.
virtual void AddDependency(iWorkUnit *NewDependency)
Force this WorkUnit to Start after another has completed.
This is the base class from which all the actors inherit.
WorldManager * CreateManager(World *Creator, const NameValuePairList &Params)
Creates a manager of the type represented by this factory.
virtual void DestroyAllActors()
Destroys all Actors currently within this manager.
WorldManager * GetManager(const Whole ManagerToGet)
This is will find the manager of a given type.
ActorManager(World *Creator)
Class constructor.
virtual void AddWorkUnitMain(iWorkUnit *MoreWork, const String &WorkUnitName)
Add a normal Mezzanine::Threading::iWorkUnit to this For fcheduling.
virtual String GetImplementationTypeName() const
This Allows any manager name to be sent to a stream. Primarily used for logging.
virtual void Initialize()
Configures this manager for use prior to entering the main loop.
virtual void Deinitialize()
Removes this manager from any necessary configuration so it can be safely disposed of...
ManagerType
A listing of Manager Types.
virtual Whole GetNumActors() const
Gets the number of Actors stored in this manager.
virtual void AddActorFactory(ActorFactory *ToBeAdded)
Adds/registers a Actor factory with this manager, allowing it to be constructed through this API...
virtual Actor * GetActor(const Whole Index) const
Gets an Actor by Index.
ActorUpdateWorkUnit(const ActorUpdateWorkUnit &Other)
Protected copy constructor. THIS IS NOT ALLOWED.
virtual void RemoveWorkUnitMain(iWorkUnit *LessWork)
Remove a WorkUnit from the main pool of WorkUnits (and not from the groups of Affinity or MonpolyWork...
#define MEZZ_EXCEPTION(num, desc)
An easy way to throw exceptions with rich information.
ActorContainer::const_iterator ConstActorIterator
Const Iterator type for Actor instances stored by this class.
virtual void DestroyActor(const Whole Index)
Destroys an Actor at the specified index.
static const ManagerBase::ManagerType InterfaceType
A ManagerType enum value used to describe the type of interface/functionality this manager provides...
A base factory type for the creation of Actor objects.
FactoryMap ActorFactories
A map containing all registered Actor type factories.
ActorIterator EndActor()
Gets an iterator to one passed the last Actor in this manager.
String GetManagerImplName() const
Gets the name of the manager that is created by this factory.
virtual ~ActorManager()
Class destructor.
virtual void DestroyActorFactory(ActorFactory *ToBeDestroyed)
Removes and destroys a Actor factory in this manager.
Threading::FrameScheduler & GetScheduler()
Gets the core structure responsible for scheduling work in the Entresol main loop.
FactoryMap::iterator FactoryIterator
Iterator type for ActorFactory instances stored by this class.
A thread specific collection of double-buffered and algorithm specific resources. ...
ActorContainer Actors
Container storing all Actors belonging to this manager.
ActorContainer::iterator ActorIterator
Iterator type for Actor instances stored by this class.
A light-weight handle for manipulating nodes in DOM tree.
virtual void DoWork(Threading::DefaultThreadSpecificStorage::Type &CurrentThreadStorage)
This does any required update of the Actors stored by it's manager.
uint32_t UInt32
An 32-bit unsigned integer.
ManagerBase::ManagerType GetManagerType() const
Gets the type of manager that is created by this factory.
virtual ~DefaultActorManagerFactory()
Class destructor.
Entresol * TheEntresol
The actual pointer to the Entresol core class.
DefaultActorManagerFactory()
Class constructor.
virtual void RemoveActorFactory(ActorFactory *ToBeRemoved)
Removes a Actor factory from this manager.
std::list< NameValuePair > NameValuePairList
This is a datatype mostly used for describing settings or parameters that can't be declared in advanc...
Thrown when the available information should have worked but failed for unknown reasons.
The base class for all Actors is defined here.
This is the base class for all managers that belong to a single world instance.
virtual ~ActorUpdateWorkUnit()
Class destructor.
virtual void ClearDependencies()
Drop any information about what work units this one depends on.
virtual void Initialize()
Configures this manager for use prior to entering the main loop.
This is simply a place for storing all the Physics Related functions.
ActorUpdateWorkUnit * ActorUpdateWork
The work unit that updates all the actors stored by this manager.
virtual String GetTypeName() const =0
Gets the name of the Actor that is created by this factory.
Threading::DefaultWorkUnit * GetSimulationWork()
Gets a pointer to the work unit that steps the simulation.
This is a Mezzanine::Threading::iWorkUnit for the updating of actors.
World * ParentWorld
A pointer to the world that created this manager.
ActorIterator BeginActor()
Gets an iterator to the first Actor in this manager.
static const String ImplementationName
A String containing the name of this manager implementation.
The bulk of the engine components go in this namspace.
unsigned long Whole
Whole is an unsigned integer, it will be at least 32bits in size.
This class represents a world for objects to interact within.
virtual ManagerType GetInterfaceType() const
This returns the type of this manager.
ActorUpdateWorkUnit & operator=(const ActorUpdateWorkUnit &Other)
Protected assignment operator. THIS IS NOT ALLOWED.
ActorUpdateWorkUnit * GetActorUpdateWork()
Gets the work unit responsible for updating actors stored by this manager.
virtual void DestroyAllActorFactories()
Destroys all Actor factories in this manager.
const Char8 * Name() const
ptrdiff_tGet the name of this Node.
std::map< String, String > NameValuePairMap
This is a datatype mostly used for describing settings or parameters that can't be declared in advanc...
std::string String
A datatype used to a series of characters.
ActorManager * TargetManager
A pointer to the manager this work unit is processing.
virtual void Pause(const UInt32 PL)
Sets the pause state of this manager, or has no effect depending on the value passed in...
void DestroyManager(WorldManager *ToBeDestroyed)
Destroys a Manager created by this factory.
A manager responsible for the storage and management of all actors that exist in a world...
Boole Initialized
Simple Boole indicating whether or not this manager has been initialized.