GLSL Struct 1.4.0
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

template<utils::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<utils::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
bool glslstruct::is_of_type (const base_type_handle &type, BaseType baseType)
 requests is_of_type visitor to visit base_type
template<utils::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<utils::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<utils::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<utils::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<utils::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 visit(const scalar_type&);
void visit(const vec_type&);
void visit(const mat_type&);
void visit(const struct_type&);
void visit(const array_type&);
};

Function Documentation

◆ dynamic_type_cast() [1/2]

template<utils::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<utils::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

◆ is_of_type() [1/4]

template<utils::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]

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<utils::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<utils::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<utils::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<utils::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