diff --git a/headers/meta.hpp/meta_base.hpp b/headers/meta.hpp/meta_base.hpp index a3db832..a0b294a 100644 --- a/headers/meta.hpp/meta_base.hpp +++ b/headers/meta.hpp/meta_base.hpp @@ -204,6 +204,7 @@ namespace meta_hpp namespace meta_hpp { using argument_list = std::vector; + using metadata_map = std::map>; using class_set = std::set>; using class_map = std::map>; diff --git a/headers/meta.hpp/meta_types.hpp b/headers/meta.hpp/meta_types.hpp index 71587f5..52034c4 100644 --- a/headers/meta.hpp/meta_types.hpp +++ b/headers/meta.hpp/meta_types.hpp @@ -70,6 +70,8 @@ namespace meta_hpp [[nodiscard]] type_id get_id() const noexcept; [[nodiscard]] type_kind get_kind() const noexcept; + [[nodiscard]] const metadata_map& get_metadata() const noexcept; + any_type(const array_type& other) noexcept; any_type(const class_type& other) noexcept; any_type(const constructor_type& other) noexcept; @@ -126,6 +128,7 @@ namespace meta_hpp [[nodiscard]] type_id get_id() const noexcept; [[nodiscard]] array_bitflags get_flags() const noexcept; + [[nodiscard]] const metadata_map& get_metadata() const noexcept; [[nodiscard]] std::size_t get_extent() const noexcept; [[nodiscard]] any_type get_data_type() const noexcept; @@ -144,6 +147,7 @@ namespace meta_hpp [[nodiscard]] type_id get_id() const noexcept; [[nodiscard]] class_bitflags get_flags() const noexcept; + [[nodiscard]] const metadata_map& get_metadata() const noexcept; [[nodiscard]] std::size_t get_size() const noexcept; @@ -216,6 +220,7 @@ namespace meta_hpp [[nodiscard]] type_id get_id() const noexcept; [[nodiscard]] constructor_bitflags get_flags() const noexcept; + [[nodiscard]] const metadata_map& get_metadata() const noexcept; [[nodiscard]] std::size_t get_arity() const noexcept; [[nodiscard]] any_type get_class_type() const noexcept; @@ -236,6 +241,7 @@ namespace meta_hpp [[nodiscard]] type_id get_id() const noexcept; [[nodiscard]] destructor_bitflags get_flags() const noexcept; + [[nodiscard]] const metadata_map& get_metadata() const noexcept; [[nodiscard]] any_type get_class_type() const noexcept; private: @@ -253,6 +259,7 @@ namespace meta_hpp [[nodiscard]] type_id get_id() const noexcept; [[nodiscard]] enum_bitflags get_flags() const noexcept; + [[nodiscard]] const metadata_map& get_metadata() const noexcept; [[nodiscard]] number_type get_underlying_type() const noexcept; @@ -278,6 +285,7 @@ namespace meta_hpp [[nodiscard]] type_id get_id() const noexcept; [[nodiscard]] function_bitflags get_flags() const noexcept; + [[nodiscard]] const metadata_map& get_metadata() const noexcept; [[nodiscard]] std::size_t get_arity() const noexcept; [[nodiscard]] any_type get_return_type() const noexcept; @@ -298,6 +306,7 @@ namespace meta_hpp [[nodiscard]] type_id get_id() const noexcept; [[nodiscard]] member_bitflags get_flags() const noexcept; + [[nodiscard]] const metadata_map& get_metadata() const noexcept; [[nodiscard]] class_type get_owner_type() const noexcept; [[nodiscard]] any_type get_value_type() const noexcept; @@ -316,6 +325,7 @@ namespace meta_hpp [[nodiscard]] type_id get_id() const noexcept; [[nodiscard]] method_bitflags get_flags() const noexcept; + [[nodiscard]] const metadata_map& get_metadata() const noexcept; [[nodiscard]] std::size_t get_arity() const noexcept; [[nodiscard]] class_type get_owner_type() const noexcept; @@ -336,6 +346,7 @@ namespace meta_hpp [[nodiscard]] explicit operator bool() const noexcept; [[nodiscard]] type_id get_id() const noexcept; + [[nodiscard]] const metadata_map& get_metadata() const noexcept; private: detail::nullptr_type_data_ptr data_; friend auto detail::type_access(const nullptr_type&); @@ -351,6 +362,7 @@ namespace meta_hpp [[nodiscard]] type_id get_id() const noexcept; [[nodiscard]] number_bitflags get_flags() const noexcept; + [[nodiscard]] const metadata_map& get_metadata() const noexcept; [[nodiscard]] std::size_t get_size() const noexcept; private: @@ -368,6 +380,7 @@ namespace meta_hpp [[nodiscard]] type_id get_id() const noexcept; [[nodiscard]] pointer_bitflags get_flags() const noexcept; + [[nodiscard]] const metadata_map& get_metadata() const noexcept; [[nodiscard]] any_type get_data_type() const noexcept; private: @@ -385,6 +398,7 @@ namespace meta_hpp [[nodiscard]] type_id get_id() const noexcept; [[nodiscard]] reference_bitflags get_flags() const noexcept; + [[nodiscard]] const metadata_map& get_metadata() const noexcept; [[nodiscard]] any_type get_data_type() const noexcept; private: @@ -401,6 +415,7 @@ namespace meta_hpp [[nodiscard]] explicit operator bool() const noexcept; [[nodiscard]] type_id get_id() const noexcept; + [[nodiscard]] const metadata_map& get_metadata() const noexcept; private: detail::void_type_data_ptr data_; friend auto detail::type_access(const void_type&); @@ -447,6 +462,8 @@ namespace meta_hpp::detail const type_id id; const type_kind kind; + metadata_map metadata; + explicit type_data_base(type_id id, type_kind kind) : id{id} , kind{kind} {} diff --git a/headers/meta.hpp/meta_types/any_type.hpp b/headers/meta.hpp/meta_types/any_type.hpp index 9c3a204..ec09c81 100644 --- a/headers/meta.hpp/meta_types/any_type.hpp +++ b/headers/meta.hpp/meta_types/any_type.hpp @@ -27,6 +27,10 @@ namespace meta_hpp return data_->kind; } + inline const metadata_map& any_type::get_metadata() const noexcept { + return data_->metadata; + } + inline any_type::any_type(const array_type& other) noexcept : data_{detail::type_access(other)} {} diff --git a/headers/meta.hpp/meta_types/array_type.hpp b/headers/meta.hpp/meta_types/array_type.hpp index 548d1a7..89566ec 100644 --- a/headers/meta.hpp/meta_types/array_type.hpp +++ b/headers/meta.hpp/meta_types/array_type.hpp @@ -47,6 +47,10 @@ namespace meta_hpp return data_->flags; } + inline const metadata_map& array_type::get_metadata() const noexcept { + return data_->metadata; + } + inline std::size_t array_type::get_extent() const noexcept { return data_->extent; } diff --git a/headers/meta.hpp/meta_types/class_type.hpp b/headers/meta.hpp/meta_types/class_type.hpp index 3438291..9723be0 100644 --- a/headers/meta.hpp/meta_types/class_type.hpp +++ b/headers/meta.hpp/meta_types/class_type.hpp @@ -53,6 +53,10 @@ namespace meta_hpp return data_->flags; } + inline const metadata_map& class_type::get_metadata() const noexcept { + return data_->metadata; + } + inline std::size_t class_type::get_size() const noexcept { return data_->size; } diff --git a/headers/meta.hpp/meta_types/constructor_type.hpp b/headers/meta.hpp/meta_types/constructor_type.hpp index 56ba607..0c4e900 100644 --- a/headers/meta.hpp/meta_types/constructor_type.hpp +++ b/headers/meta.hpp/meta_types/constructor_type.hpp @@ -47,6 +47,10 @@ namespace meta_hpp return data_->flags; } + inline const metadata_map& constructor_type::get_metadata() const noexcept { + return data_->metadata; + } + inline std::size_t constructor_type::get_arity() const noexcept { return data_->argument_types.size(); } diff --git a/headers/meta.hpp/meta_types/destructor_type.hpp b/headers/meta.hpp/meta_types/destructor_type.hpp index 47cd0f8..b6469af 100644 --- a/headers/meta.hpp/meta_types/destructor_type.hpp +++ b/headers/meta.hpp/meta_types/destructor_type.hpp @@ -46,6 +46,10 @@ namespace meta_hpp return data_->flags; } + inline const metadata_map& destructor_type::get_metadata() const noexcept { + return data_->metadata; + } + inline any_type destructor_type::get_class_type() const noexcept { return data_->class_type; } diff --git a/headers/meta.hpp/meta_types/enum_type.hpp b/headers/meta.hpp/meta_types/enum_type.hpp index 5fb4e42..a371600 100644 --- a/headers/meta.hpp/meta_types/enum_type.hpp +++ b/headers/meta.hpp/meta_types/enum_type.hpp @@ -49,6 +49,10 @@ namespace meta_hpp return data_->flags; } + inline const metadata_map& enum_type::get_metadata() const noexcept { + return data_->metadata; + } + inline number_type enum_type::get_underlying_type() const noexcept { return data_->underlying_type; } diff --git a/headers/meta.hpp/meta_types/function_type.hpp b/headers/meta.hpp/meta_types/function_type.hpp index 8dc2307..b92513c 100644 --- a/headers/meta.hpp/meta_types/function_type.hpp +++ b/headers/meta.hpp/meta_types/function_type.hpp @@ -47,6 +47,10 @@ namespace meta_hpp return data_->flags; } + inline const metadata_map& function_type::get_metadata() const noexcept { + return data_->metadata; + } + inline std::size_t function_type::get_arity() const noexcept { return data_->argument_types.size(); } diff --git a/headers/meta.hpp/meta_types/member_type.hpp b/headers/meta.hpp/meta_types/member_type.hpp index a5fd57a..98a478b 100644 --- a/headers/meta.hpp/meta_types/member_type.hpp +++ b/headers/meta.hpp/meta_types/member_type.hpp @@ -47,6 +47,10 @@ namespace meta_hpp return data_->flags; } + inline const metadata_map& member_type::get_metadata() const noexcept { + return data_->metadata; + } + inline class_type member_type::get_owner_type() const noexcept { return data_->owner_type; } diff --git a/headers/meta.hpp/meta_types/method_type.hpp b/headers/meta.hpp/meta_types/method_type.hpp index 87920f2..27db971 100644 --- a/headers/meta.hpp/meta_types/method_type.hpp +++ b/headers/meta.hpp/meta_types/method_type.hpp @@ -48,6 +48,10 @@ namespace meta_hpp return data_->flags; } + inline const metadata_map& method_type::get_metadata() const noexcept { + return data_->metadata; + } + inline std::size_t method_type::get_arity() const noexcept { return data_->argument_types.size(); } diff --git a/headers/meta.hpp/meta_types/nullptr_type.hpp b/headers/meta.hpp/meta_types/nullptr_type.hpp index a6407c1..0d3e01c 100644 --- a/headers/meta.hpp/meta_types/nullptr_type.hpp +++ b/headers/meta.hpp/meta_types/nullptr_type.hpp @@ -36,4 +36,8 @@ namespace meta_hpp inline type_id nullptr_type::get_id() const noexcept { return data_->id; } + + inline const metadata_map& nullptr_type::get_metadata() const noexcept { + return data_->metadata; + } } diff --git a/headers/meta.hpp/meta_types/number_type.hpp b/headers/meta.hpp/meta_types/number_type.hpp index 2bab290..30d4a80 100644 --- a/headers/meta.hpp/meta_types/number_type.hpp +++ b/headers/meta.hpp/meta_types/number_type.hpp @@ -45,6 +45,10 @@ namespace meta_hpp return data_->flags; } + inline const metadata_map& number_type::get_metadata() const noexcept { + return data_->metadata; + } + inline std::size_t number_type::get_size() const noexcept { return data_->size; } diff --git a/headers/meta.hpp/meta_types/pointer_type.hpp b/headers/meta.hpp/meta_types/pointer_type.hpp index 6b0ff1c..f963bc9 100644 --- a/headers/meta.hpp/meta_types/pointer_type.hpp +++ b/headers/meta.hpp/meta_types/pointer_type.hpp @@ -46,6 +46,10 @@ namespace meta_hpp return data_->flags; } + inline const metadata_map& pointer_type::get_metadata() const noexcept { + return data_->metadata; + } + inline any_type pointer_type::get_data_type() const noexcept { return data_->data_type; } diff --git a/headers/meta.hpp/meta_types/reference_type.hpp b/headers/meta.hpp/meta_types/reference_type.hpp index a923d42..37373b8 100644 --- a/headers/meta.hpp/meta_types/reference_type.hpp +++ b/headers/meta.hpp/meta_types/reference_type.hpp @@ -46,6 +46,10 @@ namespace meta_hpp return data_->flags; } + inline const metadata_map& reference_type::get_metadata() const noexcept { + return data_->metadata; + } + inline any_type reference_type::get_data_type() const noexcept { return data_->data_type; } diff --git a/headers/meta.hpp/meta_types/void_type.hpp b/headers/meta.hpp/meta_types/void_type.hpp index af30071..4b4a989 100644 --- a/headers/meta.hpp/meta_types/void_type.hpp +++ b/headers/meta.hpp/meta_types/void_type.hpp @@ -36,4 +36,8 @@ namespace meta_hpp inline type_id void_type::get_id() const noexcept { return data_->id; } + + inline const metadata_map& void_type::get_metadata() const noexcept { + return data_->metadata; + } }