GLSL Struct 1.4.0
glslstruct
Loading...
Searching...
No Matches
glslstruct::type< Derived > Class Template Reference

intermediate glsl type containers More...

#include <type.hpp>

Inheritance diagram for glslstruct::type< Derived >:
[legend]
Collaboration diagram for glslstruct::type< Derived >:
[legend]

Public Member Functions

_GLSL_STRUCT_CONSTEXPR20 type (const size_t size) noexcept
 constructor with type size
_GLSL_STRUCT_CONSTEXPR20 type (const type &other) noexcept=default
 default copy constructor
_GLSL_STRUCT_CONSTEXPR20 type (type &&other) noexcept=default
 default move constructor
virtual _GLSL_STRUCT_CONSTEXPR20 ~type () noexcept override=default
 default destructor
_GLSL_STRUCT_CONSTEXPR17 typeoperator= (const type &other) noexcept=default
 default copy assign operator
_GLSL_STRUCT_CONSTEXPR17 typeoperator= (type &&other) noexcept=default
 default move assign operator
template<type_visitor T>
void accept (T &visitor) const
 accept function for type visitors
bool operator== (const base_type &other) const noexcept override
 equal operator
bool operator!= (const base_type &other) const noexcept
 default not equal operator
Public Member Functions inherited from glslstruct::base_type
 base_type (size_t size) noexcept
 constructor with type size
 base_type (const base_type &other) noexcept
 default copy constructor
 base_type (base_type &&other) noexcept
 default move constructor
virtual ~base_type () noexcept
 default virtual destructor
base_typeoperator= (const base_type &other) noexcept
 default copy assignment operator
base_typeoperator= (base_type &&other) noexcept
 default move assignment operator
template<type_visitor T>
void accept (T &visitor) const
 accept function for type_visitors
bool operator!= (const base_type &other) const noexcept
 default not equal operator
size_t get_size () const noexcept
 returns size of type
virtual std::string to_string () const noexcept=0
 converts type to string

Protected Member Functions

void _accept (const mstd::function_view< void(const scalar_type &)> scalarVisit, const mstd::function_view< void(const vec_type &)> vecVisit, const mstd::function_view< void(const mat_type &)> matVisit, const mstd::function_view< void(const struct_type &)> structVisit, const mstd::function_view< void(const array_type &)> arrayVisit) const override
 accept function overload
Protected Member Functions inherited from glslstruct::base_type
virtual void _accept (mstd::function_view< void(const scalar_type &)> scalarVisit, mstd::function_view< void(const vec_type &)> vecVisit, mstd::function_view< void(const mat_type &)> matVisit, mstd::function_view< void(const struct_type &)> structVisit, mstd::function_view< void(const array_type &)> arrayVisit) const =0
 accept function for type visitors

Private Member Functions

_GLSL_STRUCT_CONSTEXPR17 const Derived & _get_derived () const noexcept
 standard cast from this to derived type

Friends

template<class DerivedA, class DerivedB>
_GLSL_STRUCT_CONSTEXPR17 bool operator== (const type< DerivedA > &lhs, const type< DerivedB > &rhs)
 equal operator for two intermediate types
template<class DerivedA, class DerivedB>
_GLSL_STRUCT_CONSTEXPR17 bool operator!= (const type< DerivedA > &lhs, const type< DerivedB > &rhs)
 not equal operator for two intermediate types
template<utils::glsl_type T>
_GLSL_STRUCT_CONSTEXPR20 bool operator!= (const base_type &lhs, const T &rhs)
 checks if types are not equal

Detailed Description

template<class Derived>
class glslstruct::type< Derived >

intermediate glsl type containers

Template Parameters
Derivedderived type

Constructor & Destructor Documentation

◆ type() [1/3]

template<class Derived>
_GLSL_STRUCT_CONSTEXPR20 glslstruct::type< Derived >::type ( const size_t size)
inlineexplicitnoexcept

constructor with type size

◆ type() [2/3]

template<class Derived>
_GLSL_STRUCT_CONSTEXPR20 glslstruct::type< Derived >::type ( const type< Derived > & other)
defaultnoexcept

default copy constructor

◆ type() [3/3]

template<class Derived>
_GLSL_STRUCT_CONSTEXPR20 glslstruct::type< Derived >::type ( type< Derived > && other)
defaultnoexcept

default move constructor

◆ ~type()

template<class Derived>
virtual _GLSL_STRUCT_CONSTEXPR20 glslstruct::type< Derived >::~type ( )
overridevirtualdefaultnoexcept

default destructor

Member Function Documentation

◆ _accept()

template<class Derived>
void glslstruct::type< Derived >::_accept ( const mstd::function_view< void(const scalar_type< Derived > &)> scalarVisit,
const mstd::function_view< void(const vec_type< Derived > &)> vecVisit,
const mstd::function_view< void(const mat_type< Derived > &)> matVisit,
const mstd::function_view< void(const struct_type< Derived > &)> structVisit,
const mstd::function_view< void(const array_type< Derived > &)> arrayVisit ) const
inlineoverrideprotected

accept function overload

◆ _get_derived()

template<class Derived>
_GLSL_STRUCT_CONSTEXPR17 const Derived & glslstruct::type< Derived >::_get_derived ( ) const
inlineprivatenoexcept

standard cast from this to derived type

◆ accept()

template<class Derived>
template<type_visitor T>
void glslstruct::type< Derived >::accept ( T & visitor) const
inline

accept function for type visitors

◆ operator!=()

template<class Derived>
bool base_type::operator!= ( const base_type< Derived > & other) const
nodiscarddefaultnoexcept

default not equal operator

◆ operator=() [1/2]

template<class Derived>
_GLSL_STRUCT_CONSTEXPR17 type & glslstruct::type< Derived >::operator= ( const type< Derived > & other)
defaultnoexcept

default copy assign operator

◆ operator=() [2/2]

template<class Derived>
_GLSL_STRUCT_CONSTEXPR17 type & glslstruct::type< Derived >::operator= ( type< Derived > && other)
defaultnoexcept

default move assign operator

◆ operator==()

template<class Derived>
bool glslstruct::type< Derived >::operator== ( const base_type< Derived > & other) const
inlinenodiscardoverridevirtualnoexcept

equal operator

Reimplemented from glslstruct::base_type.

◆ operator!= [1/2]

template<class Derived>
template<utils::glsl_type T>
_GLSL_STRUCT_CONSTEXPR20 bool operator!= ( const base_type< Derived > & lhs,
const T & rhs )
friend

checks if types are not equal

◆ operator!= [2/2]

template<class Derived>
template<class DerivedA, class DerivedB>
_GLSL_STRUCT_CONSTEXPR17 bool operator!= ( const type< DerivedA > & lhs,
const type< DerivedB > & rhs )
friend

not equal operator for two intermediate types

◆ operator==

template<class Derived>
template<class DerivedA, class DerivedB>
_GLSL_STRUCT_CONSTEXPR17 bool operator== ( const type< DerivedA > & lhs,
const type< DerivedB > & rhs )
friend

equal operator for two intermediate types