VOX
A little voxel engine
Loading...
Searching...
No Matches
ecs::ComponentStorage< EntityType, ComponentType > Class Template Reference

#include <ComponentStorage.hpp>

Inheritance diagram for ecs::ComponentStorage< EntityType, ComponentType >:
Inheritance graph
Collaboration diagram for ecs::ComponentStorage< EntityType, ComponentType >:
Collaboration graph

Public Types

typedef std::vector< ComponentType > container_type
 
typedef SparseSet< EntityType > base_type
 
typedef container_type::iterator iterator
 
typedef container_type::const_iterator const_iterator
 
typedef container_type::reverse_iterator reverse_iterator
 
typedef container_type::const_reverse_iterator const_reverse_iterator
 
- Public Types inherited from ecs::SparseSet< EntityType >
typedef entityType node_type
 
typedef std::vector< node_typedense_type
 
typedef std::vector< size_t > sparse_type
 
typedef dense_type::iterator iterator
 
typedef dense_type::const_iterator const_iterator
 
typedef dense_type::reverse_iterator reverse_iterator
 
typedef dense_type::const_reverse_iterator const_reverse_iterator
 

Public Member Functions

 ComponentStorage ()
 
 ~ComponentStorage ()
 
 ComponentStorage (ComponentStorage &other)=default
 
 ComponentStorage (ComponentStorage &&other)=default
 
ComponentStorageoperator= (ComponentStorage &other)=default
 
ComponentStorageoperator= (ComponentStorage &&other)=default
 
void insert (EntityType entity, ComponentType component)
 
size_t remove (EntityType entity) override
 
ComponentType & get (EntityType entity)
 
const ComponentType & get (EntityType entity) const
 
ComponentType * tryGet (EntityType entity)
 
const ComponentType * tryGet (EntityType entity) const
 
size_t size () const
 
iterator begin ()
 
const_iterator begin () const
 
iterator end ()
 
const_iterator end () const
 
reverse_iterator rbegin ()
 
const_reverse_iterator rbegin () const
 
reverse_iterator rend ()
 
const_reverse_iterator rend () const
 
- Public Member Functions inherited from ecs::SparseSet< EntityType >
 SparseSet ()
 
 SparseSet (size_t size)
 
 SparseSet (SparseSet &other)=default
 
 SparseSet (SparseSet &&other)=default
 
virtual ~SparseSet ()=default
 
SparseSetoperator= (SparseSet &other)=default
 
SparseSetoperator= (SparseSet &&other)=default
 
size_t insert (entityType entity)
 
virtual size_t remove (entityType entity)
 
size_t index (entityType entity) const
 
bool contains (entityType entity) const
 
size_t size () const
 
iterator begin ()
 
const_iterator begin () const
 
reverse_iterator rbegin ()
 
const_reverse_iterator rbegin () const
 
iterator end ()
 
const_iterator end () const
 
reverse_iterator rend ()
 
const_reverse_iterator rend () const
 

Member Typedef Documentation

◆ base_type

template<ValidEntity EntityType, typename ComponentType >
typedef SparseSet<EntityType> ecs::ComponentStorage< EntityType, ComponentType >::base_type

◆ const_iterator

template<ValidEntity EntityType, typename ComponentType >
typedef container_type::const_iterator ecs::ComponentStorage< EntityType, ComponentType >::const_iterator

◆ const_reverse_iterator

template<ValidEntity EntityType, typename ComponentType >
typedef container_type::const_reverse_iterator ecs::ComponentStorage< EntityType, ComponentType >::const_reverse_iterator

◆ container_type

template<ValidEntity EntityType, typename ComponentType >
typedef std::vector<ComponentType> ecs::ComponentStorage< EntityType, ComponentType >::container_type

◆ iterator

template<ValidEntity EntityType, typename ComponentType >
typedef container_type::iterator ecs::ComponentStorage< EntityType, ComponentType >::iterator

◆ reverse_iterator

template<ValidEntity EntityType, typename ComponentType >
typedef container_type::reverse_iterator ecs::ComponentStorage< EntityType, ComponentType >::reverse_iterator

Constructor & Destructor Documentation

◆ ComponentStorage() [1/3]

template<ValidEntity EntityType, typename ComponentType >
ecs::ComponentStorage< EntityType, ComponentType >::ComponentStorage ( )
inline

◆ ~ComponentStorage()

template<ValidEntity EntityType, typename ComponentType >
ecs::ComponentStorage< EntityType, ComponentType >::~ComponentStorage ( )
inline

◆ ComponentStorage() [2/3]

template<ValidEntity EntityType, typename ComponentType >
ecs::ComponentStorage< EntityType, ComponentType >::ComponentStorage ( ComponentStorage< EntityType, ComponentType > &  other)
default

◆ ComponentStorage() [3/3]

template<ValidEntity EntityType, typename ComponentType >
ecs::ComponentStorage< EntityType, ComponentType >::ComponentStorage ( ComponentStorage< EntityType, ComponentType > &&  other)
default

Member Function Documentation

◆ begin() [1/2]

template<ValidEntity EntityType, typename ComponentType >
iterator ecs::ComponentStorage< EntityType, ComponentType >::begin ( )
inline

◆ begin() [2/2]

template<ValidEntity EntityType, typename ComponentType >
const_iterator ecs::ComponentStorage< EntityType, ComponentType >::begin ( ) const
inline

◆ end() [1/2]

template<ValidEntity EntityType, typename ComponentType >
iterator ecs::ComponentStorage< EntityType, ComponentType >::end ( )
inline

◆ end() [2/2]

template<ValidEntity EntityType, typename ComponentType >
const_iterator ecs::ComponentStorage< EntityType, ComponentType >::end ( ) const
inline

◆ get() [1/2]

template<ValidEntity EntityType, typename ComponentType >
ComponentType & ecs::ComponentStorage< EntityType, ComponentType >::get ( EntityType  entity)
inline

◆ get() [2/2]

template<ValidEntity EntityType, typename ComponentType >
const ComponentType & ecs::ComponentStorage< EntityType, ComponentType >::get ( EntityType  entity) const
inline

◆ insert()

template<ValidEntity EntityType, typename ComponentType >
void ecs::ComponentStorage< EntityType, ComponentType >::insert ( EntityType  entity,
ComponentType  component 
)
inline

◆ operator=() [1/2]

template<ValidEntity EntityType, typename ComponentType >
ComponentStorage & ecs::ComponentStorage< EntityType, ComponentType >::operator= ( ComponentStorage< EntityType, ComponentType > &&  other)
default

◆ operator=() [2/2]

template<ValidEntity EntityType, typename ComponentType >
ComponentStorage & ecs::ComponentStorage< EntityType, ComponentType >::operator= ( ComponentStorage< EntityType, ComponentType > &  other)
default

◆ rbegin() [1/2]

template<ValidEntity EntityType, typename ComponentType >
reverse_iterator ecs::ComponentStorage< EntityType, ComponentType >::rbegin ( )
inline

◆ rbegin() [2/2]

template<ValidEntity EntityType, typename ComponentType >
const_reverse_iterator ecs::ComponentStorage< EntityType, ComponentType >::rbegin ( ) const
inline

◆ remove()

template<ValidEntity EntityType, typename ComponentType >
size_t ecs::ComponentStorage< EntityType, ComponentType >::remove ( EntityType  entity)
inlineoverride

◆ rend() [1/2]

template<ValidEntity EntityType, typename ComponentType >
reverse_iterator ecs::ComponentStorage< EntityType, ComponentType >::rend ( )
inline

◆ rend() [2/2]

template<ValidEntity EntityType, typename ComponentType >
const_reverse_iterator ecs::ComponentStorage< EntityType, ComponentType >::rend ( ) const
inline

◆ size()

template<ValidEntity EntityType, typename ComponentType >
size_t ecs::ComponentStorage< EntityType, ComponentType >::size ( ) const
inline

◆ tryGet() [1/2]

template<ValidEntity EntityType, typename ComponentType >
ComponentType * ecs::ComponentStorage< EntityType, ComponentType >::tryGet ( EntityType  entity)
inline

◆ tryGet() [2/2]

template<ValidEntity EntityType, typename ComponentType >
const ComponentType * ecs::ComponentStorage< EntityType, ComponentType >::tryGet ( EntityType  entity) const
inline

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