From 482ab859ede19ea0d77dbfcacd6c7f03a64a633b Mon Sep 17 00:00:00 2001 From: CHatingPython Date: Wed, 1 Jul 2026 16:25:46 +0200 Subject: [PATCH] refactor: rename thing_type to type Rename thing_type to type and use shared pointer instead of value in thing. --- furvm/include/furvm/fwd.hpp | 19 ++++-------- furvm/include/furvm/thing.hpp | 56 +++++++++++++++++++++-------------- 2 files changed, 39 insertions(+), 36 deletions(-) diff --git a/furvm/include/furvm/fwd.hpp b/furvm/include/furvm/fwd.hpp index b0d27e5..4b2d6d7 100644 --- a/furvm/include/furvm/fwd.hpp +++ b/furvm/include/furvm/fwd.hpp @@ -141,27 +141,18 @@ using mod_h = handle>; // thing.hpp /** - * @enum thing_type_t + * @enum type_t * @brief Type of the thing's type. */ -enum class thing_type_t : std::uint32_t; +enum class type_t : std::uint32_t; /** - * @struct thing_type + * @struct type * @brief Thing type. */ -struct thing_type; +struct type; -/** - * @brief Thing type's identifier. - */ -using thing_type_id = std::uint32_t; - -// TODO: Use generic header -/** - * @brief A handle to a thing type. - */ -using thing_type_h = handle>; +using type_p = std::shared_ptr; /** * @class bad_thing_access diff --git a/furvm/include/furvm/thing.hpp b/furvm/include/furvm/thing.hpp index 58f5419..06b073b 100644 --- a/furvm/include/furvm/thing.hpp +++ b/furvm/include/furvm/thing.hpp @@ -18,12 +18,12 @@ namespace furvm { -enum class thing_type_t : std::uint32_t { +enum class type_t : std::uint32_t { Primitive = 0, }; -struct thing_type { - thing_type_t type; +struct type { + type_t type; std::uint64_t value; }; @@ -35,22 +35,22 @@ using long_t = std::int64_t; /**< An 8-byte integer. */ /** * @brief A 1-byte integer thing type. */ -static constexpr thing_type ByteType = { thing_type_t::Primitive, sizeof(byte_t) }; +static constexpr type ByteType = { type_t::Primitive, sizeof(byte_t) }; /** * @brief A 2-byte integer thing type. */ -static constexpr thing_type ShortType = { thing_type_t::Primitive, sizeof(short_t) }; +static constexpr type ShortType = { type_t::Primitive, sizeof(short_t) }; /** * @brief A 4-byte integer thing type. */ -static constexpr thing_type IntType = { thing_type_t::Primitive, sizeof(int_t) }; +static constexpr type IntType = { type_t::Primitive, sizeof(int_t) }; /** * @brief An 8-byte integer thing type. */ -static constexpr thing_type LongType = { thing_type_t::Primitive, sizeof(long_t) }; +static constexpr type LongType = { type_t::Primitive, sizeof(long_t) }; template