37 _component_access.emplace(meta.
id, access);
69 [[nodiscard]]
auto reads_all() const noexcept ->
bool {
82 if (
auto iter = _component_access.find(
id); iter != _component_access.end()) {
83 auto [_, access] = *iter;
101 if (
auto iter = _component_access.find(
id); iter != _component_access.end()) {
123 _registry_access = std::max(_registry_access, rhs._registry_access);
125 for (
auto [
component_id, access] : rhs._component_access) {
134 detail::sparse_map<component_id_t, access_type> _component_access;
Class representing an access pattern for components.
Definition access.hpp:19
access_pattern_t(access_type registry_access)
Constructs an access pattern with specified registry access.
Definition access.hpp:29
auto allows(const access_pattern_t &other) const noexcept -> bool
Checks if this access pattern allows another access pattern.
Definition access.hpp:44
auto reads_all() const noexcept -> bool
Checks if this access pattern reads from all components.
Definition access.hpp:69
access_pattern_t()=default
Default constructor.
auto writes_all() const noexcept -> bool
Checks if this access pattern writes to all components.
Definition access.hpp:61
auto writes(component_id_t id) const noexcept -> bool
Checks if this access pattern writes to a specific component.
Definition access.hpp:77
auto operator&(const access_pattern_t &rhs) -> access_pattern_t
Combines two access patterns using the bitwise AND operator.
Definition access.hpp:112
auto operator&=(const access_pattern_t &rhs) -> access_pattern_t &
Combines this access pattern with another using the bitwise AND assignment operator.
Definition access.hpp:122
auto reads(component_id_t id) const noexcept -> bool
Checks if this access pattern reads from a specific component.
Definition access.hpp:96
access_pattern_t(access_type access, component_meta meta)
Constructs an access pattern for a specific component.
Definition access.hpp:36
Definition archetype.hpp:11
detail::type_id< struct _component_family_t, component_id_t > component_id
Type for family used to generated component IDs.
Definition component.hpp:79
std::uint32_t component_id_t
Type for component ID.
Definition component.hpp:73
access_type
Enumeration representing the type of access.
Definition access.hpp:10
@ none
No access.
Definition access.hpp:11
@ write
Write access.
Definition access.hpp:13
@ read
Read access.
Definition access.hpp:12