From b147a0daa1be2c5e7faea33f500e7f22541c12a0 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Fri, 25 Aug 2023 19:28:32 +0200 Subject: entities: add intents for metadata It's going to be used for serialization which has different fields. --- entity/metadata.hpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'entity') diff --git a/entity/metadata.hpp b/entity/metadata.hpp index 1902091f..dd82ce8a 100644 --- a/entity/metadata.hpp +++ b/entity/metadata.hpp @@ -17,7 +17,11 @@ namespace floormat::entities { -template struct entity_accessors; +struct inspect_intent_t {}; +struct serialize_intent_t {}; +struct report_intent_t {}; + +template struct entity_accessors; } // namespace floormat::entities @@ -248,7 +252,7 @@ constexpr bool find_in_tuple(F&& fun, Tuple&& tuple) namespace floormat { -template +template class entity_metadata final { static_assert(std::is_same_v>); @@ -257,14 +261,14 @@ class entity_metadata final { public: static constexpr StringView class_name = name_of; - static constexpr auto accessors = entities::entity_accessors::accessors(); + static constexpr auto accessors = entities::entity_accessors::accessors(); static constexpr size_t size = std::tuple_size_v>; static constexpr auto erased_accessors = erased_helper(accessors, std::make_index_sequence{}); }; -template +template template -consteval auto entity_metadata::erased_helper(const Tuple& tuple, std::index_sequence) +consteval auto entity_metadata::erased_helper(const Tuple& tuple, std::index_sequence) { std::array array { std::get(tuple).erased()..., }; return array; -- cgit v1.2.3