cubos::core::memory::AnyValue class final

Stores a blob of a given reflected type.

Public static functions

template<typename T, typename... TArgs>
static auto customConstruct(TArgs && ... args) -> AnyValue noexcept
Constructs a value of the given type with the given arguments.
static auto defaultConstruct(const reflection::Type& type) -> AnyValue noexcept
Default constructs a value with the given type.
static auto copyConstruct(const reflection::Type& type, const void* value) -> AnyValue noexcept
Copy constructs a value with the given type.
static auto moveConstruct(const reflection::Type& type, void* value) -> AnyValue noexcept
Move constructs a value with the given type.

Constructors, destructors, conversion operators

AnyValue()
Constructs an empty AnyValue.
AnyValue(AnyValue&& other) noexcept
Move constructs.
AnyValue(const AnyValue& other) noexcept
Copy constructs.

Public functions

auto operator=(AnyValue&& other) -> AnyValue& noexcept
Move assignment.
auto type() const -> const reflection::Type&
Get the type of the elements stored in the vector.
auto get() -> void*
Gets a pointer to the underlying value.
auto get() const -> const void*
Gets a pointer to the underlying value.
auto valid() const -> bool
Checks whether value is valid or not (holds a value).

Function documentation

template<typename T, typename... TArgs>
static AnyValue cubos::core::memory::AnyValue::customConstruct(TArgs && ... args) noexcept

Constructs a value of the given type with the given arguments.

Template parameters
T Value type.
TArgs Argument types.
Parameters
args Arguments.

static AnyValue cubos::core::memory::AnyValue::defaultConstruct(const reflection::Type& type) noexcept

Default constructs a value with the given type.

Parameters
type Value type.
Returns Value.

static AnyValue cubos::core::memory::AnyValue::copyConstruct(const reflection::Type& type, const void* value) noexcept

Copy constructs a value with the given type.

Parameters
type Value type.
value Value to copy.
Returns Value.

static AnyValue cubos::core::memory::AnyValue::moveConstruct(const reflection::Type& type, void* value) noexcept

Move constructs a value with the given type.

Parameters
type Value type.
value Value to move.
Returns Value.

cubos::core::memory::AnyValue::AnyValue(AnyValue&& other) noexcept

Move constructs.

Parameters
other Value.

cubos::core::memory::AnyValue::AnyValue(const AnyValue& other) noexcept

Copy constructs.

Parameters
other Value.

AnyValue& cubos::core::memory::AnyValue::operator=(AnyValue&& other) noexcept

Move assignment.

Parameters
other Value.

const reflection::Type& cubos::core::memory::AnyValue::type() const

Get the type of the elements stored in the vector.

Returns Element type.

void* cubos::core::memory::AnyValue::get()

Gets a pointer to the underlying value.

Returns Value.

const void* cubos::core::memory::AnyValue::get() const

Gets a pointer to the underlying value.

Returns Value.

bool cubos::core::memory::AnyValue::valid() const

Checks whether value is valid or not (holds a value).

Returns True is valid.