GLSL Struct 1.4.0
glslstruct
Loading...
Searching...
No Matches
glslstruct::vec_type Class Reference

vec type container More...

#include <vec_type.hpp>

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

Public Member Functions

 vec_type (ValueType type, size_t length, size_t size) noexcept
 constructor with scalar type and length of vec and size of type
 vec_type (const vec_type &other) noexcept
 default copy constructor
 vec_type (vec_type &&other) noexcept
 default move constructor
 ~vec_type () noexcept override
 default destructor
vec_typeoperator= (const vec_type &other) noexcept
 default copy assign operator
vec_typeoperator= (vec_type &&other) noexcept
 default move assign operator
template<type_visitor T>
void accept (T &visitor) const
 accept function for type visitors
ValueType get_type () const noexcept
 returns scalar type of vec
size_t get_length () const noexcept
 returns length of vec
std::string to_string () const noexcept override
 converts type to string
Public Member Functions inherited from glslstruct::type< vec_type >
bool operator!= (const base_type &other) const noexcept
 default not equal operator
_GLSL_STRUCT_CONSTEXPR20 type (const size_t size) noexcept
 constructor with type size
virtual _GLSL_STRUCT_CONSTEXPR20 ~type () noexcept override=default
 default destructor
_GLSL_STRUCT_CONSTEXPR17 typeoperator= (const type &other) noexcept=default
 default copy assign operator
void accept (T &visitor) const
 accept function for type visitors
bool operator== (const base_type &other) const noexcept override
 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

Private Types

using base_type = type

Private Attributes

size_t _length
 length of vec
ValueType _type
 scalar type of vec

Friends

struct std::hash< vec_type >
bool operator== (const vec_type &lhs, const vec_type &rhs)
 checks if two vec types are equal
bool operator!= (const vec_type &lhs, const vec_type &rhs)
 checks if two vec types are not equal

Additional Inherited Members

Protected Member Functions inherited from glslstruct::type< vec_type >
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

Detailed Description

vec type container

Member Typedef Documentation

◆ base_type

Constructor & Destructor Documentation

◆ vec_type() [1/3]

vec_type::vec_type ( ValueType type,
size_t length,
size_t size )
noexcept

constructor with scalar type and length of vec and size of type

◆ vec_type() [2/3]

vec_type::vec_type ( const vec_type & other)
defaultnoexcept

default copy constructor

◆ vec_type() [3/3]

vec_type::vec_type ( vec_type && other)
defaultnoexcept

default move constructor

◆ ~vec_type()

vec_type::~vec_type ( )
overridedefaultnoexcept

default destructor

Member Function Documentation

◆ accept()

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

accept function for type visitors

◆ get_length()

size_t vec_type::get_length ( ) const
nodiscardnoexcept

returns length of vec

◆ get_type()

ValueType vec_type::get_type ( ) const
nodiscardnoexcept

returns scalar type of vec

◆ operator=() [1/2]

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

default copy assign operator

◆ operator=() [2/2]

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

default move assign operator

◆ to_string()

std::string vec_type::to_string ( ) const
nodiscardoverridevirtualnoexcept

converts type to string

Implements glslstruct::base_type.

◆ operator!=

bool operator!= ( const vec_type & lhs,
const vec_type & rhs )
friend

checks if two vec types are not equal

◆ operator==

bool operator== ( const vec_type & lhs,
const vec_type & rhs )
friend

checks if two vec types are equal

◆ std::hash< vec_type >

friend struct std::hash< vec_type >
friend

Member Data Documentation

◆ _length

size_t glslstruct::vec_type::_length
private

length of vec

◆ _type

ValueType glslstruct::vec_type::_type
private

scalar type of vec