Leviathan  0.8.0.0
Leviathan game engine
Leviathan::ComponentHolder< ComponentType > Class Template Reference

#include <Component.h>

+ Inheritance diagram for Leviathan::ComponentHolder< ComponentType >:

Additional Inherited Members

- Public Member Functions inherited from Leviathan::ObjectPoolTracked< ComponentType, ObjectID >
 ObjectPoolTracked ()
 
 ~ObjectPoolTracked ()
 
ComponentType * ConstructNew (ObjectID forentity, Args &&... args)
 Constructs a new component of the held type for entity. More...
 
bool HasElementsInRemoved () const
 Returns true if there are objects in Removed. More...
 
bool HasElementsInAdded () const
 Returns true if there are objects in Added. More...
 
bool HasElementsInQueued () const
 Returns true if there are objects in Queued. More...
 
void ReleaseQueued (Args &&... args)
 Calls Release with the specified arguments on elements that are queued for destruction. More...
 
void Release (ObjectID id, bool addtoremoved, Args &&... args)
 Calls Release on an object and then removes it from the pool. More...
 
bool ReleaseIfExists (ObjectID id, bool addtoremoved, Args &&... args)
 Calls Release on an object if it is in this pool and then removes it from the pool. More...
 
void ClearQueued ()
 Removes elements that are queued for destruction without calling release. More...
 
const auto & GetRemoved () const
 Returns a reference to the vector of removed elements. More...
 
auto & GetAdded ()
 Returns a reference to the vector of added elements. More...
 
void ClearAdded ()
 Clears the added list. More...
 
void ClearRemoved ()
 Clears the removed list. More...
 
void RemoveBasedOnKeyTupleList (const std::vector< std::tuple< Any, ObjectID >> &values, bool addtoremoved=false)
 Destroys without releasing elements based on ids in vector. More...
 
void ReleaseAllAndClear (Args &&... args)
 Calls release on all objects and clears everything. More...
 
void RemoveFromAdded (ObjectID id)
 Removes a specific id from the added list. More...
 
ComponentType * Find (ObjectID id) const
 
void Destroy (ObjectID id, bool addtoremoved=true)
 Destroys a component based on id. More...
 
bool DestroyIfExists (ObjectID id, bool addtoremoved=true)
 Destroys a component based on id if exists. More...
 
void QueueDestroy (ObjectID id)
 Queues destruction of an element. More...
 
void Call (std::function< bool(ComponentType &, ObjectID)> function)
 Calls an function on all the objects in the pool. More...
 
void Clear ()
 Clears the index and replaces the pool with a new one. More...
 
auto GetObjectCount () const
 
std::unordered_map< ObjectID, ComponentType *> & GetIndex ()
 Returns a direct access to Index. More...
 
- Protected Member Functions inherited from Leviathan::ObjectPoolTracked< ComponentType, ObjectID >
bool RemoveFromIndex (ObjectID id)
 Removes an component from the index but doesn't destruct it. More...
 
void _ReleaseCommon (ComponentType *object, ObjectID id, bool addtoremoved, Args &&... args)
 
void _DestroyCommon (ComponentType *object, ObjectID id, bool addtoremoved)
 
- Protected Attributes inherited from Leviathan::ObjectPoolTracked< ComponentType, ObjectID >
std::unordered_map< ObjectID, ComponentType *> Index
 Used for looking up element belonging to id. More...
 
std::vector< std::tuple< ComponentType *, ObjectID > > Removed
 
std::vector< std::tuple< ComponentType *, ObjectID > > Queued
 
std::vector< std::tuple< ComponentType *, ObjectID > > Added
 Used for detecting created elements. More...
 
boost::pool Elements
 Pool for objects. More...
 

Detailed Description

template<class ComponentType>
class Leviathan::ComponentHolder< ComponentType >

Definition at line 69 of file Component.h.


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