core/reflection/reflect.hpp file

Function cubos::core::reflection::reflect and related macros.

Meant to be as minimal as possible in order to keep compile times low.

Namespaces

namespace cubos
Cubos libraries namespace.
namespace cubos::core
Core namespace.
namespace cubos::core::reflection
Reflection module.

Classes

template<typename T>
struct cubos::core::reflection::Reflect
Defines the reflection function for the given type T.

Functions

auto makeAnonymousType(const char* name, const char* file, std::size_t size, std::size_t alignment, void(*)(void*) destructor) -> CUBOS_CORE_API const Type&
Creates a new reflection type with a unique name created from a type name and a file path, and with a minimal ConstructibleTrait.
template<typename T>
auto reflect() -> const Type&
Reflects the given type T.

Defines

#define CUBOS_PACK(...)
Helper macro used to pass arguments with commas to other macros, wrapped in parentheses.
#define CUBOS_EMPTY
Helper macro with no effect.
#define CUBOS_REFLECT
Declares the static reflection methods.
#define CUBOS_REFLECT_IMPL(T)
Defines a reflection method for a non-templated type.
#define CUBOS_REFLECT_TEMPLATE_IMPL(args, T)
Similar to CUBOS_REFLECT_IMPL but tailored to templated types.
#define CUBOS_REFLECT_EXTERNAL_DECL_TEMPLATE(api, T)
Declares a specialization of cubos::core::reflection::Reflect for a templated type.
#define CUBOS_REFLECT_EXTERNAL_DECL(api, T)
Declares a specialization of cubos::core::reflection::Reflect for a type.
#define CUBOS_REFLECT_EXTERNAL_IMPL(T)
Implements a specialization of cubos::core::reflection::Reflect for a type.
#define CUBOS_REFLECT_EXTERNAL_TEMPLATE(args, T)
Both declares and implements a specialization of cubos::core::reflection::Reflect for a type.
#define CUBOS_ANONYMOUS_REFLECT(...)
Defines minimal reflection for a type private to a compilation unit.