GLSL Struct 1.4.8
glslstruct
Loading...
Searching...
No Matches
Glsl type visitors

glsl type visitors More...

Collaboration diagram for Glsl type visitors:

Concepts

concept  glslstruct::type_visitor
 glsl type visitor concept

Classes

class  glslstruct::type_hash_visitor
 visitor which calculate has of type More...
class  glslstruct::eq_type_visitor< T >
 visitor which checks if value glsl type A is equal to glsl type B More...
struct  glslstruct::is_type_visitor< T >
 struct with bool_constant which is true if type T is type visitor More...

Functions

 glslstruct::ENUM_CLASS_BASE (BaseType, uint8_t,(Scalar),(Vec),(Mat),(Struct),(Array)) template< glsl_type T > class is_of_type_visitor
 base_type types in enum values
template<glsl_type T>
_GLSL_STRUCT_INLINE17 _GLSL_STRUCT_CONSTEXPR20 bool glslstruct::is_of_type (const base_type_handle &type)
 requests is_of_type visitor to visit base_type
template<glsl_type T>
_GLSL_STRUCT_INLINE17 _GLSL_STRUCT_CONSTEXPR20 bool glslstruct::is_of_type (const std::shared_ptr< T > &)
 requests is_of_type visitor to visit any glsl type
_GLSL_STRUCT_EXPORT bool glslstruct::is_of_type (const base_type_handle &type, BaseType baseType)
 requests is_of_type visitor to visit base_type
template<glsl_type T>
_GLSL_STRUCT_INLINE17 _GLSL_STRUCT_CONSTEXPR20 bool glslstruct::is_of_type (const std::shared_ptr< T > &, const BaseType baseType)
 requests is_of_type visitor to visit any glsl type
template<glsl_type T>
std::shared_ptr< T > glslstruct::dynamic_type_cast (const base_type_handle &type)
 checks if base_type is of given type and returns handle to this type or nullptr if it is not
template<glsl_type T>
base_type_handle glslstruct::dynamic_type_cast (const std::shared_ptr< T > &type)
 converts any glsl type handle to base_type handle
template<glsl_type T>
_GLSL_STRUCT_INLINE17 _GLSL_STRUCT_CONSTEXPR20 std::shared_ptr< T > glslstruct::static_type_cast (const base_type_handle &type)
 checks if base_type is of given type and returns handle to this type or error if it is not
template<glsl_type T>
base_type_handle glslstruct::static_type_cast (const std::shared_ptr< T > &type)
 converts any glsl type handle to base_type handle

Variables

template<class T>
static _GLSL_STRUCT_CONSTEXPR17 bool glslstruct::is_type_visitor_v = type_visitor<T>
 bool which is true if type T is type visitor

Detailed Description

glsl type visitors

sample type visitor:

class sample_type_visitor {
void operator()(const scalar_type&);
void operator()(const vec_type&);
void operator()(const mat_type&);
void operator()(const struct_type&);
void operator()(const array_type&);
};

Function Documentation

◆ dynamic_type_cast() [1/2]

template<glsl_type T>
std::shared_ptr< T > glslstruct::dynamic_type_cast ( const base_type_handle & type)
inlinenodiscard

checks if base_type is of given type and returns handle to this type or nullptr if it is not

◆ dynamic_type_cast() [2/2]

template<glsl_type T>
base_type_handle glslstruct::dynamic_type_cast ( const std::shared_ptr< T > & type)
inlinenodiscard

converts any glsl type handle to base_type handle

◆ ENUM_CLASS_BASE()

glslstruct::ENUM_CLASS_BASE ( BaseType ,
uint8_t ,
(Scalar) ,
(Vec) ,
(Mat) ,
(Struct) ,
(Array)  )

base_type types in enum values

visitor which checks type of glsl type

Template Parameters
Trequested type

result

default constructor

default destructor

type visitor

returns result

◆ is_of_type() [1/4]

template<glsl_type T>
_GLSL_STRUCT_INLINE17 _GLSL_STRUCT_CONSTEXPR20 bool glslstruct::is_of_type ( const base_type_handle & type)
nodiscard

requests is_of_type visitor to visit base_type

◆ is_of_type() [2/4]

_GLSL_STRUCT_EXPORT bool glslstruct::is_of_type ( const base_type_handle & type,
BaseType baseType )
nodiscard

requests is_of_type visitor to visit base_type

Parameters
typebase_type handle
baseTypetype which is required

◆ is_of_type() [3/4]

template<glsl_type T>
_GLSL_STRUCT_INLINE17 _GLSL_STRUCT_CONSTEXPR20 bool glslstruct::is_of_type ( const std::shared_ptr< T > & )
nodiscard

requests is_of_type visitor to visit any glsl type

◆ is_of_type() [4/4]

template<glsl_type T>
_GLSL_STRUCT_INLINE17 _GLSL_STRUCT_CONSTEXPR20 bool glslstruct::is_of_type ( const std::shared_ptr< T > & ,
const BaseType baseType )
nodiscard

requests is_of_type visitor to visit any glsl type

Parameters
baseTypetype which is required

◆ static_type_cast() [1/2]

template<glsl_type T>
_GLSL_STRUCT_INLINE17 _GLSL_STRUCT_CONSTEXPR20 std::shared_ptr< T > glslstruct::static_type_cast ( const base_type_handle & type)
nodiscard

checks if base_type is of given type and returns handle to this type or error if it is not

◆ static_type_cast() [2/2]

template<glsl_type T>
base_type_handle glslstruct::static_type_cast ( const std::shared_ptr< T > & type)
inlinenodiscard

converts any glsl type handle to base_type handle

Variable Documentation

◆ is_type_visitor_v

template<class T>
_GLSL_STRUCT_CONSTEXPR17 bool glslstruct::is_type_visitor_v = type_visitor<T>
static

bool which is true if type T is type visitor

Template Parameters
Ttype to check if it is type visitor