1 #ifndef EAGINE_ECS_STORAGE_CAPS_HPP
9 #define EAGINE_ECS_STORAGE_CAPS_HPP
11 #include "../bitfield.hpp"
12 #include "../reflect/map_enumerators.hpp"
14 namespace eagine::ecs {
16 enum class storage_cap_bit : unsigned short {
25 template <
typename Selector>
27 enumerator_mapping(type_identity<storage_cap_bit>, Selector) noexcept {
28 return enumerator_map_type<storage_cap_bit, 6>{
29 {{
"hide", storage_cap_bit::hide},
30 {
"copy", storage_cap_bit::copy},
31 {
"swap", storage_cap_bit::swap},
32 {
"store", storage_cap_bit::store},
33 {
"remove", storage_cap_bit::remove},
34 {
"modify", storage_cap_bit::modify}}};
37 static inline auto operator|(storage_cap_bit a, storage_cap_bit b) noexcept
38 -> bitfield<storage_cap_bit> {
42 class storage_caps :
public bitfield<storage_cap_bit> {
44 using _base = bitfield<storage_cap_bit>;
47 storage_caps() noexcept = default;
49 storage_caps(bitfield<storage_cap_bit> base)
52 auto can_hide() const noexcept ->
bool {
53 return has(storage_cap_bit::hide);
56 auto can_copy() const noexcept ->
bool {
57 return has(storage_cap_bit::hide);
60 auto can_swap() const noexcept ->
bool {
61 return has(storage_cap_bit::hide);
64 auto can_remove() const noexcept ->
bool {
65 return has(storage_cap_bit::remove);
68 auto can_store() const noexcept ->
bool {
69 return has(storage_cap_bit::store);
72 auto can_modify() const noexcept ->
bool {
73 return has(storage_cap_bit::modify);
79 #endif // EAGINE_ECS_STORAGE_CAPS_HPP