From b83a3635fc89bf2c1b7ba409a479f73b9ad889c3 Mon Sep 17 00:00:00 2001 From: lisyarus Date: Sun, 10 Aug 2025 14:45:17 +0300 Subject: [PATCH] Remove modification callbacks API from ecs::container - ain't gonna implement them anyway --- libs/ecs/include/psemek/ecs/container.hpp | 48 ----------------------- 1 file changed, 48 deletions(-) diff --git a/libs/ecs/include/psemek/ecs/container.hpp b/libs/ecs/include/psemek/ecs/container.hpp index 26228e54..c9e31370 100644 --- a/libs/ecs/include/psemek/ecs/container.hpp +++ b/libs/ecs/include/psemek/ecs/container.hpp @@ -22,11 +22,8 @@ namespace psemek::ecs // TODO: // - Fully document which functions can be called from which callbacks - // - Modification callbacks implementation (const-only) // - Tables serialization // - Refactor query caches - // - Index API - // - Index implementation struct container { @@ -296,12 +293,7 @@ namespace psemek::ecs * The constructor function must have the same signature as a function * passed to the `apply()` call. * - * The constuctor is not considered to be a modification of the entity, i.e. it - * doesn't trigger modification callbacks. - * * @param function A function to be applied to created entity's components - * @return An ownerwhip token; destroying this token removes - * the constructor from this container * @warning If any two of the passed component types are equal, the call fails with * a compilation error * @warning If the constructor modifies the entity's archetype (i.e. attaches or @@ -335,11 +327,7 @@ namespace psemek::ecs * * Note that there is no way to cancel the entity's destruction. * - * The destructor is not considered to be a modification of the entity, i.e. it - * doesn't trigger modification callbacks. - * * @param function A function to be applied to a to-be destroyed entity's components - * @return An ownerwhip token; destroying it removes the destructor from the container * @warning If any two of the passed component types are equal, the call fails with * a compilation error * @warning If the destructor modifies the entity's archetype (i.e. attaches or @@ -349,42 +337,6 @@ namespace psemek::ecs template void destructor(Function && function); - /** Register a component modification callback. Each time an entity that has - * the specified set of components is modified, and the modification affects - * one of this callback's component types, the callback is called. - * - * The component types can be const-qualified, in which case the corresponding function must - * also accept the corresponding components by a const reference. - * - * The component types can be equal to ecs::without, indicating that entities having - * this component type will not be watched by this callback. These component types are not - * included in the called function signature. - * - * If the modification occurred via an accessor, the callback is called - * after the accessor is destroyed, allowing for transaction-like modification. - * - * If the modification occurred via an `apply()` or `batch_apply()` call, - * the callback is called immediately after this call. - * - * Note that modifications from within a modification callback are not considered - * as modifications, i.e. they don't recursively invoke modification callbacks. - * - * The callback function must have the same signature as a function - * passed to the `apply()` call. - * - * @param function A function to be applied to modified entity's components - * @return An ownerwhip token; destroying it removes the modification callback from the container - * @warning If any two of the passed component types are equal, the call fails with - * a compilation error - * @warning If the modification callback modifies the entity's archetype (i.e. attaches or - * detaches components), the behavior is undefined - * - * TODO: can we allow the callback to modify the archetype? - */ - // TODO: implement - template - void watch(Function && function); - /** Call a callback after exiting all currently executing ECS container methods. * * If no ECS container method is currently executed, call the callback immediately instead.