EnTT 3.12.0
Loading...
Searching...
No Matches
context.hpp
1#ifndef ENTT_META_CTX_HPP
2#define ENTT_META_CTX_HPP
3
4#include "../container/dense_map.hpp"
5#include "../core/fwd.hpp"
6#include "../core/utility.hpp"
7
8namespace entt {
9
10class meta_ctx;
11
17namespace internal {
18
19struct meta_type_node;
20
21struct meta_context {
22 dense_map<id_type, meta_type_node, identity> value{};
23
24 [[nodiscard]] static inline meta_context &from(meta_ctx &ctx);
25 [[nodiscard]] static inline const meta_context &from(const meta_ctx &ctx);
26};
27
28} // namespace internal
29
36class meta_ctx_arg_t final {};
37
39inline constexpr meta_ctx_arg_t meta_ctx_arg{};
40
42class meta_ctx: private internal::meta_context {
45};
46
52[[nodiscard]] inline internal::meta_context &internal::meta_context::from(meta_ctx &ctx) {
53 return ctx;
54}
55
56[[nodiscard]] inline const internal::meta_context &internal::meta_context::from(const meta_ctx &ctx) {
57 return ctx;
58}
59
65} // namespace entt
66
67#endif
Disambiguation tag for constructors and the like.
Definition: context.hpp:36
Opaque meta context type.
Definition: context.hpp:42
friend struct internal::meta_context
Attorney idiom like model to access the base class.
Definition: context.hpp:44
EnTT default namespace.
Definition: dense_map.hpp:21
constexpr meta_ctx_arg_t meta_ctx_arg
Constant of type meta_context_arg_t used to disambiguate calls.
Definition: context.hpp:39