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

A variant type that describes a value that can be used as a shader specialization constant. More...

#include <CeresEngine/Material/Shader.hpp>

Inheritance diagram for CeresEngine::ShaderSpecializationConstant:
CeresEngine::Variant< String, Int64, bool >

Public Member Functions

 ShaderSpecializationConstant ()
 Cretaes a new specialization constant with a default value of 0.
 
 ShaderSpecializationConstant (String string)
 Constructs a new specialization constant with a String.
 
 ShaderSpecializationConstant (const StringView string)
 Constructs a new specialization constant with a StringView.
 
 ShaderSpecializationConstant (const bool string)
 Constructs a new specialization constant with a bool.
 
 ShaderSpecializationConstant (const UInt8 string)
 Constructs a new specialization constant with a UInt8.
 
 ShaderSpecializationConstant (const UInt16 string)
 Constructs a new specialization constant with a UInt16.
 
 ShaderSpecializationConstant (const UInt32 string)
 Constructs a new specialization constant with a UInt32.
 
 ShaderSpecializationConstant (const Int8 string)
 Constructs a new specialization constant with a Int8.
 
 ShaderSpecializationConstant (const Int16 string)
 Constructs a new specialization constant with a Int16.
 
 ShaderSpecializationConstant (const Int32 string)
 Constructs a new specialization constant with a Int32.
 
 ShaderSpecializationConstant (const Int64 string)
 Constructs a new specialization constant with a Int64.
 
 ShaderSpecializationConstant (const ShaderSpecializationConstant &)=default
 
ShaderSpecializationConstantoperator= (const ShaderSpecializationConstant &)=default
 
 ShaderSpecializationConstant (ShaderSpecializationConstant &&)=default
 
ShaderSpecializationConstantoperator= (ShaderSpecializationConstant &&)=default
 
template<typename T >
bool is () const noexcept
 Checks if the shader specialization constant holds a given type T.
 
template<>
bool is () const noexcept
 Checks if the shader specialization has a value of type String.
 
template<>
bool is () const noexcept
 Checks if the shader specialization has a value of type StringView.
 
template<>
bool is () const noexcept
 Checks if the shader specialization has a value of type bool.
 
template<>
bool is () const noexcept
 Checks if the shader specialization has a value of type UInt8.
 
template<>
bool is () const noexcept
 Checks if the shader specialization has a value of type UInt16.
 
template<>
bool is () const noexcept
 Checks if the shader specialization has a value of type UInt32.
 
template<>
bool is () const noexcept
 Checks if the shader specialization has a value of type Int8.
 
template<>
bool is () const noexcept
 Checks if the shader specialization has a value of type Int16.
 
template<>
bool is () const noexcept
 Checks if the shader specialization has a value of type Int32.
 
template<>
bool is () const noexcept
 Checks if the shader specialization has a value of type Int64.
 
template<typename T >
decltype(auto) as () const
 Gets the shader specialization constant value as type T.
 
template<>
decltype(auto) as () const
 Gets the specialization constant value as a String.
 
template<>
decltype(auto) as () const
 Gets the specialization constant value as a StringView.
 
template<>
decltype(auto) as () const
 Gets the specialization constant value as a bool.
 
template<>
decltype(auto) as () const
 Gets the specialization constant value as a UInt8.
 
template<>
decltype(auto) as () const
 Gets the specialization constant value as a UInt16.
 
template<>
decltype(auto) as () const
 Gets the specialization constant value as a UInt32.
 
template<>
decltype(auto) as () const
 Gets the specialization constant value as a Int8.
 
template<>
decltype(auto) as () const
 Gets the specialization constant value as a Int16.
 
template<>
decltype(auto) as () const
 Gets the specialization constant value as a Int32.
 
template<>
decltype(auto) as () const
 Gets the specialization constant value as a Int64.
 

Private Types

using super = Variant< String, Int64, bool >
 

Private Member Functions

template<typename T >
bool isConvertibleAs () const noexcept
 Checks if the value is numeric is a type and convertible to T.
 
template<typename T >
T convertAs () const noexcept
 Converts a numeric type to T.
 
- Private Member Functions inherited from CeresEngine::Variant< String, Int64, bool >
constexpr std::size_t getIndex () const noexcept
 
constexpr bool is () const noexcept
 
constexpr T & as () &
 
constexpr T && as () &&
 
constexpr const T & as () const &
 
constexpr const T && as () const &&
 
constexpr std::add_pointer_t< T > asIf () noexcept
 
constexpr std::add_pointer_t< const T > asIf () const noexcept
 
constexpr decltype(auto) visit (Visitor &&visitor) &
 
constexpr decltype(auto) visit (Visitor &&visitor) &&
 
constexpr decltype(auto) visit (Visitor &&visitor) const &
 
constexpr decltype(auto) visit (Visitor &&visitor) const &&
 

Detailed Description

A variant type that describes a value that can be used as a shader specialization constant.

Member Typedef Documentation

◆ super

Constructor & Destructor Documentation

◆ ShaderSpecializationConstant() [1/13]

CeresEngine::ShaderSpecializationConstant::ShaderSpecializationConstant ( )
inline

Cretaes a new specialization constant with a default value of 0.

◆ ShaderSpecializationConstant() [2/13]

CeresEngine::ShaderSpecializationConstant::ShaderSpecializationConstant ( String  string)
inline

Constructs a new specialization constant with a String.

◆ ShaderSpecializationConstant() [3/13]

CeresEngine::ShaderSpecializationConstant::ShaderSpecializationConstant ( const StringView  string)
inline

Constructs a new specialization constant with a StringView.

◆ ShaderSpecializationConstant() [4/13]

CeresEngine::ShaderSpecializationConstant::ShaderSpecializationConstant ( const bool  string)
inline

Constructs a new specialization constant with a bool.

◆ ShaderSpecializationConstant() [5/13]

CeresEngine::ShaderSpecializationConstant::ShaderSpecializationConstant ( const UInt8  string)
inline

Constructs a new specialization constant with a UInt8.

◆ ShaderSpecializationConstant() [6/13]

CeresEngine::ShaderSpecializationConstant::ShaderSpecializationConstant ( const UInt16  string)
inline

Constructs a new specialization constant with a UInt16.

◆ ShaderSpecializationConstant() [7/13]

CeresEngine::ShaderSpecializationConstant::ShaderSpecializationConstant ( const UInt32  string)
inline

Constructs a new specialization constant with a UInt32.

◆ ShaderSpecializationConstant() [8/13]

CeresEngine::ShaderSpecializationConstant::ShaderSpecializationConstant ( const Int8  string)
inline

Constructs a new specialization constant with a Int8.

◆ ShaderSpecializationConstant() [9/13]

CeresEngine::ShaderSpecializationConstant::ShaderSpecializationConstant ( const Int16  string)
inline

Constructs a new specialization constant with a Int16.

◆ ShaderSpecializationConstant() [10/13]

CeresEngine::ShaderSpecializationConstant::ShaderSpecializationConstant ( const Int32  string)
inline

Constructs a new specialization constant with a Int32.

◆ ShaderSpecializationConstant() [11/13]

CeresEngine::ShaderSpecializationConstant::ShaderSpecializationConstant ( const Int64  string)
inline

Constructs a new specialization constant with a Int64.

◆ ShaderSpecializationConstant() [12/13]

CeresEngine::ShaderSpecializationConstant::ShaderSpecializationConstant ( const ShaderSpecializationConstant )
default

◆ ShaderSpecializationConstant() [13/13]

CeresEngine::ShaderSpecializationConstant::ShaderSpecializationConstant ( ShaderSpecializationConstant &&  )
default

Member Function Documentation

◆ as() [1/11]

template<typename T >
decltype(auto) CeresEngine::ShaderSpecializationConstant::as ( ) const

Gets the shader specialization constant value as type T.

Template Parameters
TThe type of the shader specialization constant to get the value as.
Returns
The stored value as type T or converted to T.

◆ as() [2/11]

template<>
decltype(auto) CeresEngine::ShaderSpecializationConstant::as ( ) const
inline

Gets the specialization constant value as a String.

◆ as() [3/11]

template<>
decltype(auto) CeresEngine::ShaderSpecializationConstant::as ( ) const
inline

Gets the specialization constant value as a StringView.

◆ as() [4/11]

template<>
decltype(auto) CeresEngine::ShaderSpecializationConstant::as ( ) const
inline

Gets the specialization constant value as a bool.

◆ as() [5/11]

template<>
decltype(auto) CeresEngine::ShaderSpecializationConstant::as ( ) const
inline

Gets the specialization constant value as a UInt8.

◆ as() [6/11]

template<>
decltype(auto) CeresEngine::ShaderSpecializationConstant::as ( ) const
inline

Gets the specialization constant value as a UInt16.

◆ as() [7/11]

template<>
decltype(auto) CeresEngine::ShaderSpecializationConstant::as ( ) const
inline

Gets the specialization constant value as a UInt32.

◆ as() [8/11]

template<>
decltype(auto) CeresEngine::ShaderSpecializationConstant::as ( ) const
inline

Gets the specialization constant value as a Int8.

◆ as() [9/11]

template<>
decltype(auto) CeresEngine::ShaderSpecializationConstant::as ( ) const
inline

Gets the specialization constant value as a Int16.

◆ as() [10/11]

template<>
decltype(auto) CeresEngine::ShaderSpecializationConstant::as ( ) const
inline

Gets the specialization constant value as a Int32.

◆ as() [11/11]

template<>
decltype(auto) CeresEngine::ShaderSpecializationConstant::as ( ) const
inline

Gets the specialization constant value as a Int64.

◆ convertAs()

template<typename T >
T CeresEngine::ShaderSpecializationConstant::convertAs ( ) const
inlineprivatenoexcept

Converts a numeric type to T.

◆ is() [1/11]

template<typename T >
bool CeresEngine::ShaderSpecializationConstant::is ( ) const
noexcept

Checks if the shader specialization constant holds a given type T.

Template Parameters
TThe type of the shader specialization constant value to check against.
Returns
True if the stored type is T or convertible to T.

◆ is() [2/11]

template<>
bool CeresEngine::ShaderSpecializationConstant::is ( ) const
inlinenoexcept

Checks if the shader specialization has a value of type String.

◆ is() [3/11]

template<>
bool CeresEngine::ShaderSpecializationConstant::is ( ) const
inlinenoexcept

Checks if the shader specialization has a value of type StringView.

◆ is() [4/11]

template<>
bool CeresEngine::ShaderSpecializationConstant::is ( ) const
inlinenoexcept

Checks if the shader specialization has a value of type bool.

◆ is() [5/11]

template<>
bool CeresEngine::ShaderSpecializationConstant::is ( ) const
inlinenoexcept

Checks if the shader specialization has a value of type UInt8.

◆ is() [6/11]

template<>
bool CeresEngine::ShaderSpecializationConstant::is ( ) const
inlinenoexcept

Checks if the shader specialization has a value of type UInt16.

◆ is() [7/11]

template<>
bool CeresEngine::ShaderSpecializationConstant::is ( ) const
inlinenoexcept

Checks if the shader specialization has a value of type UInt32.

◆ is() [8/11]

template<>
bool CeresEngine::ShaderSpecializationConstant::is ( ) const
inlinenoexcept

Checks if the shader specialization has a value of type Int8.

◆ is() [9/11]

template<>
bool CeresEngine::ShaderSpecializationConstant::is ( ) const
inlinenoexcept

Checks if the shader specialization has a value of type Int16.

◆ is() [10/11]

template<>
bool CeresEngine::ShaderSpecializationConstant::is ( ) const
inlinenoexcept

Checks if the shader specialization has a value of type Int32.

◆ is() [11/11]

template<>
bool CeresEngine::ShaderSpecializationConstant::is ( ) const
inlinenoexcept

Checks if the shader specialization has a value of type Int64.

◆ isConvertibleAs()

template<typename T >
bool CeresEngine::ShaderSpecializationConstant::isConvertibleAs ( ) const
inlineprivatenoexcept

Checks if the value is numeric is a type and convertible to T.

◆ operator=() [1/2]

ShaderSpecializationConstant & CeresEngine::ShaderSpecializationConstant::operator= ( const ShaderSpecializationConstant )
default

◆ operator=() [2/2]

ShaderSpecializationConstant & CeresEngine::ShaderSpecializationConstant::operator= ( ShaderSpecializationConstant &&  )
default

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