![]() |
Divide Framework 0.1
A free and open-source 3D Framework under heavy development
|
#include <ComponentManager.h>
Classes | |
class | ComponentContainer |
class | IComponentContainer |
Public Types | |
template<class T > | |
using | TComponentIterator = typename ComponentContainer< T >::iterator |
Public Member Functions | |
ComponentManager () | |
~ComponentManager () | |
template<class T , class ... ARGS> | |
T * | AddComponent (const EntityId entityId, ARGS &&... args) |
template<class T > | |
void | RemoveComponent (const EntityId entityId) |
void | RemoveAllComponents (const EntityId entityId) |
void | PassDataToAllComponents (const EntityId entityId, const CustomEvent &data) |
template<class T > | |
T * | GetComponent (const EntityId entityId) |
template<class T > | |
ComponentContainer< T > * | GetComponentContainer () |
template<class T > | |
TComponentIterator< T > | begin () |
template<class T > | |
TComponentIterator< T > | end () |
template<class T > | |
size_t | size () const noexcept |
Private Types | |
using | ComponentContainerRegistry = eastl::unordered_map< ComponentTypeId, IComponentContainer * > |
using | ComponentLookupTable = eastl::vector< IComponent * > |
using | EntityComponentMap = eastl::vector< eastl::vector< ComponentId > > |
Private Member Functions | |
ComponentManager (const ComponentManager &)=delete | |
ComponentManager & | operator= (ComponentManager &)=delete |
ComponentId | AqcuireComponentId (IComponent *component) |
void | ReleaseComponentId (ComponentId id) |
void | MapEntityComponent (EntityId entityId, ComponentId componentId, ComponentTypeId componentTypeId) |
void | UnmapEntityComponent (EntityId entityId, ComponentId componentId, ComponentTypeId componentTypeId) |
![]() | |
GlobalMemoryUser () | |
virtual | ~GlobalMemoryUser () |
const void * | Allocate (size_t memSize, const char *user=nullptr) |
void | Free (void *pMem) |
Private Attributes | |
ComponentContainerRegistry | m_ComponentContainerRegistry |
ComponentLookupTable | m_ComponentLUT |
EntityComponentMap | m_EntityComponentMap |
Friends | |
class | IComponent |
Definition at line 37 of file ComponentManager.h.
|
private |
Definition at line 96 of file ComponentManager.h.
|
private |
Definition at line 101 of file ComponentManager.h.
|
private |
Definition at line 104 of file ComponentManager.h.
using ECS::ComponentManager::TComponentIterator = typename ComponentContainer<T>::iterator |
Definition at line 117 of file ComponentManager.h.
|
privatedelete |
ECS::ComponentManager::ComponentManager | ( | ) |
Definition at line 17 of file ComponentManager.cpp.
ECS::ComponentManager::~ComponentManager | ( | ) |
Definition at line 29 of file ComponentManager.cpp.
|
inline |
Fn: template<class T, class ...ARGS> T* ComponentManager::AddComponent(const EntityId entityId, ARGS&&... args)
Summary: Adds a component of type T to entity described by entityId.
Author: Tobias Stein
Date: 30/09/2017
Typeparams: T - Generic type parameter. ...ARGS - Type of the ...args. Parameters: entityId - Identifier for the entity. args - Variable arguments providing [in,out] The arguments.
Definition at line 143 of file ComponentManager.h.
|
private |
Definition at line 41 of file ComponentManager.cpp.
|
inline |
Fn: template<class T> inline TComponentIterator<T> ComponentManager::begin()
Summary: Returns an forward iterator object that points to the beginning of a collection of all components of type T.
Author: Tobias Stein
Date: 24/09/2017
Typeparams: T - Generic type parameter.
Definition at line 330 of file ComponentManager.h.
|
inline |
Fn: template<class T> inline TComponentIterator<T> ComponentManager::end()
Summary: Returns an forward iterator object that points to the end of a collection of all components of type T.
Author: Tobias Stein
Date: 24/09/2017
Typeparams: T - Generic type parameter.
Definition at line 352 of file ComponentManager.h.
|
inline |
Fn: template<class T> T* ComponentManager::GetComponent(const EntityId entityId)
Summary: Get the component of type T of an entity. If component has no such component nullptr is returned.
Author: Tobias Stein
Date: 30/09/2017
Typeparams: T - Generic type parameter. Parameters: entityId - Identifier for the entity.
Definition at line 266 of file ComponentManager.h.
|
inline |
Fn: template<class T> inline ComponentContainer<T> ComponentManager::GetComponentContainer()
Summary: Returns the collection of all components of type T.
Author: Tobias Stein
Date: 24/09/2017
Typeparams: T - Generic type parameter.
Definition at line 294 of file ComponentManager.h.
|
private |
Definition at line 66 of file ComponentManager.cpp.
|
privatedelete |
|
inline |
Definition at line 233 of file ComponentManager.h.
|
private |
Definition at line 60 of file ComponentManager.cpp.
|
inline |
Definition at line 207 of file ComponentManager.h.
|
inline |
Fn: template<class T> void ComponentManager::RemoveComponent(const EntityId entityId)
Summary: Removes the component of type T from an entity described by entityId.
Author: Tobias Stein
Date: 30/09/2017
Typeparams: T - Generic type parameter. Parameters:
Definition at line 186 of file ComponentManager.h.
|
inlinenoexcept |
Definition at line 358 of file ComponentManager.h.
|
private |
Definition at line 87 of file ComponentManager.cpp.
|
friend |
Definition at line 39 of file ComponentManager.h.
|
private |
Definition at line 98 of file ComponentManager.h.
|
private |
Definition at line 102 of file ComponentManager.h.
|
private |
Definition at line 105 of file ComponentManager.h.