CeresEngine 0.2.0
A game development framework
Loading...
Searching...
No Matches
CeresEngine::Box::Iterator Class Reference

#include <CeresEngine/Reflection/Box.collection.hpp>

Inheritance diagram for CeresEngine::Box::Iterator:
CeresEngine::Box

Public Types

using DifferenceType = std::ptrdiff_t
 
using ValueType = Box
 
using ReferenceType = Box
 
using difference_type = DifferenceType
 
using value_type = ValueType
 
using reference_type = ReferenceType
 

Public Member Functions

 Iterator () noexcept=default
 Creates a new empty MetaValue iterator.
 
 Iterator (Box data) noexcept
 Creates a new iterator from a MetaValue object that holds an iterator.
 
 ~Iterator () noexcept=default
 Destroys the iterator.
 
 Iterator (const Iterator &)=default
 
Iteratoroperator= (const Iterator &)=default
 
 Iterator (Iterator &&) noexcept=default
 
Iteratoroperator= (Iterator &&) noexcept=default
 
Iteratoroperator++ ()
 Increments the iterator by 1.
 
ValueType operator* () const
 Dereferences the value at the current iterator position.
 
ValueType operator-> () const
 Dereferences the value at the current iterator position.
 
- Public Member Functions inherited from CeresEngine::Box
 Box () noexcept
 Creates a new variant holding an empty value.
 
 Box (const Box &other)
 Creates a new variant by copying another, if possible.
 
Boxoperator= (const Box &other)
 Assigns a variant a new value by copying another, if possible.
 
 Box (Box &&other) noexcept
 Creates a new variant by moving another, if possible.
 
Boxoperator= (Box &&other) noexcept
 Assigns a variant a new value by moving another, if possible.
 
template<typename T >
requires (!std::is_same_v<std::decay_t<T>, Box>)
 Box (T &&value)
 Creates a new variant from a C++ value.
 
template<typename T >
requires (!std::is_same_v<std::decay_t<T>, Box>)
Boxoperator= (T &&value)
 Assigns the variant a new value a C++ value.
 
template<typename T >
requires (!std::is_same_v<T, Box>)
 Box (std::reference_wrapper< T > value)
 Creates a new variant from a C++ value.
 
template<typename T , typename... Args>
requires (!std::is_same_v<T, Box>)
 Box (std::in_place_type_t< T >, Args &&... args)
 
 Box (const void *ptr, const TypeInfo *typeInfo)
 
 ~Box () noexcept
 Destroys the variant. Will call the contained object destructor.
 
bool isSmall () const noexcept
 Determines if the value fits on the small buffer storage.
 
void clear () noexcept
 Clears the variant and makes it empty.
 
bool empty () const noexcept
 Checks if the variant is empty (i.e. holds no value).
 
 operator bool () const noexcept
 Checks if the variant is not empty (i.e. holds a value).
 
template<typename T >
bool eq (const T &value) const
 Checks if a variant holds the same value as another.
 
template<typename T >
bool neq (const T &value) const
 Checks if a variant holds the same value as another.
 
TypeID getTypeID () const noexcept
 Gets the ID of the type held by the variant.
 
Type getType () const noexcept
 Gets the type held by the variant.
 
Type getClassType () const noexcept
 Gets the type held by the variant.
 
const ClassgetClass () const noexcept
 
const EnumgetMetaEnum () const noexcept
 
template<typename T >
bool is () const
 Checks if the value held by the variant is T.
 
bool is (const Type &type) const
 
Box copy () const
 Makes a copy of the object.
 
Box ref () const &
 Gets a reference to the meta value.
 
Box cref () const &
 Gets a reference to the meta value.
 
Box rref () &&
 Gets a reference to the meta value.
 
Box ref () &&
 Gets a reference to the meta value.
 
template<typename T >
Tref () const &
 Gets the value of the variant as a reference to T.
 
template<>
Boxref () const &
 
template<typename T >
T && ref () &&
 Gets the value of the variant as a reference to T.
 
template<>
Box && ref () &&
 
template<typename T >
const Tcref () const
 Gets the value of the variant as a const reference to T.
 
template<>
const Boxcref () const
 
template<typename T >
T && rref () &&
 Gets the value of the variant as a r-value reference to T.
 
template<>
Box && rref () &&
 
voiddata () noexcept
 Returns pointer to decayed type.
 
const voiddata () const noexcept
 Returns pointer to decayed type.
 
template<typename T >
Tdata () const
 Gets the value of the variant as a pointer to const T.
 
template<typename T >
bool canConvert () const
 Checks if the value held by the variant is convertible to T.
 
bool canConvert (const TypeID &target) const
 Checks if the value held by the variant is convertible to T.
 
bool canConvert (const Type &target) const
 Checks if the value held by the variant is convertible to T.
 
bool canConvert (const TypeInfo &target) const
 Checks if the value held by the variant is convertible to T.
 
template<typename T >
T to () const &
 Gets the value of the variant as a T.
 
template<>
Box to () const &
 
Box to (const TypeID &target) const
 Gets the value of the variant as a T.
 
Box to (const Type &target) const
 Gets the value of the variant as a T.
 
Box to (const TypeInfo &target) const
 Gets the value of the variant as a T.
 
template<typename T >
void convert ()
 Converts the variant to type T.
 
template<typename T >
bool tryConvert ()
 Tries to convert the variant to type T.
 
Iterable asIterable () const &
 Views the Box as an Iterable type.
 
Iterable asIterable () &&
 
Iterator asIterator () const &
 Views the Box as an Iterator type.
 
Iterator asIterator () &&
 
Array asArray () const &
 Views the Box as an Array type.
 
Array asArray () &&
 
Map asMap () const &
 Views the Box as an Map type.
 
Map asMap () &&
 
Pointer asPointer () const &
 Views the Box as an Pointer type.
 
Pointer asPointer () &&
 

Private Types

using super = Box
 

Additional Inherited Members

- Static Public Member Functions inherited from CeresEngine::Box
template<typename T , typename... Args>
static Box create (Args &&... args)
 

Member Typedef Documentation

◆ difference_type

◆ DifferenceType

◆ reference_type

◆ ReferenceType

◆ super

◆ value_type

◆ ValueType

Constructor & Destructor Documentation

◆ Iterator() [1/4]

CeresEngine::Box::Iterator::Iterator ( )
explicitdefaultnoexcept

Creates a new empty MetaValue iterator.

◆ Iterator() [2/4]

CeresEngine::Box::Iterator::Iterator ( Box  data)
inlineexplicitnoexcept

Creates a new iterator from a MetaValue object that holds an iterator.

Parameters
dataA variant that holds an iterator.

◆ ~Iterator()

CeresEngine::Box::Iterator::~Iterator ( )
defaultnoexcept

Destroys the iterator.

◆ Iterator() [3/4]

◆ Iterator() [4/4]

Member Function Documentation

◆ operator*()

ValueType CeresEngine::Box::Iterator::operator* ( ) const

Dereferences the value at the current iterator position.

◆ operator++()

Iterator & CeresEngine::Box::Iterator::operator++ ( )

Increments the iterator by 1.

◆ operator->()

ValueType CeresEngine::Box::Iterator::operator-> ( ) const
inline

Dereferences the value at the current iterator position.

◆ operator=() [1/2]

Iterator & CeresEngine::Box::Iterator::operator= ( const Iterator )
default

◆ operator=() [2/2]

Iterator & CeresEngine::Box::Iterator::operator= ( Iterator &&  )
defaultnoexcept

The documentation for this class was generated from the following file: