3DRadSpace 0.1.0Alpha
3DRadSpace is a free, simple to use, rapid application development game engine.
Loading...
Searching...
No Matches
Engine3DRadSpace.Reflection::Any Class Reference

An container for any type of data. Similar to std::any, but specialized for the reflection system. More...

#include <Any.hpp>

Public Member Functions

 Any ()
 Creates an empty Any object.
template<typename T>
requires std::is_nothrow_move_constructible_v<T> && (!std::is_same_v<std::remove_cvref_t<T>, Any>)
 Any (T &&value)
 Constructs an object of type T from an rvalue reference (move constructor).
template<typename T>
requires (!std::is_same_v<std::remove_cvref_t<T>, Any>)
 Any (const T &value)
 Constructs an object of type T from a const lvalue reference.
template<typename T>
requires (!std::is_same_v<std::remove_cvref_t<T>, Any>)
 Any (T &value)
 Constructs an object of type T from a non-const lvalue reference.
 Any (Any &&other) noexcept
 Move constructor. Moves the stored object from the other Any, leaving it empty.
 Any (const Any &other)
 Copy constructor. Performs a deep copy of the stored object, if any.
Any & operator= (const Any &other)
Any & operator= (Any &&other) noexcept
 Move assignment operator. Moves the stored object from the other Any, leaving it empty.
template<typename T>
T Get () const
template<typename T>
T & Get ()
void Swap (Any &other) noexcept
std::type_index Type () const noexcept
bool HasValue () const noexcept
void Reset () noexcept
FieldRepresentation GetRepresentation () const
 ~Any ()

Detailed Description

An container for any type of data. Similar to std::any, but specialized for the reflection system.

Supports small object optimisation but up to 24 bytes, as specified by the smallObjectSize constant.

Constructor & Destructor Documentation

◆ Any() [1/6]

Any::Any ( )

Creates an empty Any object.

◆ Any() [2/6]

template<typename T>
requires std::is_nothrow_move_constructible_v<T> && (!std::is_same_v<std::remove_cvref_t<T>, Any>)
Engine3DRadSpace.Reflection::Any::Any ( T && value)
inline

Constructs an object of type T from an rvalue reference (move constructor).

Template Parameters
TType of the object being constructed.
Parameters
valueThe value to be stored in the Any container.

◆ Any() [3/6]

template<typename T>
requires (!std::is_same_v<std::remove_cvref_t<T>, Any>)
Engine3DRadSpace.Reflection::Any::Any ( const T & value)
inline

Constructs an object of type T from a const lvalue reference.

Template Parameters
TType of the object being constructed.
Parameters
valueThe value to be stored in the Any container.

◆ Any() [4/6]

template<typename T>
requires (!std::is_same_v<std::remove_cvref_t<T>, Any>)
Engine3DRadSpace.Reflection::Any::Any ( T & value)
inline

Constructs an object of type T from a non-const lvalue reference.

Template Parameters
TType of the object being constructed.
Parameters
valueThe value to be stored in the Any container.

◆ Any() [5/6]

Any::Any ( Any && other)
noexcept

Move constructor. Moves the stored object from the other Any, leaving it empty.

Parameters
otherThe Any object to move from.

◆ Any() [6/6]

Any::Any ( const Any & other)

Copy constructor. Performs a deep copy of the stored object, if any.

Parameters
otherThe Any object to copy from.

◆ ~Any()

Any::~Any ( )

Member Function Documentation

◆ Get() [1/2]

template<typename T>
T & Engine3DRadSpace.Reflection::Any::Get ( )
inline

◆ Get() [2/2]

template<typename T>
T Engine3DRadSpace.Reflection::Any::Get ( ) const
inline

◆ GetRepresentation()

FieldRepresentation Any::GetRepresentation ( ) const

◆ HasValue()

bool Any::HasValue ( ) const
noexcept

◆ operator=() [1/2]

Any & Any::operator= ( Any && other)
noexcept

Move assignment operator. Moves the stored object from the other Any, leaving it empty.

Parameters
otherThe Any object to move from.
Returns
The current Any object after the move.

◆ operator=() [2/2]

Any & Any::operator= ( const Any & other)

◆ Reset()

void Any::Reset ( )
noexcept

◆ Swap()

void Any::Swap ( Any & other)
noexcept

◆ Type()

std::type_index Any::Type ( ) const
noexcept

The documentation for this class was generated from the following files:
  • E:/3DRadSpace/Engine3DRadSpace/Reflection/Any.hpp
  • E:/3DRadSpace/Engine3DRadSpace/Reflection/Any.cpp