diff options
author | hop311 <hop3114@gmail.com> | 2024-01-24 00:12:36 +0100 |
---|---|---|
committer | hop311 <hop3114@gmail.com> | 2024-01-24 00:12:36 +0100 |
commit | c56131a7d615e20e117114e005d0a3e4c9fae2ca (patch) | |
tree | a87fef0d6ee4ba06fd2e6d720553a5c1f2d6923c /src/openvic-simulation/types/IdentifierRegistry.hpp | |
parent | 268a6948c0400905dfc335427395519689f067f5 (diff) |
Made Date constexpr so that PROPERTY getters can be constexprconstexpr-date
Diffstat (limited to 'src/openvic-simulation/types/IdentifierRegistry.hpp')
-rw-r--r-- | src/openvic-simulation/types/IdentifierRegistry.hpp | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/src/openvic-simulation/types/IdentifierRegistry.hpp b/src/openvic-simulation/types/IdentifierRegistry.hpp index 10248cc..1774bb0 100644 --- a/src/openvic-simulation/types/IdentifierRegistry.hpp +++ b/src/openvic-simulation/types/IdentifierRegistry.hpp @@ -158,19 +158,15 @@ namespace OpenVic { static constexpr bool storage_type_reservable = Reservable<storage_type>; private: - const std::string name; + const std::string PROPERTY(name); const bool log_lock; storage_type PROPERTY_REF(items); - bool locked = false; + bool PROPERTY_CUSTOM_PREFIX(locked, is); identifier_index_map_t identifier_index_map; public: constexpr UniqueKeyRegistry(std::string_view new_name, bool new_log_lock = true) - : name { new_name }, log_lock { new_log_lock } {} - - constexpr std::string_view get_name() const { - return name; - } + : name { new_name }, log_lock { new_log_lock }, locked { false } {} constexpr bool add_item( item_type&& item, NodeTools::Callback<std::string_view, std::string_view> auto duplicate_callback @@ -206,10 +202,6 @@ namespace OpenVic { } } - constexpr bool is_locked() const { - return locked; - } - constexpr void reset() { identifier_index_map.clear(); items.clear(); |