ezEngine  Milestone 7
ezComponentManagerBase Class Referenceabstract

Base class for all component managers. Do not derive directly from this class, but derive from ezComponentManager instead. More...

#include <ComponentManager.h>

Inheritance diagram for ezComponentManagerBase:

Classes

struct  UpdateFunctionDesc
 Description of an update function that can be registered at the world. More...
 

Public Member Functions

ezWorldGetWorld () const
 Returns the corresponding world to this manager.
 
bool IsValidComponent (const ezComponentHandle &component) const
 Checks whether the given handle references a valid component.
 
bool TryGetComponent (const ezComponentHandle &component, ezComponent *&out_pComponent) const
 Returns if a component with the given handle exists and if so writes out the corresponding pointer to out_pComponent.
 
ezUInt32 GetComponentCount () const
 Returns the number of components managed by this manager.
 
virtual ezComponentHandle CreateComponent ()=0
 Create a new component instance and returns a handle to it. This method is implemented by ezComponentManager.
 
void DeleteComponent (const ezComponentHandle &component)
 Deletes the given component. Note that the component will be invalidated first and the actual deletion is postponed.
 
virtual const ezRTTIGetComponentType () const =0
 Returns the rtti info of the component type that this manager handles.
 

Protected Types

typedef ezDelegate< void(ezUInt32,
ezUInt32)> 
UpdateFunction
 Update function delegate. The first parameter is the first index to the components that should be updated. The second parameter is the number of components that should be updated.
 

Protected Member Functions

 ezComponentManagerBase (ezWorld *pWorld)
 
void RegisterUpdateFunction (const UpdateFunctionDesc &desc)
 Registers the given update function at the world.
 
void DeregisterUpdateFunction (const UpdateFunctionDesc &desc)
 Deregisters the given update function from the world. Note that only the m_Function and the m_Phase of the description have to be valid for deregistration.
 
ezAllocatorBaseGetAllocator ()
 Returns the allocator used by the world.
 
ezInternal::WorldLargeBlockAllocatorGetBlockAllocator ()
 Returns the block allocator used by the world.
 

Protected Attributes

ezIdTable
< ezGenericComponentId,
ComponentStorageEntry > 
m_Components
 

Private Member Functions

virtual ezResult Initialize ()
 This method is called after the constructor. A derived type can override this method to do initialization work. Typically this is the method where updates function are registered.
 
virtual ezResult Deinitialize ()
 This method is called before the destructor. A derived type can override this method to do deinitialization work.
 

Private Attributes

ezWorldm_pWorld
 

Friends

class ezWorld
 
class ezInternal::WorldData
 
class ezMemoryUtils
 

Detailed Description

Base class for all component managers. Do not derive directly from this class, but derive from ezComponentManager instead.

Every component type has its corresponding manager type. The manager stores the components in memory blocks to minimize overhead on creation and deletion of components. Each manager can also register update functions to update its components during the different update phases of ezWorld. Use ezWorld::CreateComponentManager to create an instance of a component manager within a specific world.


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