ASGE  3.2.0
Simple Game Framework in GL
ASGE::Value< T > Class Template Reference

#include <Value.hpp>

Inheritance diagram for ASGE::Value< T >:
[legend]
Collaboration diagram for ASGE::Value< T >:
[legend]

Public Member Functions

std::any get () override
 
void set (std::any object) override
 
T * value ()
 

Detailed Description

template<typename T>
class ASGE::Value< T >

The concrete implementation of the ValueBase class.

The value class uses std::any to store an object of any type. By using this templated version the data can be stored internally and access to it is controlled safely via the std::any wrapper. If an incorrect type is used an exception is thrown.

Template Parameters
TThe type of object to store.

Definition at line 54 of file Value.hpp.

Member Function Documentation

◆ get()

template<typename T >
std::any ASGE::Value< T >::get ( )
inlineoverridevirtual

Retrieves the value as a pointer wrapped in std::any container.

Returns
A pointer to the object stored.

Implements ASGE::ValueBase.

Definition at line 60 of file Value.hpp.

◆ set()

template<typename T >
void ASGE::Value< T >::set ( std::any  object)
inlineoverridevirtual

Replaces the object being stored being stored.

Parameters
objectThe replacement object to store.

Implements ASGE::ValueBase.

Definition at line 61 of file Value.hpp.

◆ value()

template<typename T >
T* ASGE::Value< T >::value ( )
inline

Retrieves the data stored in the wrapper as a pointer.

Returns
A pointer to the generic value.

Definition at line 67 of file Value.hpp.


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