summaryrefslogtreecommitdiffstats
path: root/deps/include/entt/meta/context.hpp
diff options
context:
space:
mode:
authoruntodesu <kirill@untode.su>2025-03-15 16:22:09 +0500
committeruntodesu <kirill@untode.su>2025-03-15 16:22:09 +0500
commit3bf42c6ff3805a0d42bbc661794a95ff31bedc26 (patch)
tree05049955847504808d6bed2bb7b155f8b03807bb /deps/include/entt/meta/context.hpp
parent02294547dcde0d4ad76e229106702261e9f10a51 (diff)
downloadvoxelius-3bf42c6ff3805a0d42bbc661794a95ff31bedc26.tar.bz2
voxelius-3bf42c6ff3805a0d42bbc661794a95ff31bedc26.zip
Add whatever I was working on for the last month
Diffstat (limited to 'deps/include/entt/meta/context.hpp')
-rw-r--r--deps/include/entt/meta/context.hpp51
1 files changed, 51 insertions, 0 deletions
diff --git a/deps/include/entt/meta/context.hpp b/deps/include/entt/meta/context.hpp
new file mode 100644
index 0000000..920a6f1
--- /dev/null
+++ b/deps/include/entt/meta/context.hpp
@@ -0,0 +1,51 @@
+#ifndef ENTT_META_CTX_HPP
+#define ENTT_META_CTX_HPP
+
+#include "../container/dense_map.hpp"
+#include "../core/fwd.hpp"
+#include "../core/utility.hpp"
+
+namespace entt {
+
+class meta_ctx;
+
+/*! @cond TURN_OFF_DOXYGEN */
+namespace internal {
+
+struct meta_type_node;
+
+struct meta_context {
+ dense_map<id_type, meta_type_node, identity> value{};
+
+ [[nodiscard]] inline static meta_context &from(meta_ctx &ctx);
+ [[nodiscard]] inline static const meta_context &from(const meta_ctx &ctx);
+};
+
+} // namespace internal
+/*! @endcond */
+
+/*! @brief Disambiguation tag for constructors and the like. */
+class meta_ctx_arg_t final {};
+
+/*! @brief Constant of type meta_context_arg_t used to disambiguate calls. */
+inline constexpr meta_ctx_arg_t meta_ctx_arg{};
+
+/*! @brief Opaque meta context type. */
+class meta_ctx: private internal::meta_context {
+ // attorney idiom like model to access the base class
+ friend struct internal::meta_context;
+};
+
+/*! @cond TURN_OFF_DOXYGEN */
+[[nodiscard]] inline internal::meta_context &internal::meta_context::from(meta_ctx &ctx) {
+ return ctx;
+}
+
+[[nodiscard]] inline const internal::meta_context &internal::meta_context::from(const meta_ctx &ctx) {
+ return ctx;
+}
+/*! @endcond */
+
+} // namespace entt
+
+#endif