From 6cd64d2bb7fe0ee536d008a3be94d2ea72f45ca6 Mon Sep 17 00:00:00 2001 From: BartolomeyKant Date: Mon, 16 Mar 2026 15:31:39 +0500 Subject: [PATCH 1/8] make ToAeContext const --- aether/ae_context.h | 8 ++++++-- aether/aether.cpp | 4 ++-- aether/aether.h | 2 +- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/aether/ae_context.h b/aether/ae_context.h index d42f91f4..b4b55cee 100644 --- a/aether/ae_context.h +++ b/aether/ae_context.h @@ -34,19 +34,21 @@ struct AeCtxTable { }; struct AeCtx { + bool operator<=>(AeCtx const&) const = default; + void* obj; AeCtxTable const* vtable; }; template -concept AeContextual = requires(T& t) { +concept AeContextual = requires(T const& t) { { t.ToAeContext() } -> std::same_as; }; class AeContext { public: template - constexpr AeContext(T& obj) // NOLINT(*explicit-constructor) + constexpr AeContext(T const& obj) // NOLINT(*explicit-constructor) : ctx_{obj.ToAeContext()} {} Aether& aether() const { return ctx_.vtable->aether_getter(ctx_.obj); } @@ -54,6 +56,8 @@ class AeContext { return ctx_.vtable->scheduler_getter(ctx_.obj); } + bool operator<=>(AeContext const&) const = default; + private: AeCtx ctx_; }; diff --git a/aether/aether.cpp b/aether/aether.cpp index 14e112c8..d1a549e4 100644 --- a/aether/aether.cpp +++ b/aether/aether.cpp @@ -54,14 +54,14 @@ Aether::operator ActionContext() const { return ActionContext{*action_processor}; } -AeCtx Aether::ToAeContext() { +AeCtx Aether::ToAeContext() const { static constexpr AeCtxTable ae_table{ [](void* obj) -> Aether& { return *static_cast(obj); }, [](void* obj) -> TaskScheduler& { return *static_cast(obj)->task_scheduler; }, }; - return AeCtx{this, &ae_table}; + return AeCtx{const_cast(this), &ae_table}; // NOLINT(*const-cast) } Client::ptr Aether::CreateClient(ClientConfig const& config, diff --git a/aether/aether.h b/aether/aether.h index 4226ffbb..abe93f1e 100644 --- a/aether/aether.h +++ b/aether/aether.h @@ -85,7 +85,7 @@ class Aether : public Obj { // User-facing API. operator ActionContext() const; - AeCtx ToAeContext(); + AeCtx ToAeContext() const; ObjPtr CreateClient(ClientConfig const& config, std::string const& client_id); From 57eb89ab35e44b612322e9b5004f0e1d36e7f73c Mon Sep 17 00:00:00 2001 From: BartolomeyKant Date: Mon, 16 Mar 2026 15:32:02 +0500 Subject: [PATCH 2/8] TEMPORARY add call to task scheduler and action processor together --- aether/aether.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/aether/aether.cpp b/aether/aether.cpp index d1a549e4..dd9dba9e 100644 --- a/aether/aether.cpp +++ b/aether/aether.cpp @@ -47,7 +47,9 @@ Aether::Aether(ObjProp prop) Aether::~Aether() { AE_TELE_DEBUG(AetherDestroyed); } void Aether::Update(TimePoint current_time) { - update_time = action_processor->Update(current_time); + task_scheduler->Update(current_time); + action_processor->Update(current_time); + update_time = current_time + 100ms; } Aether::operator ActionContext() const { From 9d3019e2f808b59b5ce3b0adb721a47ee337e13a Mon Sep 17 00:00:00 2001 From: BartolomeyKant Date: Mon, 16 Mar 2026 15:32:39 +0500 Subject: [PATCH 3/8] add TypeLisToTemplate_t --- aether/meta/type_list.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/aether/meta/type_list.h b/aether/meta/type_list.h index 82d4dd11..c4e212ef 100644 --- a/aether/meta/type_list.h +++ b/aether/meta/type_list.h @@ -117,6 +117,9 @@ struct TypeListToTemplate> { using type = T; }; +template