co_ecs 0.9.0
Cobalt ECS
Loading...
Searching...
No Matches
co_ecs::component_set Class Reference

Component set holds a set of component IDs. More...

#include <component.hpp>

Public Types

using storage_type = detail::dynamic_bitset<>
 

Public Member Functions

template<component T>
void insert ()
 Insert component of type T.
 
template<component T>
void erase ()
 Erase component of type T.
 
template<component T>
auto contains () const -> bool
 Check if component of type T is present in the set.
 
void insert (component_id_t id)
 Inserts component into the set.
 
void erase (component_id_t id)
 Erases component from the set.
 
auto contains (component_id_t id) const -> bool
 Check if component is present in the set.
 
void clear () noexcept
 
auto operator== (const component_set &rhs) const noexcept -> bool
 Equality operator.
 

Static Public Member Functions

template<component... Args>
static auto create () -> component_set
 Construct component set from given component types.
 

Friends

class component_set_hasher
 

Detailed Description

Component set holds a set of component IDs.

Member Typedef Documentation

◆ storage_type

using co_ecs::component_set::storage_type = detail::dynamic_bitset<>

Member Function Documentation

◆ clear()

void co_ecs::component_set::clear ( )
inlinenoexcept

◆ contains() [1/2]

template<component T>
auto co_ecs::component_set::contains ( ) const -> bool
inline

Check if component of type T is present in the set.

Template Parameters
TComponent type
Returns
true When component type T is present
false When component type T is not present

◆ contains() [2/2]

auto co_ecs::component_set::contains ( component_id_t id) const -> bool
inline

Check if component is present in the set.

Parameters
idComponent ID
Returns
true When component ID is present
false When component ID is not present

◆ create()

template<component... Args>
static auto co_ecs::component_set::create ( ) -> component_set
inlinestatic

Construct component set from given component types.

Template Parameters
ArgsComponents type parameter pack
Returns
component_set Component set

◆ erase() [1/2]

template<component T>
void co_ecs::component_set::erase ( )
inline

Erase component of type T.

Template Parameters
TComponent type

◆ erase() [2/2]

void co_ecs::component_set::erase ( component_id_t id)
inline

Erases component from the set.

Parameters
idComponent ID

◆ insert() [1/2]

template<component T>
void co_ecs::component_set::insert ( )
inline

Insert component of type T.

Template Parameters
TComponent type

◆ insert() [2/2]

void co_ecs::component_set::insert ( component_id_t id)
inline

Inserts component into the set.

Parameters
idComponent ID

◆ operator==()

auto co_ecs::component_set::operator== ( const component_set & rhs) const -> bool
inlinenoexcept

Equality operator.

Parameters
rhsRight hand side
Returns
true If equal
false If not equal

Friends And Related Symbol Documentation

◆ component_set_hasher

friend class component_set_hasher
friend

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