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

array type container More...

#include <array_type.hpp>

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

Public Member Functions

 array_type (ValueType type, size_t scalarSize, size_t count, size_t size) noexcept
 constructs scalar array type
 array_type (ValueType type, size_t length, size_t vecSize, size_t count, size_t size) noexcept
 constructs vec array type
 array_type (ValueType type, size_t cols, size_t rows, size_t matSize, size_t count, size_t size) noexcept
 constructs mat array type
 array_type (const mstd::ordered_map< std::string, var_data > &values, size_t structSize, size_t count, size_t size) noexcept
 constructs struct array type
 array_type (const base_type_handle &type, size_t count, size_t size) noexcept
 constructs array with given elem type
template<utils::glsl_type T>
_GLSL_STRUCT_CONSTEXPR20 array_type (const std::shared_ptr< T > &type, const size_t count, const size_t size) noexcept
 constructs array with given elem type
 array_type (const array_type &other) noexcept
 default copy constructor
 array_type (array_type &&other) noexcept
 default move constructor
 ~array_type () noexcept override
 default destructor
array_typeoperator= (const array_type &other) noexcept
 default copy assign operator
array_typeoperator= (array_type &&other) noexcept
 default move assign operator
template<type_visitor T>
void accept (T &visitor) const
 accept function for type visitors
const base_type_handleget_type () const noexcept
 returns array elem type
size_t get_count () const noexcept
 returns array elems count
std::string to_string () const noexcept override
 converts type to string
Public Member Functions inherited from glslstruct::type< array_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

base_type_handle _type = nullptr
 handle to array elem type
size_t _count = 0
 count of array elements

Friends

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

Additional Inherited Members

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

array type container

Member Typedef Documentation

◆ base_type

Constructor & Destructor Documentation

◆ array_type() [1/8]

array_type::array_type ( ValueType type,
size_t scalarSize,
size_t count,
size_t size )
noexcept

constructs scalar array type

◆ array_type() [2/8]

array_type::array_type ( ValueType type,
size_t length,
size_t vecSize,
size_t count,
size_t size )
noexcept

constructs vec array type

◆ array_type() [3/8]

array_type::array_type ( ValueType type,
size_t cols,
size_t rows,
size_t matSize,
size_t count,
size_t size )
noexcept

constructs mat array type

◆ array_type() [4/8]

array_type::array_type ( const mstd::ordered_map< std::string, var_data > & values,
size_t structSize,
size_t count,
size_t size )
noexcept

constructs struct array type

◆ array_type() [5/8]

array_type::array_type ( const base_type_handle & type,
size_t count,
size_t size )
noexcept

constructs array with given elem type

◆ array_type() [6/8]

template<utils::glsl_type T>
_GLSL_STRUCT_CONSTEXPR20 glslstruct::array_type::array_type ( const std::shared_ptr< T > & type,
const size_t count,
const size_t size )
inlinenoexcept

constructs array with given elem type

◆ array_type() [7/8]

array_type::array_type ( const array_type & other)
defaultnoexcept

default copy constructor

◆ array_type() [8/8]

array_type::array_type ( array_type && other)
defaultnoexcept

default move constructor

◆ ~array_type()

array_type::~array_type ( )
overridedefaultnoexcept

default destructor

Member Function Documentation

◆ accept()

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

accept function for type visitors

◆ get_count()

size_t array_type::get_count ( ) const
nodiscardnoexcept

returns array elems count

◆ get_type()

const base_type_handle & array_type::get_type ( ) const
nodiscardnoexcept

returns array elem type

◆ operator=() [1/2]

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

default move assign operator

◆ operator=() [2/2]

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

default copy assign operator

◆ to_string()

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

converts type to string

Implements glslstruct::base_type.

◆ operator!=

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

checks if two array types are not equal

◆ operator==

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

checks if two array types are equal

◆ std::hash< array_type >

friend struct std::hash< array_type >
friend

Member Data Documentation

◆ _count

size_t glslstruct::array_type::_count = 0
private

count of array elements

◆ _type

base_type_handle glslstruct::array_type::_type = nullptr
private

handle to array elem type