cubos::core::reflection namespace

Reflection module.

Classes

template<typename T>
struct Reflect
Defines the reflection function for the given type T.
class ArrayTrait
Exposes array-like functionality of a type.
class ConstantTrait
Describes a constant version of another type.
class ConstructibleTrait
Describes how a reflected type may be constructed and destructed.
class DictionaryTrait
Exposes dictionary-like functionality of a type.
class EnumTrait
Provides enumeration functionality to an enumerated type.
class FieldsTrait
Describes the fields of a reflected type.
class HiddenTrait
Allows for a component to be hidden in the UI.
class InheritsTrait
Provides inheritance relationship between types.
class MaskTrait
Provides mask functionality to an enum mask type.
class NullableTrait
Used to manipulate values of null-representable types.
class StringConversionTrait
Stores functions for converting a type to and from a string.
class VectorTrait
Trait for types which represent math vectors using fixed-size contiguous arrays of scalars.
class WrapperTrait
Describes the single field of a reflected type.
class Type
Describes a reflected type.
class TypeClient
Manages the client-side of a reflection channel on top of a stream.
class TypeRegistry
Stores a set of types which can be accessed by name.
class TypeServer
Used to setup a TypeChannel on top of a stream, from the server side.

Functions

auto compare(const Type& type, const void* a, const void* b) -> CUBOS_CORE_API bool
Compares two instances of the same type.
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.
template<typename T>
auto autoConstructibleTrait() -> ConstructibleTrait
Returns a ConstructibleTrait with the default, copy and move constructors, set only if the type has them.

Function documentation

CUBOS_CORE_API bool cubos::core::reflection::compare(const Type& type, const void* a, const void* b)

Compares two instances of the same type.

Parameters
type The type of the data being compared
a One of the instances.
b The other instance.
Returns True if the values are equal, false otherwise.