GLSL Struct 1.4.0
glslstruct
Loading...
Searching...
No Matches
glslstruct::base_type Class Referenceabstract

base class for all glsl type containers More...

#include <base_type.hpp>

Inheritance diagram for glslstruct::base_type:
[legend]
Collaboration diagram for glslstruct::base_type:
[legend]

Public Member Functions

 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
virtual bool operator== (const base_type &other) const noexcept
 virtual equality operator
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

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 Attributes

size_t _size
 size value of type

Friends

struct std::hash< base_type >
template<utils::glsl_type T>
_GLSL_STRUCT_CONSTEXPR20 bool operator== (const base_type &lhs, const T &rhs)
 checks if types are equal
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

base class for all glsl type containers

Constructor & Destructor Documentation

◆ base_type() [1/3]

base_type::base_type ( size_t size)
explicitnoexcept

constructor with type size

◆ base_type() [2/3]

base_type::base_type ( const base_type & other)
defaultnoexcept

default copy constructor

◆ base_type() [3/3]

base_type::base_type ( base_type && other)
defaultnoexcept

default move constructor

◆ ~base_type()

base_type::~base_type ( )
virtualdefaultnoexcept

default virtual destructor

Member Function Documentation

◆ _accept()

virtual void glslstruct::base_type::_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
protectedpure virtual

accept function for type visitors

◆ accept()

template<type_visitor T>
void glslstruct::base_type::accept ( T & visitor) const
inline

accept function for type_visitors

◆ get_size()

size_t base_type::get_size ( ) const
nodiscardnoexcept

returns size of type

◆ operator!=()

bool base_type::operator!= ( const base_type & other) const
nodiscarddefaultnoexcept

default not equal operator

◆ operator=() [1/2]

base_type & base_type::operator= ( base_type && other)
defaultnoexcept

default move assignment operator

◆ operator=() [2/2]

base_type & base_type::operator= ( const base_type & other)
defaultnoexcept

default copy assignment operator

◆ operator==()

bool base_type::operator== ( const base_type & other) const
nodiscardvirtualnoexcept

◆ to_string()

virtual std::string glslstruct::base_type::to_string ( ) const
nodiscardpure virtualnoexcept

◆ operator!=

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

checks if types are not equal

◆ operator==

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

checks if types are equal

◆ std::hash< base_type >

friend struct std::hash< base_type >
friend

Member Data Documentation

◆ _size

size_t glslstruct::base_type::_size
private

size value of type