acme
Foundational cross-platform layer of the ca2 framework
Loading...
Searching...
No Matches
subparticle_flags.h
1// Created by camilo on 2022-11-30 02:50 <3ThomasBorregaardSorensen!!
2#pragma once
3
4
5#include "acme/prototype/prototype/e_flag.h"
6
7
8//struct CLASS_DECL_ACME SUBPARTICLE_FLAGS
9//{
10//public:
11
12
13// ::e_flag m_eflagElement;
14// ::e_status m_estatus;
15//
16//
17// [[nodiscard]] inline bool has_flag(enum_flag eflag) const { return (m_eflagElement & eflag) == eflag; }
18// inline void set_flag(enum_flag eflag) { m_eflagElement = (enum_flag)((::u64)(m_eflagElement) | (::u64)(eflag)); }
19// inline void set_flag(enum_flag eflag, bool bSet) { if (bSet) set_flag(eflag); else clear_flag(eflag); }
20// inline void clear_flag(enum_flag eflag) { m_eflagElement = (enum_flag)((::u64)(m_eflagElement) & (~(::u64)(eflag))); }
21//
22//
23// inline void set_ok_flag() { set_flag(e_flag_success); clear_flag(e_flag_timeout); clear_flag(e_flag_failure); }
24// inline void set_nok(enum_flag estatusFailure = e_flag_failure) { clear_flag(e_flag_success); set_flag(estatusFailure); }
25// inline void set_modified_flag(bool bModified = true) { set_flag(e_flag_changed, bModified); }
26//
27//
28// inline void set_fail_flag() { set_flag(e_flag_failure); clear_flag(e_flag_success); }
29// inline void set_timed_out_flag() { set_flag(e_flag_timeout); }
30// inline void set_persistent_flag(bool bSet = true) { set_flag(e_flag_persist, bSet); }
31//
32//
33// [[nodiscard]] inline bool has_ok_flag() const { return has_flag(e_flag_success); }
34// [[nodiscard]] inline bool nok() const { return has_flag(e_flag_failure) || has_flag(e_flag_timeout); }
35// [[nodiscard]] inline bool has_timed_out_flag() { return has_flag(e_flag_timeout); }
36// [[nodiscard]] inline bool has_modified_flag() const { return has_flag(e_flag_changed); }
37// [[nodiscard]] inline bool has_persistent_flag() const { return has_flag(e_flag_persist); }
38//
39// [[nodiscard]] inline bool has_shared_flag() const { return has_flag(e_flag_shared); }
40// inline void set_shared_flag(bool bSet = true) { set_flag(e_flag_shared, bSet); }
41//
42//
43// [[nodiscard]] inline bool has_finishing_flag() const { return has_flag(e_flag_finishing); }
44// void set_finishing_flag();
45// inline void clear_finishing_flag() { clear_flag(e_flag_finishing); }
46//
47//
48// [[nodiscard]] inline bool has_acquired_flag() const { return has_flag(e_flag_acquired); }
49// inline void set_acquired_flag() { set_flag(e_flag_acquired); }
50// inline void clear_acquired_flag() { clear_flag(e_flag_acquired); }
51//
52// [[nodiscard]] inline bool has_own_synchronization_flag() const { return has_flag(e_flag_own_synchronization); }
53// inline void set_own_synchronization_flag(bool bSet = true) { set_flag(e_flag_own_synchronization, bSet); }
54// inline void clear_own_synchronization_flag() { clear_flag(e_flag_own_synchronization); }
55//
56//
57// [[nodiscard]] inline bool has_already_exists_flag() const { return has_flag(e_flag_already_exists); }
58// inline void set_already_exists_flag(bool bSet = true) { set_flag(e_flag_already_exists, bSet); }
59// inline void clear_already_exists_flag() { clear_flag(e_flag_already_exists); }
60//
61//
62// // [[nodiscard]] inline bool is_heap_allocated() const { return has_flag(e_flag_heap_allocated); }
63// // inline void set_heap_allocated() { set_flag(e_flag_heap_allocated); }
64// // inline void clear_heap_allocated() { clear_flag(e_flag_heap_allocated); }
65//
66//
67// [[nodiscard]] inline bool has_destroying_flag() const { return has_flag(e_flag_destroying); }
68// void set_destroying_flag();
69// inline void clear_destroying_flag() { clear_flag(e_flag_destroying); }
70//
71//
72// [[nodiscard]] inline bool has_storing_flag() const { return has_flag(e_flag_storing); }
73// [[nodiscard]] inline bool has_loading_flag() const { return !has_storing_flag(); }
74//
75//
76// inline void set_storing_flag() { set_flag(e_flag_storing); }
77// inline void set_loading_flag() { clear_flag(e_flag_storing); }
78//
79//
80// inline void defer_set_storing_flag() { if (!has_storing_flag()) set_storing_flag(); }
81// inline void defer_set_loading_flag() { if (!has_loading_flag()) set_loading_flag(); }
82//
83//
84// inline void set_statically_allocated_flag() { set_flag(e_flag_statically_allocated); }
85// inline void set_verbose_flag(bool bVerbose = true) { set_flag(e_flag_verbose, bVerbose); }
86// [[nodiscard]] inline bool has_verbose_flag() const { return has_flag(e_flag_verbose); }
87//
88//
89//
90// [[nodiscard]] inline bool has_read_only_flag() const { return has_flag(e_flag_read_only); }
91// inline void set_read_only_flag() { set_flag(e_flag_read_only); }
92// inline void clear_read_only_flag() { clear_flag(e_flag_read_only); }
93//
94// [[nodiscard]] inline bool has_owner_flag() const { return has_flag(e_flag_owner); }
95// inline void set_owner_flag() { set_flag(e_flag_owner); }
96// inline void clear_owner_flag() { clear_flag(e_flag_owner); }
97//
98//
99// inline bool is_status_ok() const { return m_estatus.ok(); }
100// inline bool has_failed_status() const { return !is_status_ok(); }
101//
102// //[[nodiscard]] inline bool is_realized() const { return has_flag(e_flag_realized); }
104//
105//};
106
107
108