neoGFX
Cross-platform C++ app/game engine
neogfx::game::static_component< Data > Class Template Reference

#include <component.hpp>

Inheritance diagram for neogfx::game::static_component< Data >:
neogfx::game::static_component_base< Data, i_component > neogfx::game::i_component neogfx::game::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::vector< reverse_index_tfree_indices_t
 
typedef std::unique_ptr< self_typesnapshot_ptr
 
- Public Types inherited from neogfx::game::static_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

 static_component (game::i_ecs &aEcs)
 
 static_component (const self_type &aOther)
 
self_typeoperator= (const self_type &aRhs)
 
entity_id entity (const data_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 (entity_id aEntity) const
 
bool has_entity_record (entity_id aEntity) const override
 
const data_typeentity_record (entity_id aEntity) const
 
value_typeentity_record (entity_id aEntity)
 
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)
 
void * populate (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)
 
- Public Member Functions inherited from neogfx::game::static_component_base< Data, i_component >
 static_component_base (game::i_ecs &aEcs)
 
 static_component_base (const self_type &aOther)
 
self_typeoperator= (const self_type &aRhs)
 
game::i_ecsecs () const override
 
const component_idid () const override
 
std::recursive_mutex & mutex () const
 
bool is_data_optional () const override
 
const 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 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 neogfx::game::i_component
template<typename ComponentData >
void * populate (entity_id aEntity, ComponentData &&aComponentData)
 
- Public Member Functions inherited from neogfx::game::i_component_base
virtual ~i_component_base ()=default
 

Detailed Description

template<typename Data>
class neogfx::game::static_component< Data >

Definition at line 184 of file component.hpp.

Member Typedef Documentation

◆ component_data_entities_t

template<typename Data >
typedef std::vector<entity_id> neogfx::game::static_component< Data >::component_data_entities_t

Definition at line 196 of file component.hpp.

◆ component_data_t

Definition at line 195 of file component.hpp.

◆ data_meta_type

template<typename Data >
typedef base_type::data_meta_type neogfx::game::static_component< Data >::data_meta_type

Definition at line 193 of file component.hpp.

◆ data_type

template<typename Data >
typedef base_type::data_type neogfx::game::static_component< Data >::data_type

Definition at line 192 of file component.hpp.

◆ free_indices_t

template<typename Data >
typedef std::vector<reverse_index_t> neogfx::game::static_component< Data >::free_indices_t

Definition at line 199 of file component.hpp.

◆ reverse_index_t

template<typename Data >
typedef component_data_t::size_type neogfx::game::static_component< Data >::reverse_index_t

Definition at line 197 of file component.hpp.

◆ reverse_indices_t

template<typename Data >
typedef std::vector<reverse_index_t> neogfx::game::static_component< Data >::reverse_indices_t

Definition at line 198 of file component.hpp.

◆ snapshot_ptr

template<typename Data >
typedef std::unique_ptr<self_type> neogfx::game::static_component< Data >::snapshot_ptr

Definition at line 201 of file component.hpp.

◆ value_type

template<typename Data >
typedef base_type::value_type neogfx::game::static_component< Data >::value_type

Definition at line 194 of file component.hpp.

Constructor & Destructor Documentation

◆ static_component() [1/2]

template<typename Data >
neogfx::game::static_component< Data >::static_component ( game::i_ecs aEcs)
inline

Definition at line 233 of file component.hpp.

◆ static_component() [2/2]

template<typename Data >
neogfx::game::static_component< Data >::static_component ( const self_type aOther)
inline

Definition at line 239 of file component.hpp.

Member Function Documentation

◆ destroy_entity_record()

template<typename Data >
void neogfx::game::static_component< Data >::destroy_entity_record ( entity_id  aEntity)
inlineoverridevirtual

Implements neogfx::game::i_component.

Definition at line 316 of file component.hpp.

◆ entities() [1/2]

template<typename Data >
const component_data_entities_t& neogfx::game::static_component< Data >::entities ( ) const
inline

Definition at line 279 of file component.hpp.

◆ entities() [2/2]

template<typename Data >
component_data_entities_t& neogfx::game::static_component< Data >::entities ( )
inline

Definition at line 283 of file component.hpp.

◆ entity()

template<typename Data >
entity_id neogfx::game::static_component< Data >::entity ( const data_type aData) const
inline

Definition at line 272 of file component.hpp.

◆ entity_record() [1/2]

template<typename Data >
const data_type& neogfx::game::static_component< Data >::entity_record ( entity_id  aEntity) const
inline

Definition at line 305 of file component.hpp.

◆ entity_record() [2/2]

template<typename Data >
value_type& neogfx::game::static_component< Data >::entity_record ( entity_id  aEntity)
inline

Definition at line 312 of file component.hpp.

◆ has_entity_record()

template<typename Data >
bool neogfx::game::static_component< Data >::has_entity_record ( entity_id  aEntity) const
inlineoverridevirtual

Implements neogfx::game::i_component.

Definition at line 301 of file component.hpp.

◆ have_snapshot()

template<typename Data >
bool neogfx::game::static_component< Data >::have_snapshot ( ) const
inline

Definition at line 356 of file component.hpp.

◆ operator=()

template<typename Data >
self_type& neogfx::game::static_component< Data >::operator= ( const self_type aRhs)
inline

Definition at line 249 of file component.hpp.

◆ populate() [1/3]

template<typename Data >
value_type& neogfx::game::static_component< Data >::populate ( entity_id  aEntity,
const value_type aData 
)
inline

Definition at line 338 of file component.hpp.

◆ populate() [2/3]

template<typename Data >
value_type& neogfx::game::static_component< Data >::populate ( entity_id  aEntity,
value_type &&  aData 
)
inline

Definition at line 342 of file component.hpp.

◆ populate() [3/3]

template<typename Data >
void* neogfx::game::static_component< Data >::populate ( entity_id  aEntity,
const void *  aComponentData,
std::size_t  aComponentDataSize 
)
inlineoverridevirtual

Implements neogfx::game::i_component.

Definition at line 346 of file component.hpp.

◆ reverse_index()

template<typename Data >
reverse_index_t neogfx::game::static_component< Data >::reverse_index ( entity_id  aEntity) const
inline

Definition at line 295 of file component.hpp.

◆ reverse_indices() [1/2]

template<typename Data >
const reverse_indices_t& neogfx::game::static_component< Data >::reverse_indices ( ) const
inline

Definition at line 287 of file component.hpp.

◆ reverse_indices() [2/2]

template<typename Data >
reverse_indices_t& neogfx::game::static_component< Data >::reverse_indices ( )
inline

Definition at line 291 of file component.hpp.

◆ snapshot()

template<typename Data >
scoped_snapshot neogfx::game::static_component< Data >::snapshot ( )
inline

Definition at line 372 of file component.hpp.

◆ sort()

template<typename Data >
template<typename Compare >
void neogfx::game::static_component< Data >::sort ( Compare  aComparator)
inline

Definition at line 378 of file component.hpp.

◆ take_snapshot()

template<typename Data >
void neogfx::game::static_component< Data >::take_snapshot ( )
inline

Definition at line 360 of file component.hpp.


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