neoGFX
Cross-platform C++ app/game engine
Loading...
Searching...
No Matches
neolib::ecs::component< Data > Class Template Reference

#include <component.hpp>

Inheritance diagram for neolib::ecs::component< Data >:
neolib::ecs::component_base< Data, i_component > neolib::ecs::i_component neolib::ecs::i_component_base

Classes

class  scoped_snapshot
 

Public Types

typedef base_type::data_type data_type
 
typedef base_type::data_meta_type data_meta_type
 
typedef base_type::value_type value_type
 
typedef base_type::component_data_t component_data_t
 
typedef std::vector< entity_idcomponent_data_entities_t
 
typedef component_data_t::size_type reverse_index_t
 
typedef std::vector< reverse_index_treverse_indices_t
 
typedef std::unique_ptr< self_typesnapshot_ptr
 
- Public Types inherited from neolib::ecs::component_base< Data, i_component >
typedef detail::crack_component_data< Data >::data_type data_type
 
typedef data_type::meta data_meta_type
 
typedef detail::crack_component_data< Data >::value_type value_type
 
typedef detail::crack_component_data< Data >::container_type component_data_t
 

Public Member Functions

 component (i_ecs &aEcs)
 
 component (const self_type &aOther)
 
self_typeoperator= (const self_type &aRhs)
 
entity_id entity (const value_type &aData) const
 
const component_data_entities_tentities () const
 
component_data_entities_tentities ()
 
const reverse_indices_treverse_indices () const
 
reverse_indices_treverse_indices ()
 
reverse_index_t reverse_index_no_lock (entity_id aEntity) const
 
bool has_entity_record_no_lock (entity_id aEntity) const override
 
const value_typeentity_record_no_lock (entity_id aEntity) const
 
value_typeentity_record_no_lock (entity_id aEntity, bool aCreate=false)
 
reverse_index_t reverse_index (entity_id aEntity) const
 
bool has_entity_record (entity_id aEntity) const override
 
const value_typeentity_record (entity_id aEntity) const
 
value_typeentity_record (entity_id aEntity, bool aCreate=false)
 
void destroy_entity_record (entity_id aEntity) override
 
value_typepopulate (entity_id aEntity, const value_type &aData)
 
value_typepopulate (entity_id aEntity, value_type &&aData)
 
const voidpopulate (entity_id aEntity, const void *aComponentData, std::size_t aComponentDataSize) override
 
bool have_snapshot () const
 
void take_snapshot ()
 
scoped_snapshot snapshot ()
 
template<typename Compare >
void sort (Compare aComparator)
 
template<typename Callable >
void apply (const Callable &aCallable)
 
template<typename Callable >
void parallel_apply (const Callable &aCallable, std::size_t aMinimumParallelismCount=0)
 
- Public Member Functions inherited from neolib::ecs::component_base< Data, i_component >
 component_base (i_ecs &aEcs)
 
 component_base (const self_type &aOther)
 
self_typeoperator= (const self_type &aRhs)
 
i_ecsecs () const override
 
const component_idid () const override
 
component_mutex< Data > & mutex () const override
 
bool is_data_optional () const override
 
const neolib::i_stringname () const override
 
uint32_t field_count () const override
 
component_data_field_type field_type (uint32_t aFieldIndex) const override
 
neolib::uuid field_type_id (uint32_t aFieldIndex) const override
 
const neolib::i_stringfield_name (uint32_t aFieldIndex) const override
 
const component_data_tcomponent_data () const
 
component_data_tcomponent_data ()
 
const value_typeoperator[] (typename component_data_t::size_type aIndex) const
 
value_typeoperator[] (typename component_data_t::size_type aIndex)
 
- Public Member Functions inherited from neolib::ecs::i_component
template<typename ComponentData >
const voidpopulate (entity_id aEntity, ComponentData &&aComponentData)
 
- Public Member Functions inherited from neolib::ecs::i_component_base
virtual ~i_component_base ()=default
 

Detailed Description

template<typename Data>
class neolib::ecs::component< Data >

Definition at line 209 of file component.hpp.

Member Typedef Documentation

◆ component_data_entities_t

template<typename Data >
typedef std::vector<entity_id> neolib::ecs::component< Data >::component_data_entities_t

Definition at line 221 of file component.hpp.

◆ component_data_t

template<typename Data >
typedef base_type::component_data_t neolib::ecs::component< Data >::component_data_t

Definition at line 220 of file component.hpp.

◆ data_meta_type

template<typename Data >
typedef base_type::data_meta_type neolib::ecs::component< Data >::data_meta_type

Definition at line 218 of file component.hpp.

◆ data_type

template<typename Data >
typedef base_type::data_type neolib::ecs::component< Data >::data_type

Definition at line 217 of file component.hpp.

◆ reverse_index_t

template<typename Data >
typedef component_data_t::size_type neolib::ecs::component< Data >::reverse_index_t

Definition at line 222 of file component.hpp.

◆ reverse_indices_t

template<typename Data >
typedef std::vector<reverse_index_t> neolib::ecs::component< Data >::reverse_indices_t

Definition at line 223 of file component.hpp.

◆ snapshot_ptr

template<typename Data >
typedef std::unique_ptr<self_type> neolib::ecs::component< Data >::snapshot_ptr

Definition at line 225 of file component.hpp.

◆ value_type

template<typename Data >
typedef base_type::value_type neolib::ecs::component< Data >::value_type

Definition at line 219 of file component.hpp.

Constructor & Destructor Documentation

◆ component() [1/2]

template<typename Data >
neolib::ecs::component< Data >::component ( i_ecs aEcs)
inline

Definition at line 254 of file component.hpp.

◆ component() [2/2]

template<typename Data >
neolib::ecs::component< Data >::component ( const self_type aOther)
inline

Definition at line 260 of file component.hpp.

Member Function Documentation

◆ apply()

template<typename Data >
template<typename Callable >
void neolib::ecs::component< Data >::apply ( const Callable aCallable)
inline

Definition at line 442 of file component.hpp.

◆ destroy_entity_record()

template<typename Data >
void neolib::ecs::component< Data >::destroy_entity_record ( entity_id  aEntity)
inlineoverridevirtual

Implements neolib::ecs::i_component.

Definition at line 357 of file component.hpp.

◆ entities() [1/2]

template<typename Data >
component_data_entities_t & neolib::ecs::component< Data >::entities ( )
inline

Definition at line 302 of file component.hpp.

◆ entities() [2/2]

template<typename Data >
const component_data_entities_t & neolib::ecs::component< Data >::entities ( ) const
inline

Definition at line 298 of file component.hpp.

◆ entity()

template<typename Data >
entity_id neolib::ecs::component< Data >::entity ( const value_type aData) const
inline

Definition at line 291 of file component.hpp.

◆ entity_record() [1/2]

template<typename Data >
const value_type & neolib::ecs::component< Data >::entity_record ( entity_id  aEntity) const
inline

Definition at line 347 of file component.hpp.

◆ entity_record() [2/2]

template<typename Data >
value_type & neolib::ecs::component< Data >::entity_record ( entity_id  aEntity,
bool  aCreate = false 
)
inline

Definition at line 352 of file component.hpp.

◆ entity_record_no_lock() [1/2]

template<typename Data >
const value_type & neolib::ecs::component< Data >::entity_record_no_lock ( entity_id  aEntity) const
inline

Definition at line 324 of file component.hpp.

◆ entity_record_no_lock() [2/2]

template<typename Data >
value_type & neolib::ecs::component< Data >::entity_record_no_lock ( entity_id  aEntity,
bool  aCreate = false 
)
inline

Definition at line 331 of file component.hpp.

◆ has_entity_record()

template<typename Data >
bool neolib::ecs::component< Data >::has_entity_record ( entity_id  aEntity) const
inlineoverridevirtual

Implements neolib::ecs::i_component.

Definition at line 342 of file component.hpp.

◆ has_entity_record_no_lock()

template<typename Data >
bool neolib::ecs::component< Data >::has_entity_record_no_lock ( entity_id  aEntity) const
inlineoverridevirtual

Implements neolib::ecs::i_component.

Definition at line 320 of file component.hpp.

◆ have_snapshot()

template<typename Data >
bool neolib::ecs::component< Data >::have_snapshot ( ) const
inline

Definition at line 400 of file component.hpp.

◆ operator=()

template<typename Data >
self_type & neolib::ecs::component< Data >::operator= ( const self_type aRhs)
inline

Definition at line 269 of file component.hpp.

◆ parallel_apply()

template<typename Data >
template<typename Callable >
void neolib::ecs::component< Data >::parallel_apply ( const Callable aCallable,
std::size_t  aMinimumParallelismCount = 0 
)
inline

Definition at line 449 of file component.hpp.

◆ populate() [1/3]

template<typename Data >
value_type & neolib::ecs::component< Data >::populate ( entity_id  aEntity,
const value_type aData 
)
inline

Definition at line 379 of file component.hpp.

◆ populate() [2/3]

template<typename Data >
const void * neolib::ecs::component< Data >::populate ( entity_id  aEntity,
const void aComponentData,
std::size_t  aComponentDataSize 
)
inlineoverridevirtual

Implements neolib::ecs::i_component.

Definition at line 389 of file component.hpp.

◆ populate() [3/3]

template<typename Data >
value_type & neolib::ecs::component< Data >::populate ( entity_id  aEntity,
value_type &&  aData 
)
inline

Definition at line 384 of file component.hpp.

◆ reverse_index()

template<typename Data >
reverse_index_t neolib::ecs::component< Data >::reverse_index ( entity_id  aEntity) const
inline

Definition at line 337 of file component.hpp.

◆ reverse_index_no_lock()

template<typename Data >
reverse_index_t neolib::ecs::component< Data >::reverse_index_no_lock ( entity_id  aEntity) const
inline

Definition at line 314 of file component.hpp.

◆ reverse_indices() [1/2]

template<typename Data >
reverse_indices_t & neolib::ecs::component< Data >::reverse_indices ( )
inline

Definition at line 310 of file component.hpp.

◆ reverse_indices() [2/2]

template<typename Data >
const reverse_indices_t & neolib::ecs::component< Data >::reverse_indices ( ) const
inline

Definition at line 306 of file component.hpp.

◆ snapshot()

template<typename Data >
scoped_snapshot neolib::ecs::component< Data >::snapshot ( )
inline

Definition at line 416 of file component.hpp.

◆ sort()

template<typename Data >
template<typename Compare >
void neolib::ecs::component< Data >::sort ( Compare  aComparator)
inline

Definition at line 422 of file component.hpp.

◆ take_snapshot()

template<typename Data >
void neolib::ecs::component< Data >::take_snapshot ( )
inline

Definition at line 404 of file component.hpp.


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