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

Class representing an access pattern for components. More...

#include <access.hpp>

Public Member Functions

 access_pattern_t ()=default
 Default constructor.
 
 access_pattern_t (access_type registry_access)
 Constructs an access pattern with specified registry access.
 
 access_pattern_t (access_type access, component_meta meta)
 Constructs an access pattern for a specific component.
 
auto allows (const access_pattern_t &other) const noexcept -> bool
 Checks if this access pattern allows another access pattern.
 
auto writes_all () const noexcept -> bool
 Checks if this access pattern writes to all components.
 
auto reads_all () const noexcept -> bool
 Checks if this access pattern reads from all components.
 
auto writes (component_id_t id) const noexcept -> bool
 Checks if this access pattern writes to a specific component.
 
auto reads (component_id_t id) const noexcept -> bool
 Checks if this access pattern reads from a specific component.
 
auto operator& (const access_pattern_t &rhs) -> access_pattern_t
 Combines two access patterns using the bitwise AND operator.
 
auto operator&= (const access_pattern_t &rhs) -> access_pattern_t &
 Combines this access pattern with another using the bitwise AND assignment operator.
 

Detailed Description

Class representing an access pattern for components.

This class is used to manage and check access permissions for components within a registry.

Constructor & Destructor Documentation

◆ access_pattern_t() [1/3]

co_ecs::access_pattern_t::access_pattern_t ( )
default

Default constructor.

Constructs an access pattern with no registry access.

◆ access_pattern_t() [2/3]

co_ecs::access_pattern_t::access_pattern_t ( access_type registry_access)
inline

Constructs an access pattern with specified registry access.

Parameters
registry_accessThe type of access for the registry.

◆ access_pattern_t() [3/3]

co_ecs::access_pattern_t::access_pattern_t ( access_type access,
component_meta meta )
inline

Constructs an access pattern for a specific component.

Parameters
accessThe type of access for the component.
metaMetadata for the component.

Member Function Documentation

◆ allows()

auto co_ecs::access_pattern_t::allows ( const access_pattern_t & other) const -> bool
inlinenoexcept

Checks if this access pattern allows another access pattern.

Parameters
otherThe other access pattern to check against.
Returns
True if this access pattern allows the other, false otherwise.

◆ operator&()

auto co_ecs::access_pattern_t::operator& ( const access_pattern_t & rhs) -> access_pattern_t
inline

Combines two access patterns using the bitwise AND operator.

Parameters
rhsThe other access pattern to combine with.
Returns
A new access pattern that is the result of combining the two access patterns.

◆ operator&=()

auto co_ecs::access_pattern_t::operator&= ( const access_pattern_t & rhs) -> access_pattern_t&
inline

Combines this access pattern with another using the bitwise AND assignment operator.

Parameters
rhsThe other access pattern to combine with.
Returns
A reference to this access pattern after combining.

◆ reads()

auto co_ecs::access_pattern_t::reads ( component_id_t id) const -> bool
inlinenoexcept

Checks if this access pattern reads from a specific component.

Parameters
idThe ID of the component.
Returns
True if this access pattern reads from the component, false otherwise.

◆ reads_all()

auto co_ecs::access_pattern_t::reads_all ( ) const -> bool
inlinenoexcept

Checks if this access pattern reads from all components.

Returns
True if this access pattern reads from all components, false otherwise.

◆ writes()

auto co_ecs::access_pattern_t::writes ( component_id_t id) const -> bool
inlinenoexcept

Checks if this access pattern writes to a specific component.

Parameters
idThe ID of the component.
Returns
True if this access pattern writes to the component, false otherwise.

◆ writes_all()

auto co_ecs::access_pattern_t::writes_all ( ) const -> bool
inlinenoexcept

Checks if this access pattern writes to all components.

Returns
True if this access pattern writes to all components, false otherwise.

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