LeviLamina
Loading...
Searching...
No Matches
QueryRegistry.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/client/gui/oreui/binding/ECapabilities.h"
7#include "mc/client/gui/oreui/binding/IdType.h"
8#include "mc/client/gui/oreui/binding/interface/IBindable.h"
9#include "mc/deps/core/utility/pub_sub/Subscription.h"
10#include "mc/platform/brstd/flat_map.h"
11
12// auto generated forward declare list
13// clang-format off
14namespace OreUI::Debug { struct QueryInformation; }
15namespace OreUI::Detail { class Binder; }
16namespace OreUI::Detail { class IHandlerFactory; }
17namespace OreUI::Detail { class IQuery; }
18// clang-format on
19
20namespace OreUI::Detail {
21
22class QueryRegistry : public ::OreUI::Detail::IBindable {
23public:
24 // QueryRegistry inner types declare
25 // clang-format off
26 class QueryTemplate;
27 class LiveQuery;
28 struct DirtyQuery;
29 // clang-format on
30
31 // QueryRegistry inner types define
32 class QueryTemplate {
33 public:
34 // QueryTemplate inner types define
35 using FactoryPtr = ::std::unique_ptr<::OreUI::Detail::IHandlerFactory>;
36
37 public:
38 // member variables
39 // NOLINTBEGIN
40 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::OreUI::Detail::IHandlerFactory>> mHandlerFactory;
41 ::ll::TypedStorage<8, 8, void*> mHandle;
42 // NOLINTEND
43
44 public:
45 // member functions
46 // NOLINTBEGIN
47 MCAPI void bind(::std::string const& queryName, ::OreUI::Detail::Binder const& binder);
48 // NOLINTEND
49 };
50
51 class LiveQuery {
52 public:
53 // LiveQuery inner types define
54 enum class EQueryState : uint {
55 Unknown = 0,
56 Active = 1,
57 Deleted = 2,
58 };
59
60 public:
61 // member variables
62 // NOLINTBEGIN
63 ::ll::TypedStorage<8, 8, ::OreUI::Detail::IdType> mId;
64 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::OreUI::Detail::IQuery>> mQuery;
65 ::ll::TypedStorage<8, 8, ::OreUI::Detail::QueryRegistry*> mRegistry;
66 ::ll::TypedStorage<4, 4, int> mRank;
67 ::ll::TypedStorage<1, 1, ::OreUI::ECapabilities> mCapabilities;
68 ::ll::TypedStorage<8, 16, ::Bedrock::PubSub::Subscription> mToken;
69 ::ll::TypedStorage<4, 4, ::OreUI::Detail::QueryRegistry::LiveQuery::EQueryState> mState;
70 // NOLINTEND
71
72 public:
73 // prevent constructor by default
74 LiveQuery& operator=(LiveQuery const&);
75 LiveQuery(LiveQuery const&);
76 LiveQuery();
77
78 public:
79 // member functions
80 // NOLINTBEGIN
81 MCAPI LiveQuery(::OreUI::Detail::QueryRegistry::LiveQuery&& other);
82
83 MCAPI LiveQuery(
84 ::OreUI::Detail::Binder const& binder,
85 ::OreUI::Detail::IdType const& id,
86 ::OreUI::ECapabilities capabilities,
87 ::std::unique_ptr<::OreUI::Detail::IQuery> query,
88 ::OreUI::Detail::QueryRegistry* registry,
89 int rank
90 );
91
92 MCAPI ::OreUI::Detail::QueryRegistry::LiveQuery& operator=(::OreUI::Detail::QueryRegistry::LiveQuery&& other);
93
94 MCAPI ~LiveQuery();
95 // NOLINTEND
96
97 public:
98 // constructor thunks
99 // NOLINTBEGIN
100 MCAPI void* $ctor(::OreUI::Detail::QueryRegistry::LiveQuery&& other);
101
102 MCAPI void* $ctor(
103 ::OreUI::Detail::Binder const& binder,
104 ::OreUI::Detail::IdType const& id,
105 ::OreUI::ECapabilities capabilities,
106 ::std::unique_ptr<::OreUI::Detail::IQuery> query,
107 ::OreUI::Detail::QueryRegistry* registry,
108 int rank
109 );
110 // NOLINTEND
111
112 public:
113 // destructor thunk
114 // NOLINTBEGIN
115 MCAPI void $dtor();
116 // NOLINTEND
117 };
118
119 struct DirtyQuery {
120 public:
121 // member variables
122 // NOLINTBEGIN
123 ::ll::TypedStorage<8, 8, ::OreUI::Detail::IdType> id;
124 ::ll::TypedStorage<4, 4, int> rank;
125 ::ll::TypedStorage<
126 8,
127 8,
128 ::std::reference_wrapper<::brstd::flat_map<
129 ::OreUI::Detail::IdType,
130 ::OreUI::Detail::QueryRegistry::LiveQuery,
131 ::std::less<::OreUI::Detail::IdType>,
132 ::std::vector<::OreUI::Detail::IdType>,
133 ::std::vector<::OreUI::Detail::QueryRegistry::LiveQuery>>>>
134 container;
135 // NOLINTEND
136 };
137
138 using QueryPtr = ::std::unique_ptr<::OreUI::Detail::IQuery>;
139
140public:
141 // member variables
142 // NOLINTBEGIN
143 ::ll::TypedStorage<8, 8, ::std::reference_wrapper<::OreUI::Detail::Binder>> mBinder;
144 ::ll::TypedStorage<8, 8, void*> mDestroyHandle;
145 ::ll::TypedStorage<1, 1, bool> mPurgeQueries;
146 ::ll::TypedStorage<8, 64, ::std::unordered_map<::std::string, ::OreUI::Detail::QueryRegistry::QueryTemplate>>
147 mQueryTemplates;
148 ::ll::TypedStorage<
149 8,
150 48,
151 ::brstd::flat_map<
152 ::OreUI::Detail::IdType,
153 ::OreUI::Detail::QueryRegistry::LiveQuery,
154 ::std::less<::OreUI::Detail::IdType>,
155 ::std::vector<::OreUI::Detail::IdType>,
156 ::std::vector<::OreUI::Detail::QueryRegistry::LiveQuery>>>
157 mReactiveQueries;
158 ::ll::TypedStorage<
159 8,
160 48,
161 ::brstd::flat_map<
162 ::OreUI::Detail::IdType,
163 ::OreUI::Detail::QueryRegistry::LiveQuery,
164 ::std::less<::OreUI::Detail::IdType>,
165 ::std::vector<::OreUI::Detail::IdType>,
166 ::std::vector<::OreUI::Detail::QueryRegistry::LiveQuery>>>
167 mDynamicQueries;
168 ::ll::TypedStorage<8, 24, ::std::vector<::OreUI::Detail::QueryRegistry::DirtyQuery>> mDirtyQueries;
169 ::ll::TypedStorage<8, 24, ::std::vector<::OreUI::Detail::QueryRegistry::LiveQuery>> mAdditionQueue;
170 ::ll::TypedStorage<1, 1, bool> mIterating;
171 // NOLINTEND
172
173public:
174 // prevent constructor by default
175 QueryRegistry();
176
177public:
178 // virtual functions
179 // NOLINTBEGIN
180 virtual ~QueryRegistry() /*override*/;
181
182 virtual void onReadyForBindings() /*override*/;
183
184 virtual void onSuspend() /*override*/;
185
186 virtual void onBindingsReleased() /*override*/;
187
188 virtual void update(double const time) /*override*/;
189 // NOLINTEND
190
191public:
192 // member functions
193 // NOLINTBEGIN
194 MCAPI explicit QueryRegistry(::OreUI::Detail::Binder& binder);
195
196 MCAPI void _createQuery(
197 ::OreUI::Detail::IdType const& id,
198 ::OreUI::ECapabilities capabilities,
199 ::std::unique_ptr<::OreUI::Detail::IQuery> query,
200 int rank
201 );
202
203 MCAPI void _destroyQuery(::OreUI::Detail::IdType const& id);
204
205 MCAPI void _syncQueries();
206
207 MCAPI ::std::vector<::OreUI::Debug::QueryInformation> getQueryInformation() const;
208 // NOLINTEND
209
210public:
211 // constructor thunks
212 // NOLINTBEGIN
213 MCAPI void* $ctor(::OreUI::Detail::Binder& binder);
214 // NOLINTEND
215
216public:
217 // destructor thunk
218 // NOLINTBEGIN
219 MCAPI void $dtor();
220 // NOLINTEND
221
222public:
223 // virtual function thunks
224 // NOLINTBEGIN
225 MCAPI void $onReadyForBindings();
226
227 MCAPI void $onSuspend();
228
229 MCFOLD void $onBindingsReleased();
230
231 MCAPI void $update(double const time);
232 // NOLINTEND
233
234public:
235 // vftables
236 // NOLINTBEGIN
237 MCNAPI static void** $vftable();
238 // NOLINTEND
239};
240
241} // namespace OreUI::Detail
Definition Binder.h:7
Definition IHandlerFactory.h:7
Definition IQuery.h:7
Definition QueryRegistry.h:19
Definition QueryRegistry.h:17
Definition QueryRegistry.h:7
static MCAPI void ** $vftable()
Definition QueryInformation.h:7
Definition QueryRegistry.h:25