GLSL Struct 1.4.0
glslstruct
Loading...
Searching...
No Matches
glslstruct::base_struct< Layout > Class Template Reference

base class for glsl struct representation More...

#include <base_struct.hpp>

Inheritance diagram for glslstruct::base_struct< Layout >:
[legend]
Collaboration diagram for glslstruct::base_struct< Layout >:
[legend]

Classes

struct  is_glsl_simple_or_layout_struct
 check if type is simple glsl type or struct with given layout More...

Public Types

using layout_type = Layout
 struct layout type

Public Member Functions

template<class T = layout_type, std::enable_if_t< std::is_same_v< T, layout_type > &&std::is_default_constructible_v< layout_type >, bool > = true>
_GLSL_STRUCT_CONSTEXPR20 base_struct () noexcept _GLSL_STRUCT_REQUIRES(std
 default constructor
template<class T = layout_type, std::enable_if_t< std::is_same_v< T, layout_type > &&layout_type::has_context, bool > = true>
_GLSL_STRUCT_CONSTEXPR20 base_struct (const _GLSL_STRUCT_TYPENAME17 layout_type::context_type &ctx) noexcept _GLSL_STRUCT_REQUIRES(layout_type
 constructor with context
_GLSL_STRUCT_CONSTEXPR20 base_struct (const layout_type &layout) noexcept
 constructor with layout
_GLSL_STRUCT_CONSTEXPR20 base_struct (const layout_type &layout, const std::vector< std::byte > &data) noexcept
 constructor with layout and data
template<utils::glsl_simple_or_layout_struct< layout_type >... Args, size_t... Nums, std::enable_if_t< std::is_default_constructible_v< layout_type >, bool > = true>
_GLSL_STRUCT_CONSTEXPR20 base_struct (const glsl_value< Args, Nums > &... values) noexcept _GLSL_STRUCT_REQUIRES(std
 constructor with multiple values
template<utils::glsl_simple_or_layout_struct< layout_type >... Args, size_t... Nums, std::enable_if_t< layout_type::has_context, bool > = true>
_GLSL_STRUCT_CONSTEXPR20 base_struct (const glsl_value< Args, Nums > &... values, const _GLSL_STRUCT_TYPENAME17 layout_type::context_type &ctx) noexcept _GLSL_STRUCT_REQUIRES(layout_type
 constructor with multiple values and context
_GLSL_STRUCT_CONSTEXPR20 base_struct (const base_struct &other) noexcept=default
 default copy constructor
_GLSL_STRUCT_CONSTEXPR20 base_struct (base_struct &&other) noexcept
 move constructor
_GLSL_STRUCT_CONSTEXPR20 ~base_struct () noexcept=default
 default destructor
_GLSL_STRUCT_CONSTEXPR20 base_structoperator= (const base_struct &other) noexcept=default
 default copy assign operator
_GLSL_STRUCT_CONSTEXPR20 base_structoperator= (base_struct &&other) noexcept
 move assign operator
template<utils::glsl_scalar S>
_GLSL_STRUCT_CONSTEXPR20 size_t add (const std::string_view name) _GLSL_STRUCT_REQUIRES(std
 adds scalar with default value and returns offset
template<utils::glsl_scalar S>
_GLSL_STRUCT_CONSTEXPR20 size_t add (const std::string_view name, const S &value)
 adds scalar and returns offset
template<utils::glsl_scalar S>
_GLSL_STRUCT_CONSTEXPR20 std::vector< size_t > add (const std::string_view name, const S *values, const size_t valuesCount)
 adds array of scalars with pointer to values and size
template<utils::glsl_scalars_array SA>
_GLSL_STRUCT_CONSTEXPR20 std::vector< size_t > add (const std::string_view name, const size_t count) _GLSL_STRUCT_REQUIRES(std
 adds array of scalars
template<utils::glsl_scalars_static_size_array SA>
_GLSL_STRUCT_CONSTEXPR20 std::vector< size_t > add (const std::string_view name) _GLSL_STRUCT_REQUIRES(std
 adds array of scalars
template<utils::glsl_scalars_array SA>
_GLSL_STRUCT_CONSTEXPR20 std::vector< size_t > add (const std::string_view name, const SA &values)
 adds array of scalars
template<utils::glsl_vec V>
_GLSL_STRUCT_CONSTEXPR17 size_t add (const std::string_view name) _GLSL_STRUCT_REQUIRES(std
 adds default vec and returns offset
template<utils::glsl_vec V>
_GLSL_STRUCT_CONSTEXPR17 size_t add (const std::string_view name, const V &value)
 adds vec and returns offset
template<utils::glsl_vec V>
_GLSL_STRUCT_CONSTEXPR20 std::vector< size_t > add (const std::string_view name, const V *values, const size_t valuesCount)
 adds array of vecs using pointer to values and size
template<utils::glsl_vecs_array VA>
_GLSL_STRUCT_CONSTEXPR20 std::vector< size_t > add (const std::string_view name, const size_t count) _GLSL_STRUCT_REQUIRES(std
 adds array of default vecs
template<utils::glsl_vecs_static_size_array VA>
_GLSL_STRUCT_CONSTEXPR20 std::vector< size_t > add (const std::string_view name) _GLSL_STRUCT_REQUIRES(std
 adds array of default vecs
template<utils::glsl_vecs_array VA>
_GLSL_STRUCT_CONSTEXPR20 std::vector< size_t > add (const std::string_view name, const VA &values)
 adds array of vecs
template<utils::glsl_mat M>
_GLSL_STRUCT_CONSTEXPR20 size_t add (const std::string_view name) _GLSL_STRUCT_REQUIRES(std
 adds default mat and returns offset
template<utils::glsl_mat M>
_GLSL_STRUCT_CONSTEXPR20 size_t add (const std::string_view name, const M &value)
 adds mat and returns offset
template<utils::glsl_mat M>
_GLSL_STRUCT_CONSTEXPR20 std::vector< size_t > add (const std::string_view name, const M *values, const size_t valuesCount)
 adds array of mats with pointer to values and size
template<utils::glsl_mats_array MA>
_GLSL_STRUCT_CONSTEXPR20 std::vector< size_t > add (const std::string_view name, const size_t count) _GLSL_STRUCT_REQUIRES(std
 adds array of default mats
template<utils::glsl_mats_static_size_array MA>
_GLSL_STRUCT_CONSTEXPR20 std::vector< size_t > add (const std::string_view name) _GLSL_STRUCT_REQUIRES(std
 adds array of default mats
template<utils::glsl_mats_array MA>
_GLSL_STRUCT_CONSTEXPR20 std::vector< size_t > add (const std::string_view name, const MA &values)
 adds array of mats
_GLSL_STRUCT_CONSTEXPR17 size_t add (const std::string_view name, const base_struct &value)
 adds struct
_GLSL_STRUCT_CONSTEXPR20 size_t add (const std::string_view name, const layout_type &layout)
 adds struct based on layout
_GLSL_STRUCT_CONSTEXPR20 size_t add (const std::string_view name, const layout_type &layout, const std::byte *data, const size_t bytesCount)
 adds struct based on layout and pointer to data in bytes
template<class BA, std::enable_if_t< utils::is_array_of_v< std::is_same, BA, std::byte >, bool > = true>
_GLSL_STRUCT_CONSTEXPR20 size_t add (const std::string_view name, const layout_type &layout, const BA &data)
 adds struct based on layout and array of data in bytes
_GLSL_STRUCT_CONSTEXPR20 std::vector< size_t > add (const std::string_view name, const layout_type &layout, const std::vector< std::byte > *values, const size_t valuesCount)
 adds array of structs based on layout and pointer to data in bytes
_GLSL_STRUCT_CONSTEXPR20 std::vector< size_t > add (const std::string_view name, const layout_type &layout, const size_t count)
 adds array of structs based on layout and array of data in bytes
template<class SBA, std::enable_if_t< utils::is_array_of_v< std::is_same, SBA, std::vector< std::byte > >, bool > = true>
_GLSL_STRUCT_CONSTEXPR20 std::vector< size_t > add (const std::string_view name, const layout_type &layout, const SBA &values)
 adds array of structs based on layout and array of data in bytes
template<utils::glsl_scalar S>
_GLSL_STRUCT_CONSTEXPR20 bool set (const std::string_view name) _GLSL_STRUCT_REQUIRES(std
 sets default scalar value
template<utils::glsl_scalar S>
_GLSL_STRUCT_CONSTEXPR20 bool set (const std::string_view name, const S &value)
 sets scalar value
template<utils::glsl_scalar S>
_GLSL_STRUCT_CONSTEXPR20 bool set (const std::string_view name, const S *values, const size_t valuesCount)
 sets scalar array value using pointer to values
template<utils::glsl_scalars_array SA>
_GLSL_STRUCT_CONSTEXPR20 bool set (const std::string_view name, const size_t count) _GLSL_STRUCT_REQUIRES(std
 sets scalar array value with array of default values
template<utils::glsl_scalars_static_size_array SA>
_GLSL_STRUCT_CONSTEXPR20 bool set (const std::string_view name) _GLSL_STRUCT_REQUIRES(std
 sets scalar array value with array of default values
template<utils::glsl_scalars_array SA>
_GLSL_STRUCT_CONSTEXPR20 bool set (const std::string_view name, const SA &values)
 sets scalar array value with array of values
template<utils::glsl_vec V>
_GLSL_STRUCT_CONSTEXPR17 bool set (const std::string_view name) _GLSL_STRUCT_REQUIRES(std
 sets vec default value
template<utils::glsl_vec V>
_GLSL_STRUCT_CONSTEXPR17 bool set (const std::string_view name, const V &value)
 sets vec value
template<utils::glsl_vec V>
_GLSL_STRUCT_CONSTEXPR20 bool set (const std::string_view name, const V *values, const size_t size)
 sets vec array value using pointer to values
template<utils::glsl_vecs_array VA>
_GLSL_STRUCT_CONSTEXPR20 bool set (const std::string_view name, const size_t count) _GLSL_STRUCT_REQUIRES(std
 sets vec array value with array of default values
template<utils::glsl_vecs_static_size_array VA>
_GLSL_STRUCT_CONSTEXPR20 bool set (const std::string_view name) _GLSL_STRUCT_REQUIRES(std
 sets vec array value with array of default values
template<utils::glsl_vecs_array VA>
_GLSL_STRUCT_CONSTEXPR20 bool set (const std::string_view name, const VA &values)
 sets vec array value with array of values
template<utils::glsl_mat M>
_GLSL_STRUCT_CONSTEXPR20 bool set (const std::string_view name) _GLSL_STRUCT_REQUIRES(std
 sets default mat value
template<utils::glsl_mat M>
_GLSL_STRUCT_CONSTEXPR20 bool set (const std::string_view name, const M &value)
 sets mat value
template<utils::glsl_mat M>
_GLSL_STRUCT_CONSTEXPR20 bool set (const std::string_view name, const M *values, const size_t valuesCount)
 sets mat array value using pointer to values
template<utils::glsl_mats_array MA>
_GLSL_STRUCT_CONSTEXPR20 bool set (const std::string_view name, const size_t count) _GLSL_STRUCT_REQUIRES(std
 sets mat array value with array of default values
template<utils::glsl_mats_static_size_array MA>
_GLSL_STRUCT_CONSTEXPR20 bool set (const std::string_view name) _GLSL_STRUCT_REQUIRES(std
 sets mat array value with array of default values
template<utils::glsl_mats_array MA>
_GLSL_STRUCT_CONSTEXPR20 bool set (const std::string_view name, const MA &values)
 sets mat array value with array of values
_GLSL_STRUCT_CONSTEXPR17 bool set (const std::string_view name, const base_struct &value)
 sets struct value
_GLSL_STRUCT_CONSTEXPR20 bool set (const std::string_view name, const layout_type &layout)
 sets empty struct
_GLSL_STRUCT_CONSTEXPR17 bool set (const std::string_view name, const layout_type &layout, const std::byte *data, const size_t bytesCount)
 sets struct value using pointer to data
template<class BA, std::enable_if_t< utils::is_array_of_v< std::is_same, BA, std::byte >, bool > = true>
_GLSL_STRUCT_CONSTEXPR17 bool set (const std::string_view name, const layout_type &layout, const BA &data)
 sets struct value using array of data bytes
_GLSL_STRUCT_CONSTEXPR20 bool set (const std::string_view name, const layout_type &layout, const std::vector< std::byte > *datas, const size_t datasCount)
 sets mat array value with pointer to values
template<class SBA, std::enable_if_t< utils::is_array_of_v< std::is_same, SBA, std::vector< std::byte > >, bool > = true>
_GLSL_STRUCT_CONSTEXPR20 bool set (const std::string_view name, const layout_type &layout, const size_t count)
 sets mat array value using array of datas
template<class SBA, std::enable_if_t< utils::is_array_of_v< std::is_same, SBA, std::vector< std::byte > >, bool > = true>
_GLSL_STRUCT_CONSTEXPR20 bool set (const std::string_view name, const layout_type &layout, const SBA &datas)
 sets mat array value using array of datas
template<utils::glsl_scalar T>
_GLSL_STRUCT_CONSTEXPR17get (const std::string_view name) const
 gets scalar value
template<utils::glsl_scalar T>
_GLSL_STRUCT_CONSTEXPR20 void get (const std::string_view name, const T *valuesDest, const size_t valuesDestCount) const
 copies scalars array value to provided pointer
template<utils::glsl_scalars_array SA>
_GLSL_STRUCT_CONSTEXPR20 std::vector< utils::array_value_type_t< SA > > get (const std::string_view name) const
 gets scalars array value as std::vector
template<utils::glsl_vec V>
_GLSL_STRUCT_CONSTEXPR17get (const std::string_view name) const
 gets vec value
template<utils::glsl_vec V>
_GLSL_STRUCT_CONSTEXPR20 void get (const std::string_view name, const V *valuesDest, const size_t valuesDestCount) const
 copies vecs array value to provided pointer
template<utils::glsl_vecs_array VA>
_GLSL_STRUCT_CONSTEXPR20 std::vector< utils::array_value_type_t< VA > > get (const std::string_view name) const
 gets vecs array value as std::vector
template<utils::glsl_mat M>
_GLSL_STRUCT_CONSTEXPR20get (const std::string_view name) const
 gets mat value
template<utils::glsl_mat M>
_GLSL_STRUCT_CONSTEXPR20 void get (const std::string_view name, const M *valuesDest, const size_t valuesDestCount) const
 copies mats array value to provided pointer
template<utils::glsl_mats_array MA>
_GLSL_STRUCT_CONSTEXPR20 std::vector< utils::array_value_type_t< MA > > get (const std::string_view name) const
 gets mats array value as std::vector
template<utils::glsl_layout_struct< layout_type > S>
_GLSL_STRUCT_CONSTEXPR17 base_struct get (const std::string_view name, const layout_type &layout) const
 gets struct value
_GLSL_STRUCT_CONSTEXPR20 void get (const std::string_view name, const layout_type &layout, const base_struct *valuesDest, const size_t valuesDestCount) const
 copies struct array value to provided pointer
template<utils::glsl_layout_structs_array< layout_type > LSA>
_GLSL_STRUCT_CONSTEXPR20 std::vector< utils::array_value_type_t< LSA > > get (const std::string_view name, const layout_type &layout) const
 gets struct array value as std::vector
_GLSL_STRUCT_CONSTEXPR17 const layout_typeget_layout () const noexcept
 returns struct layout
_GLSL_STRUCT_CONSTEXPR17 bool contains (const std::string_view name) const
 returns true if struct contains variable with given name
_GLSL_STRUCT_CONSTEXPR17 size_t get_offset (const std::string_view name) const
 returns offset of variable
_GLSL_STRUCT_CONSTEXPR20 std::vector< size_t > get_array_offsets (const std::string_view name) const
 returns offsets of elements of array
_GLSL_STRUCT_CONSTEXPR20 const base_type_handleget_type (const std::string_view name) const
 returns type of variable
template<utils::glsl_type T>
_GLSL_STRUCT_CONSTEXPR17 std::shared_ptr< T > get_type (const std::string_view name) const
 returns type of variable casted to desired type (using dynamic_type_cast)
_GLSL_STRUCT_CONSTEXPR17 size_t get_total_size (const std::string_view name) const noexcept
 returns total size of variable (size + padding)
_GLSL_STRUCT_CONSTEXPR17 size_t get_size (const std::string_view name) const noexcept
 returns size of variable
_GLSL_STRUCT_CONSTEXPR17 size_t get_padding (const std::string_view name) const noexcept
 returns variable padding
_GLSL_STRUCT_CONSTEXPR20 std::vector< std::string > get_names () const
 returns names of all variables
_GLSL_STRUCT_CONSTEXPR20 const std::unordered_map< std::string, var_data > & get_variables () const noexcept
 returns all variables and their data
mstd::ordered_map< std::string, var_dataget_top_level_variables () noexcept
 returns all top level variables and their data
_GLSL_STRUCT_CONSTEXPR17 const std::vector< std::byte > & data () const noexcept
 returns struct data in bytes
_GLSL_STRUCT_CONSTEXPR17 size_t base_alignment () const noexcept
 returns base alignment of struct
_GLSL_STRUCT_CONSTEXPR17 size_t size () const noexcept
 returns size of struct data
_GLSL_STRUCT_CONSTEXPR17 size_t padding () const noexcept
 returns struct padding
_GLSL_STRUCT_CONSTEXPR17 void clear_data () noexcept
 resets data to all zeros
_GLSL_STRUCT_CONSTEXPR17 void clear () noexcept
 clears layout and data
_GLSL_STRUCT_CONSTEXPR17 bool operator== (const base_struct &other) const
 checks if two structs are equal
_GLSL_STRUCT_CONSTEXPR17 bool operator!= (const base_struct &other) const =default
 default not equal operator

Static Public Member Functions

static _GLSL_STRUCT_CONSTEXPR17 size_t bad_offset () noexcept
 invalid offset value returned when there is error

Private Member Functions

bool _scalar_check (const std::string_view name, const ValueType type) const
bool _scalar_array_check (const std::string_view name, const ValueType type) const
bool _vec_check (const std::string_view name, const ValueType type, const size_t length) const
bool _vec_array_check (const std::string_view name, const ValueType type, const size_t length) const
bool _mat_check (const std::string_view name, const ValueType type, const size_t columns, const size_t rows) const
bool _mat_array_check (const std::string_view name, const ValueType type, const size_t columns, const size_t rows) const
bool _struct_check (const std::string_view name, const mstd::ordered_map< std::string, var_data > &variables) const
bool _struct_array_check (const std::string_view name, const mstd::ordered_map< std::string, var_data > &variables) const
_GLSL_STRUCT_CONSTEXPR17 size_t _add (const size_t valueOffset, const std::byte *valueData, const size_t dataSize)
 adds value data to given offset
_GLSL_STRUCT_CONSTEXPR20 std::vector< size_t > _add_array (const std::vector< size_t > &valuesOffsets, const std::vector< std::byte > *valuesData)
 adds array values to given offsets
template<class T>
_GLSL_STRUCT_CONSTEXPR20 size_t _add_scalar (const std::string_view name, const T &value)
 adds scalar
template<class T>
_GLSL_STRUCT_CONSTEXPR20 std::vector< size_t > _add_scalar_array (const std::string_view name, const T *values, const size_t valuesCount)
 adds scalars array
template<class V>
_GLSL_STRUCT_CONSTEXPR20 size_t _add_vec (const std::string_view name, const V &value)
 adds vec
template<class V>
_GLSL_STRUCT_CONSTEXPR20 std::vector< size_t > _add_vec_array (const std::string_view name, const V *values, const size_t valuesCount)
 adds vecs array
template<class M>
_GLSL_STRUCT_CONSTEXPR20 size_t _add_mat (const std::string_view name, const M &value)
 adds mat
template<class M>
_GLSL_STRUCT_CONSTEXPR20 std::vector< size_t > _add_mat_array (const std::string_view name, const M *values, const size_t valuesCount)
 adds mats array
_GLSL_STRUCT_CONSTEXPR20 size_t _add_struct (const std::string_view name, const layout_type &layout, const std::byte *data, const size_t bytesCount)
 adds struct
_GLSL_STRUCT_CONSTEXPR20 std::vector< size_t > _add_struct_array (const std::string_view name, const layout_type &layout, const std::vector< std::byte > *datas, const size_t datasCount)
 adds structs array
template<class T, class... Ts, size_t Num, size_t... Nums>
_GLSL_STRUCT_CONSTEXPR17 void _add_values (const glsl_value< T, Num > &value, const glsl_value< Ts, Nums > &... values)
 adds multiple values
_GLSL_STRUCT_CONSTEXPR17 bool _set (const size_t valueOffset, const std::byte *valueData, const size_t dataSize)
 sets value data at given offset
_GLSL_STRUCT_CONSTEXPR20 bool _set_array (const std::vector< size_t > &valuesOffsets, const std::vector< std::byte > *valuesData, const size_t valuesCount)
 sets array values data at given offsets
template<class T>
_GLSL_STRUCT_CONSTEXPR20 bool _set_scalar (const std::string_view name, const T &value)
 sets scalar
template<class T>
_GLSL_STRUCT_CONSTEXPR20 bool _set_scalar_array (const std::string_view name, const T *values, const size_t valuesCount)
 sets scalar array
template<class V>
_GLSL_STRUCT_CONSTEXPR20 bool _set_vec (const std::string_view name, const V &value)
 sets vec
template<class V>
_GLSL_STRUCT_CONSTEXPR20 bool _set_vec_array (const std::string_view name, const V *values, const size_t valuesCount)
 sets vec array
template<class M>
_GLSL_STRUCT_CONSTEXPR20 bool _set_mat (const std::string_view name, const M &value)
 sets mat
template<class M>
_GLSL_STRUCT_CONSTEXPR20 bool _set_mat_array (const std::string_view name, const M *values, const size_t valuesCount)
 sets mat array
_GLSL_STRUCT_CONSTEXPR17 bool _set_struct (const std::string_view name, const layout_type &layout, const std::byte *data, const size_t bytesCount)
 sets struct
_GLSL_STRUCT_CONSTEXPR20 bool _set_struct_array (const std::string_view name, const layout_type &layout, const std::vector< std::byte > *values, const size_t valuesCount)
 sets struct array
_GLSL_STRUCT_CONSTEXPR20 std::vector< std::byte > _get (const size_t valueOffset, const size_t valueSize) const
 returns value data at given offset with given size
_GLSL_STRUCT_CONSTEXPR20 std::vector< std::vector< std::byte > > _get_array (const std::vector< size_t > &valuesOffsets, const size_t arrayElemSize, const size_t valueSize) const
 returns array values data at given offsets with given value size
template<class T>
_GLSL_STRUCT_CONSTEXPR17_get_scalar (const std::string_view name) const
 gets scalar value
template<class T>
_GLSL_STRUCT_CONSTEXPR20 std::vector< T > _get_scalar_array (const std::string_view name) const
 gets scalars array value
template<class V>
_GLSL_STRUCT_CONSTEXPR17_get_vec (const std::string_view name) const
 gets vec value
template<class V>
_GLSL_STRUCT_CONSTEXPR20 std::vector< V > _get_vec_array (const std::string_view name) const
 gets vec array value
template<class M>
_GLSL_STRUCT_CONSTEXPR17_get_mat (const std::string_view name) const
 gets mat value
template<class M>
_GLSL_STRUCT_CONSTEXPR20 std::vector< M > _get_mat_array (const std::string_view name) const
 gets mat array value
_GLSL_STRUCT_CONSTEXPR17 base_struct _get_struct (const std::string_view name, const layout_type &layout) const
 gets struct value
_GLSL_STRUCT_CONSTEXPR20 std::vector< base_struct_get_struct_array (const std::string_view name, const layout_type &layout) const
 gets struct array value

Static Private Member Functions

static bool _is_scalar (const base_type_handle &varType, const ValueType type)
static bool _is_vec (const base_type_handle &varType, const ValueType type, const size_t length)
static bool _is_mat (const base_type_handle &varType, const ValueType type, const size_t columns, const size_t rows)
static bool _is_struct (const base_type_handle &varType, const mstd::ordered_map< std::string, var_data > &variables)
static bool _is_array (const base_type_handle &varType)
template<class T>
static _GLSL_STRUCT_CONSTEXPR20 std::vector< std::byte > _get_scalar_value_data (const T &value)
 returns scalar data bytes
template<class T>
static _GLSL_STRUCT_CONSTEXPR20 std::vector< std::byte > _get_vec_value_data (const T &value)
 returns vec data bytes
template<class T>
static _GLSL_STRUCT_CONSTEXPR20 std::vector< std::vector< std::byte > > _get_mat_value_data (const T &value)
 returns mat data bytes
template<class T>
static _GLSL_STRUCT_CONSTEXPR20_get_scalar_value (const std::vector< std::byte > &data)
 returns scalar value from data bytes
template<class T>
static _GLSL_STRUCT_CONSTEXPR20_get_vec_value (const std::vector< std::byte > &data)
 returns vec value from data bytes
template<class T>
static _GLSL_STRUCT_CONSTEXPR20_get_mat_value (const std::vector< std::vector< std::byte > > &data)
 returns mat value from data bytes

Private Attributes

layout_type _layout
 struct layout
std::vector< std::byte > _data
 struct data

Friends

struct std::hash< base_struct >

Detailed Description

template<utils::glsl_layout Layout>
class glslstruct::base_struct< Layout >

base class for glsl struct representation

Template Parameters
Layoutstruct layout

Member Typedef Documentation

◆ layout_type

template<utils::glsl_layout Layout>
using glslstruct::base_struct< Layout >::layout_type = Layout

struct layout type

Constructor & Destructor Documentation

◆ base_struct() [1/8]

template<utils::glsl_layout Layout>
template<class T = layout_type, std::enable_if_t< std::is_same_v< T, layout_type > &&std::is_default_constructible_v< layout_type >, bool > = true>
_GLSL_STRUCT_CONSTEXPR20 glslstruct::base_struct< Layout >::base_struct ( )
inlinenoexcept

default constructor

◆ base_struct() [2/8]

template<utils::glsl_layout Layout>
template<class T = layout_type, std::enable_if_t< std::is_same_v< T, layout_type > &&layout_type::has_context, bool > = true>
_GLSL_STRUCT_CONSTEXPR20 glslstruct::base_struct< Layout >::base_struct ( const _GLSL_STRUCT_TYPENAME17 layout_type::context_type & ctx)
inlineexplicitnoexcept

constructor with context

◆ base_struct() [3/8]

template<utils::glsl_layout Layout>
_GLSL_STRUCT_CONSTEXPR20 glslstruct::base_struct< Layout >::base_struct ( const layout_type & layout)
inlineexplicitnoexcept

constructor with layout

◆ base_struct() [4/8]

template<utils::glsl_layout Layout>
_GLSL_STRUCT_CONSTEXPR20 glslstruct::base_struct< Layout >::base_struct ( const layout_type & layout,
const std::vector< std::byte > & data )
inlineexplicitnoexcept

constructor with layout and data

◆ base_struct() [5/8]

template<utils::glsl_layout Layout>
template<utils::glsl_simple_or_layout_struct< layout_type >... Args, size_t... Nums, std::enable_if_t< std::is_default_constructible_v< layout_type >, bool > = true>
_GLSL_STRUCT_CONSTEXPR20 glslstruct::base_struct< Layout >::base_struct ( const glsl_value< Args, Nums > &... values)
inlineexplicitnoexcept

constructor with multiple values

◆ base_struct() [6/8]

template<utils::glsl_layout Layout>
template<utils::glsl_simple_or_layout_struct< layout_type >... Args, size_t... Nums, std::enable_if_t< layout_type::has_context, bool > = true>
_GLSL_STRUCT_CONSTEXPR20 glslstruct::base_struct< Layout >::base_struct ( const glsl_value< Args, Nums > &... values,
const _GLSL_STRUCT_TYPENAME17 layout_type::context_type & ctx )
inlineexplicitnoexcept

constructor with multiple values and context

◆ base_struct() [7/8]

template<utils::glsl_layout Layout>
_GLSL_STRUCT_CONSTEXPR20 glslstruct::base_struct< Layout >::base_struct ( const base_struct< Layout > & other)
defaultnoexcept

default copy constructor

◆ base_struct() [8/8]

template<utils::glsl_layout Layout>
_GLSL_STRUCT_CONSTEXPR20 glslstruct::base_struct< Layout >::base_struct ( base_struct< Layout > && other)
inlinenoexcept

move constructor

◆ ~base_struct()

template<utils::glsl_layout Layout>
_GLSL_STRUCT_CONSTEXPR20 glslstruct::base_struct< Layout >::~base_struct ( )
defaultnoexcept

default destructor

Member Function Documentation

◆ _add()

template<utils::glsl_layout Layout>
_GLSL_STRUCT_CONSTEXPR17 size_t glslstruct::base_struct< Layout >::_add ( const size_t valueOffset,
const std::byte * valueData,
const size_t dataSize )
inlinenodiscardprivate

adds value data to given offset

◆ _add_array()

template<utils::glsl_layout Layout>
_GLSL_STRUCT_CONSTEXPR20 std::vector< size_t > glslstruct::base_struct< Layout >::_add_array ( const std::vector< size_t > & valuesOffsets,
const std::vector< std::byte > * valuesData )
inlinenodiscardprivate

adds array values to given offsets

◆ _add_mat()

template<utils::glsl_layout Layout>
template<class M>
_GLSL_STRUCT_CONSTEXPR20 size_t glslstruct::base_struct< Layout >::_add_mat ( const std::string_view name,
const M & value )
inlinenodiscardprivate

adds mat

◆ _add_mat_array()

template<utils::glsl_layout Layout>
template<class M>
_GLSL_STRUCT_CONSTEXPR20 std::vector< size_t > glslstruct::base_struct< Layout >::_add_mat_array ( const std::string_view name,
const M * values,
const size_t valuesCount )
inlinenodiscardprivate

adds mats array

◆ _add_scalar()

template<utils::glsl_layout Layout>
template<class T>
_GLSL_STRUCT_CONSTEXPR20 size_t glslstruct::base_struct< Layout >::_add_scalar ( const std::string_view name,
const T & value )
inlinenodiscardprivate

adds scalar

◆ _add_scalar_array()

template<utils::glsl_layout Layout>
template<class T>
_GLSL_STRUCT_CONSTEXPR20 std::vector< size_t > glslstruct::base_struct< Layout >::_add_scalar_array ( const std::string_view name,
const T * values,
const size_t valuesCount )
inlinenodiscardprivate

adds scalars array

◆ _add_struct()

template<utils::glsl_layout Layout>
_GLSL_STRUCT_CONSTEXPR20 size_t glslstruct::base_struct< Layout >::_add_struct ( const std::string_view name,
const layout_type & layout,
const std::byte * data,
const size_t bytesCount )
inlinenodiscardprivate

adds struct

◆ _add_struct_array()

template<utils::glsl_layout Layout>
_GLSL_STRUCT_CONSTEXPR20 std::vector< size_t > glslstruct::base_struct< Layout >::_add_struct_array ( const std::string_view name,
const layout_type & layout,
const std::vector< std::byte > * datas,
const size_t datasCount )
inlinenodiscardprivate

adds structs array

◆ _add_values()

template<utils::glsl_layout Layout>
template<class T, class... Ts, size_t Num, size_t... Nums>
_GLSL_STRUCT_CONSTEXPR17 void glslstruct::base_struct< Layout >::_add_values ( const glsl_value< T, Num > & value,
const glsl_value< Ts, Nums > &... values )
inlineprivate

adds multiple values

◆ _add_vec()

template<utils::glsl_layout Layout>
template<class V>
_GLSL_STRUCT_CONSTEXPR20 size_t glslstruct::base_struct< Layout >::_add_vec ( const std::string_view name,
const V & value )
inlinenodiscardprivate

adds vec

◆ _add_vec_array()

template<utils::glsl_layout Layout>
template<class V>
_GLSL_STRUCT_CONSTEXPR20 std::vector< size_t > glslstruct::base_struct< Layout >::_add_vec_array ( const std::string_view name,
const V * values,
const size_t valuesCount )
inlinenodiscardprivate

adds vecs array

◆ _get()

template<utils::glsl_layout Layout>
_GLSL_STRUCT_CONSTEXPR20 std::vector< std::byte > glslstruct::base_struct< Layout >::_get ( const size_t valueOffset,
const size_t valueSize ) const
inlinenodiscardprivate

returns value data at given offset with given size

◆ _get_array()

template<utils::glsl_layout Layout>
_GLSL_STRUCT_CONSTEXPR20 std::vector< std::vector< std::byte > > glslstruct::base_struct< Layout >::_get_array ( const std::vector< size_t > & valuesOffsets,
const size_t arrayElemSize,
const size_t valueSize ) const
inlinenodiscardprivate

returns array values data at given offsets with given value size

◆ _get_mat()

template<utils::glsl_layout Layout>
template<class M>
_GLSL_STRUCT_CONSTEXPR17 M glslstruct::base_struct< Layout >::_get_mat ( const std::string_view name) const
inlinenodiscardprivate

gets mat value

◆ _get_mat_array()

template<utils::glsl_layout Layout>
template<class M>
_GLSL_STRUCT_CONSTEXPR20 std::vector< M > glslstruct::base_struct< Layout >::_get_mat_array ( const std::string_view name) const
inlinenodiscardprivate

gets mat array value

◆ _get_mat_value()

template<utils::glsl_layout Layout>
template<class T>
_GLSL_STRUCT_CONSTEXPR20 T glslstruct::base_struct< Layout >::_get_mat_value ( const std::vector< std::vector< std::byte > > & data)
inlinestaticnodiscardprivate

returns mat value from data bytes

◆ _get_mat_value_data()

template<utils::glsl_layout Layout>
template<class T>
_GLSL_STRUCT_CONSTEXPR20 std::vector< std::vector< std::byte > > glslstruct::base_struct< Layout >::_get_mat_value_data ( const T & value)
inlinestaticnodiscardprivate

returns mat data bytes

◆ _get_scalar()

template<utils::glsl_layout Layout>
template<class T>
_GLSL_STRUCT_CONSTEXPR17 T glslstruct::base_struct< Layout >::_get_scalar ( const std::string_view name) const
inlinenodiscardprivate

gets scalar value

◆ _get_scalar_array()

template<utils::glsl_layout Layout>
template<class T>
_GLSL_STRUCT_CONSTEXPR20 std::vector< T > glslstruct::base_struct< Layout >::_get_scalar_array ( const std::string_view name) const
inlinenodiscardprivate

gets scalars array value

◆ _get_scalar_value()

template<utils::glsl_layout Layout>
template<class T>
_GLSL_STRUCT_CONSTEXPR20 T glslstruct::base_struct< Layout >::_get_scalar_value ( const std::vector< std::byte > & data)
inlinestaticnodiscardprivate

returns scalar value from data bytes

◆ _get_scalar_value_data()

template<utils::glsl_layout Layout>
template<class T>
_GLSL_STRUCT_CONSTEXPR20 std::vector< std::byte > glslstruct::base_struct< Layout >::_get_scalar_value_data ( const T & value)
inlinestaticnodiscardprivate

returns scalar data bytes

◆ _get_struct()

template<utils::glsl_layout Layout>
_GLSL_STRUCT_CONSTEXPR17 base_struct glslstruct::base_struct< Layout >::_get_struct ( const std::string_view name,
const layout_type & layout ) const
inlinenodiscardprivate

gets struct value

◆ _get_struct_array()

template<utils::glsl_layout Layout>
_GLSL_STRUCT_CONSTEXPR20 std::vector< base_struct > glslstruct::base_struct< Layout >::_get_struct_array ( const std::string_view name,
const layout_type & layout ) const
inlinenodiscardprivate

gets struct array value

◆ _get_vec()

template<utils::glsl_layout Layout>
template<class V>
_GLSL_STRUCT_CONSTEXPR17 V glslstruct::base_struct< Layout >::_get_vec ( const std::string_view name) const
inlinenodiscardprivate

gets vec value

◆ _get_vec_array()

template<utils::glsl_layout Layout>
template<class V>
_GLSL_STRUCT_CONSTEXPR20 std::vector< V > glslstruct::base_struct< Layout >::_get_vec_array ( const std::string_view name) const
inlinenodiscardprivate

gets vec array value

◆ _get_vec_value()

template<utils::glsl_layout Layout>
template<class T>
_GLSL_STRUCT_CONSTEXPR20 T glslstruct::base_struct< Layout >::_get_vec_value ( const std::vector< std::byte > & data)
inlinestaticnodiscardprivate

returns vec value from data bytes

◆ _get_vec_value_data()

template<utils::glsl_layout Layout>
template<class T>
_GLSL_STRUCT_CONSTEXPR20 std::vector< std::byte > glslstruct::base_struct< Layout >::_get_vec_value_data ( const T & value)
inlinestaticnodiscardprivate

returns vec data bytes

◆ _is_array()

template<utils::glsl_layout Layout>
bool glslstruct::base_struct< Layout >::_is_array ( const base_type_handle & varType)
inlinestaticnodiscardprivate

◆ _is_mat()

template<utils::glsl_layout Layout>
bool glslstruct::base_struct< Layout >::_is_mat ( const base_type_handle & varType,
const ValueType type,
const size_t columns,
const size_t rows )
inlinestaticnodiscardprivate

◆ _is_scalar()

template<utils::glsl_layout Layout>
bool glslstruct::base_struct< Layout >::_is_scalar ( const base_type_handle & varType,
const ValueType type )
inlinestaticnodiscardprivate

◆ _is_struct()

template<utils::glsl_layout Layout>
bool glslstruct::base_struct< Layout >::_is_struct ( const base_type_handle & varType,
const mstd::ordered_map< std::string, var_data > & variables )
inlinestaticnodiscardprivate

◆ _is_vec()

template<utils::glsl_layout Layout>
bool glslstruct::base_struct< Layout >::_is_vec ( const base_type_handle & varType,
const ValueType type,
const size_t length )
inlinestaticnodiscardprivate

◆ _mat_array_check()

template<utils::glsl_layout Layout>
bool glslstruct::base_struct< Layout >::_mat_array_check ( const std::string_view name,
const ValueType type,
const size_t columns,
const size_t rows ) const
inlinenodiscardprivate

◆ _mat_check()

template<utils::glsl_layout Layout>
bool glslstruct::base_struct< Layout >::_mat_check ( const std::string_view name,
const ValueType type,
const size_t columns,
const size_t rows ) const
inlinenodiscardprivate

◆ _scalar_array_check()

template<utils::glsl_layout Layout>
bool glslstruct::base_struct< Layout >::_scalar_array_check ( const std::string_view name,
const ValueType type ) const
inlinenodiscardprivate

◆ _scalar_check()

template<utils::glsl_layout Layout>
bool glslstruct::base_struct< Layout >::_scalar_check ( const std::string_view name,
const ValueType type ) const
inlinenodiscardprivate

◆ _set()

template<utils::glsl_layout Layout>
_GLSL_STRUCT_CONSTEXPR17 bool glslstruct::base_struct< Layout >::_set ( const size_t valueOffset,
const std::byte * valueData,
const size_t dataSize )
inlinenodiscardprivate

sets value data at given offset

◆ _set_array()

template<utils::glsl_layout Layout>
_GLSL_STRUCT_CONSTEXPR20 bool glslstruct::base_struct< Layout >::_set_array ( const std::vector< size_t > & valuesOffsets,
const std::vector< std::byte > * valuesData,
const size_t valuesCount )
inlinenodiscardprivate

sets array values data at given offsets

◆ _set_mat()

template<utils::glsl_layout Layout>
template<class M>
_GLSL_STRUCT_CONSTEXPR20 bool glslstruct::base_struct< Layout >::_set_mat ( const std::string_view name,
const M & value )
inlinenodiscardprivate

sets mat

◆ _set_mat_array()

template<utils::glsl_layout Layout>
template<class M>
_GLSL_STRUCT_CONSTEXPR20 bool glslstruct::base_struct< Layout >::_set_mat_array ( const std::string_view name,
const M * values,
const size_t valuesCount )
inlinenodiscardprivate

sets mat array

◆ _set_scalar()

template<utils::glsl_layout Layout>
template<class T>
_GLSL_STRUCT_CONSTEXPR20 bool glslstruct::base_struct< Layout >::_set_scalar ( const std::string_view name,
const T & value )
inlinenodiscardprivate

sets scalar

◆ _set_scalar_array()

template<utils::glsl_layout Layout>
template<class T>
_GLSL_STRUCT_CONSTEXPR20 bool glslstruct::base_struct< Layout >::_set_scalar_array ( const std::string_view name,
const T * values,
const size_t valuesCount )
inlinenodiscardprivate

sets scalar array

◆ _set_struct()

template<utils::glsl_layout Layout>
_GLSL_STRUCT_CONSTEXPR17 bool glslstruct::base_struct< Layout >::_set_struct ( const std::string_view name,
const layout_type & layout,
const std::byte * data,
const size_t bytesCount )
inlinenodiscardprivate

sets struct

◆ _set_struct_array()

template<utils::glsl_layout Layout>
_GLSL_STRUCT_CONSTEXPR20 bool glslstruct::base_struct< Layout >::_set_struct_array ( const std::string_view name,
const layout_type & layout,
const std::vector< std::byte > * values,
const size_t valuesCount )
inlinenodiscardprivate

sets struct array

◆ _set_vec()

template<utils::glsl_layout Layout>
template<class V>
_GLSL_STRUCT_CONSTEXPR20 bool glslstruct::base_struct< Layout >::_set_vec ( const std::string_view name,
const V & value )
inlinenodiscardprivate

sets vec

◆ _set_vec_array()

template<utils::glsl_layout Layout>
template<class V>
_GLSL_STRUCT_CONSTEXPR20 bool glslstruct::base_struct< Layout >::_set_vec_array ( const std::string_view name,
const V * values,
const size_t valuesCount )
inlinenodiscardprivate

sets vec array

◆ _struct_array_check()

template<utils::glsl_layout Layout>
bool glslstruct::base_struct< Layout >::_struct_array_check ( const std::string_view name,
const mstd::ordered_map< std::string, var_data > & variables ) const
inlinenodiscardprivate

◆ _struct_check()

template<utils::glsl_layout Layout>
bool glslstruct::base_struct< Layout >::_struct_check ( const std::string_view name,
const mstd::ordered_map< std::string, var_data > & variables ) const
inlinenodiscardprivate

◆ _vec_array_check()

template<utils::glsl_layout Layout>
bool glslstruct::base_struct< Layout >::_vec_array_check ( const std::string_view name,
const ValueType type,
const size_t length ) const
inlinenodiscardprivate

◆ _vec_check()

template<utils::glsl_layout Layout>
bool glslstruct::base_struct< Layout >::_vec_check ( const std::string_view name,
const ValueType type,
const size_t length ) const
inlinenodiscardprivate

◆ add() [1/25]

template<utils::glsl_layout Layout>
template<utils::glsl_mats_static_size_array MA>
_GLSL_STRUCT_CONSTEXPR20 std::vector< size_t > glslstruct::base_struct< Layout >::add ( const std::string_view name)
inline

adds array of default mats

◆ add() [2/25]

template<utils::glsl_layout Layout>
template<utils::glsl_mat M>
_GLSL_STRUCT_CONSTEXPR20 size_t glslstruct::base_struct< Layout >::add ( const std::string_view name)
inline

adds default mat and returns offset

◆ add() [3/25]

template<utils::glsl_layout Layout>
template<utils::glsl_vecs_static_size_array VA>
_GLSL_STRUCT_CONSTEXPR20 std::vector< size_t > glslstruct::base_struct< Layout >::add ( const std::string_view name)
inline

adds array of default vecs

◆ add() [4/25]

template<utils::glsl_layout Layout>
template<utils::glsl_vec V>
_GLSL_STRUCT_CONSTEXPR17 size_t glslstruct::base_struct< Layout >::add ( const std::string_view name)
inline

adds default vec and returns offset

◆ add() [5/25]

template<utils::glsl_layout Layout>
template<utils::glsl_scalars_static_size_array SA>
_GLSL_STRUCT_CONSTEXPR20 std::vector< size_t > glslstruct::base_struct< Layout >::add ( const std::string_view name)
inline

adds array of scalars

◆ add() [6/25]

template<utils::glsl_layout Layout>
template<utils::glsl_scalar S>
_GLSL_STRUCT_CONSTEXPR20 size_t glslstruct::base_struct< Layout >::add ( const std::string_view name)
inline

adds scalar with default value and returns offset

◆ add() [7/25]

template<utils::glsl_layout Layout>
_GLSL_STRUCT_CONSTEXPR17 size_t glslstruct::base_struct< Layout >::add ( const std::string_view name,
const base_struct< Layout > & value )
inline

adds struct

◆ add() [8/25]

template<utils::glsl_layout Layout>
_GLSL_STRUCT_CONSTEXPR20 size_t glslstruct::base_struct< Layout >::add ( const std::string_view name,
const layout_type & layout )
inline

adds struct based on layout

◆ add() [9/25]

template<utils::glsl_layout Layout>
template<class BA, std::enable_if_t< utils::is_array_of_v< std::is_same, BA, std::byte >, bool > = true>
_GLSL_STRUCT_CONSTEXPR20 size_t glslstruct::base_struct< Layout >::add ( const std::string_view name,
const layout_type & layout,
const BA & data )
inline

adds struct based on layout and array of data in bytes

◆ add() [10/25]

template<utils::glsl_layout Layout>
template<class SBA, std::enable_if_t< utils::is_array_of_v< std::is_same, SBA, std::vector< std::byte > >, bool > = true>
_GLSL_STRUCT_CONSTEXPR20 std::vector< size_t > glslstruct::base_struct< Layout >::add ( const std::string_view name,
const layout_type & layout,
const SBA & values )
inline

adds array of structs based on layout and array of data in bytes

◆ add() [11/25]

template<utils::glsl_layout Layout>
_GLSL_STRUCT_CONSTEXPR20 std::vector< size_t > glslstruct::base_struct< Layout >::add ( const std::string_view name,
const layout_type & layout,
const size_t count )
inline

adds array of structs based on layout and array of data in bytes

◆ add() [12/25]

template<utils::glsl_layout Layout>
_GLSL_STRUCT_CONSTEXPR20 size_t glslstruct::base_struct< Layout >::add ( const std::string_view name,
const layout_type & layout,
const std::byte * data,
const size_t bytesCount )
inline

adds struct based on layout and pointer to data in bytes

◆ add() [13/25]

template<utils::glsl_layout Layout>
_GLSL_STRUCT_CONSTEXPR20 std::vector< size_t > glslstruct::base_struct< Layout >::add ( const std::string_view name,
const layout_type & layout,
const std::vector< std::byte > * values,
const size_t valuesCount )
inline

adds array of structs based on layout and pointer to data in bytes

◆ add() [14/25]

template<utils::glsl_layout Layout>
template<utils::glsl_mat M>
_GLSL_STRUCT_CONSTEXPR20 size_t glslstruct::base_struct< Layout >::add ( const std::string_view name,
const M & value )
inline

adds mat and returns offset

◆ add() [15/25]

template<utils::glsl_layout Layout>
template<utils::glsl_mat M>
_GLSL_STRUCT_CONSTEXPR20 std::vector< size_t > glslstruct::base_struct< Layout >::add ( const std::string_view name,
const M * values,
const size_t valuesCount )
inline

adds array of mats with pointer to values and size

◆ add() [16/25]

template<utils::glsl_layout Layout>
template<utils::glsl_mats_array MA>
_GLSL_STRUCT_CONSTEXPR20 std::vector< size_t > glslstruct::base_struct< Layout >::add ( const std::string_view name,
const MA & values )
inline

adds array of mats

◆ add() [17/25]

template<utils::glsl_layout Layout>
template<utils::glsl_scalar S>
_GLSL_STRUCT_CONSTEXPR20 size_t glslstruct::base_struct< Layout >::add ( const std::string_view name,
const S & value )
inline

adds scalar and returns offset

◆ add() [18/25]

template<utils::glsl_layout Layout>
template<utils::glsl_scalar S>
_GLSL_STRUCT_CONSTEXPR20 std::vector< size_t > glslstruct::base_struct< Layout >::add ( const std::string_view name,
const S * values,
const size_t valuesCount )
inline

adds array of scalars with pointer to values and size

◆ add() [19/25]

template<utils::glsl_layout Layout>
template<utils::glsl_scalars_array SA>
_GLSL_STRUCT_CONSTEXPR20 std::vector< size_t > glslstruct::base_struct< Layout >::add ( const std::string_view name,
const SA & values )
inline

adds array of scalars

◆ add() [20/25]

template<utils::glsl_layout Layout>
template<utils::glsl_mats_array MA>
_GLSL_STRUCT_CONSTEXPR20 std::vector< size_t > glslstruct::base_struct< Layout >::add ( const std::string_view name,
const size_t count )
inline

adds array of default mats

◆ add() [21/25]

template<utils::glsl_layout Layout>
template<utils::glsl_vecs_array VA>
_GLSL_STRUCT_CONSTEXPR20 std::vector< size_t > glslstruct::base_struct< Layout >::add ( const std::string_view name,
const size_t count )
inline

adds array of default vecs

◆ add() [22/25]

template<utils::glsl_layout Layout>
template<utils::glsl_scalars_array SA>
_GLSL_STRUCT_CONSTEXPR20 std::vector< size_t > glslstruct::base_struct< Layout >::add ( const std::string_view name,
const size_t count )
inline

adds array of scalars

◆ add() [23/25]

template<utils::glsl_layout Layout>
template<utils::glsl_vec V>
_GLSL_STRUCT_CONSTEXPR17 size_t glslstruct::base_struct< Layout >::add ( const std::string_view name,
const V & value )
inline

adds vec and returns offset

◆ add() [24/25]

template<utils::glsl_layout Layout>
template<utils::glsl_vec V>
_GLSL_STRUCT_CONSTEXPR20 std::vector< size_t > glslstruct::base_struct< Layout >::add ( const std::string_view name,
const V * values,
const size_t valuesCount )
inline

adds array of vecs using pointer to values and size

◆ add() [25/25]

template<utils::glsl_layout Layout>
template<utils::glsl_vecs_array VA>
_GLSL_STRUCT_CONSTEXPR20 std::vector< size_t > glslstruct::base_struct< Layout >::add ( const std::string_view name,
const VA & values )
inline

adds array of vecs

◆ bad_offset()

template<utils::glsl_layout Layout>
_GLSL_STRUCT_CONSTEXPR17 size_t glslstruct::base_struct< Layout >::bad_offset ( )
inlinestaticnodiscardnoexcept

invalid offset value returned when there is error

◆ base_alignment()

template<utils::glsl_layout Layout>
_GLSL_STRUCT_CONSTEXPR17 size_t glslstruct::base_struct< Layout >::base_alignment ( ) const
inlinenodiscardnoexcept

returns base alignment of struct

◆ clear()

template<utils::glsl_layout Layout>
_GLSL_STRUCT_CONSTEXPR17 void glslstruct::base_struct< Layout >::clear ( )
inlinenoexcept

clears layout and data

◆ clear_data()

template<utils::glsl_layout Layout>
_GLSL_STRUCT_CONSTEXPR17 void glslstruct::base_struct< Layout >::clear_data ( )
inlinenoexcept

resets data to all zeros

◆ contains()

template<utils::glsl_layout Layout>
_GLSL_STRUCT_CONSTEXPR17 bool glslstruct::base_struct< Layout >::contains ( const std::string_view name) const
inlinenodiscard

returns true if struct contains variable with given name

◆ data()

template<utils::glsl_layout Layout>
_GLSL_STRUCT_CONSTEXPR17 const std::vector< std::byte > & glslstruct::base_struct< Layout >::data ( ) const
inlinenodiscardnoexcept

returns struct data in bytes

◆ get() [1/12]

template<utils::glsl_layout Layout>
template<utils::glsl_mats_array MA>
_GLSL_STRUCT_CONSTEXPR20 std::vector< utils::array_value_type_t< MA > > glslstruct::base_struct< Layout >::get ( const std::string_view name) const
inlinenodiscard

gets mats array value as std::vector

◆ get() [2/12]

template<utils::glsl_layout Layout>
template<utils::glsl_mat M>
_GLSL_STRUCT_CONSTEXPR20 M glslstruct::base_struct< Layout >::get ( const std::string_view name) const
inlinenodiscard

gets mat value

◆ get() [3/12]

template<utils::glsl_layout Layout>
template<utils::glsl_vecs_array VA>
_GLSL_STRUCT_CONSTEXPR20 std::vector< utils::array_value_type_t< VA > > glslstruct::base_struct< Layout >::get ( const std::string_view name) const
inlinenodiscard

gets vecs array value as std::vector

◆ get() [4/12]

template<utils::glsl_layout Layout>
template<utils::glsl_vec V>
_GLSL_STRUCT_CONSTEXPR17 V glslstruct::base_struct< Layout >::get ( const std::string_view name) const
inlinenodiscard

gets vec value

◆ get() [5/12]

template<utils::glsl_layout Layout>
template<utils::glsl_scalars_array SA>
_GLSL_STRUCT_CONSTEXPR20 std::vector< utils::array_value_type_t< SA > > glslstruct::base_struct< Layout >::get ( const std::string_view name) const
inlinenodiscard

gets scalars array value as std::vector

◆ get() [6/12]

template<utils::glsl_layout Layout>
template<utils::glsl_scalar T>
_GLSL_STRUCT_CONSTEXPR17 T glslstruct::base_struct< Layout >::get ( const std::string_view name) const
inlinenodiscard

gets scalar value

◆ get() [7/12]

template<utils::glsl_layout Layout>
template<utils::glsl_layout_structs_array< layout_type > LSA>
_GLSL_STRUCT_CONSTEXPR20 std::vector< utils::array_value_type_t< LSA > > glslstruct::base_struct< Layout >::get ( const std::string_view name,
const layout_type & layout ) const
inlinenodiscard

gets struct array value as std::vector

◆ get() [8/12]

template<utils::glsl_layout Layout>
template<utils::glsl_layout_struct< layout_type > S>
_GLSL_STRUCT_CONSTEXPR17 base_struct glslstruct::base_struct< Layout >::get ( const std::string_view name,
const layout_type & layout ) const
inlinenodiscard

gets struct value

◆ get() [9/12]

template<utils::glsl_layout Layout>
_GLSL_STRUCT_CONSTEXPR20 void glslstruct::base_struct< Layout >::get ( const std::string_view name,
const layout_type & layout,
const base_struct< Layout > * valuesDest,
const size_t valuesDestCount ) const
inline

copies struct array value to provided pointer

◆ get() [10/12]

template<utils::glsl_layout Layout>
template<utils::glsl_mat M>
_GLSL_STRUCT_CONSTEXPR20 void glslstruct::base_struct< Layout >::get ( const std::string_view name,
const M * valuesDest,
const size_t valuesDestCount ) const
inline

copies mats array value to provided pointer

◆ get() [11/12]

template<utils::glsl_layout Layout>
template<utils::glsl_scalar T>
_GLSL_STRUCT_CONSTEXPR20 void glslstruct::base_struct< Layout >::get ( const std::string_view name,
const T * valuesDest,
const size_t valuesDestCount ) const
inline

copies scalars array value to provided pointer

◆ get() [12/12]

template<utils::glsl_layout Layout>
template<utils::glsl_vec V>
_GLSL_STRUCT_CONSTEXPR20 void glslstruct::base_struct< Layout >::get ( const std::string_view name,
const V * valuesDest,
const size_t valuesDestCount ) const
inline

copies vecs array value to provided pointer

◆ get_array_offsets()

template<utils::glsl_layout Layout>
_GLSL_STRUCT_CONSTEXPR20 std::vector< size_t > glslstruct::base_struct< Layout >::get_array_offsets ( const std::string_view name) const
inlinenodiscard

returns offsets of elements of array

◆ get_layout()

template<utils::glsl_layout Layout>
_GLSL_STRUCT_CONSTEXPR17 const layout_type & glslstruct::base_struct< Layout >::get_layout ( ) const
inlinenodiscardnoexcept

returns struct layout

◆ get_names()

template<utils::glsl_layout Layout>
_GLSL_STRUCT_CONSTEXPR20 std::vector< std::string > glslstruct::base_struct< Layout >::get_names ( ) const
inlinenodiscard

returns names of all variables

◆ get_offset()

template<utils::glsl_layout Layout>
_GLSL_STRUCT_CONSTEXPR17 size_t glslstruct::base_struct< Layout >::get_offset ( const std::string_view name) const
inlinenodiscard

returns offset of variable

◆ get_padding()

template<utils::glsl_layout Layout>
_GLSL_STRUCT_CONSTEXPR17 size_t glslstruct::base_struct< Layout >::get_padding ( const std::string_view name) const
inlinenodiscardnoexcept

returns variable padding

◆ get_size()

template<utils::glsl_layout Layout>
_GLSL_STRUCT_CONSTEXPR17 size_t glslstruct::base_struct< Layout >::get_size ( const std::string_view name) const
inlinenodiscardnoexcept

returns size of variable

◆ get_top_level_variables()

template<utils::glsl_layout Layout>
mstd::ordered_map< std::string, var_data > glslstruct::base_struct< Layout >::get_top_level_variables ( )
inlinenodiscardnoexcept

returns all top level variables and their data

◆ get_total_size()

template<utils::glsl_layout Layout>
_GLSL_STRUCT_CONSTEXPR17 size_t glslstruct::base_struct< Layout >::get_total_size ( const std::string_view name) const
inlinenodiscardnoexcept

returns total size of variable (size + padding)

◆ get_type() [1/2]

template<utils::glsl_layout Layout>
template<utils::glsl_type T>
_GLSL_STRUCT_CONSTEXPR17 std::shared_ptr< T > glslstruct::base_struct< Layout >::get_type ( const std::string_view name) const
inlinenodiscard

returns type of variable casted to desired type (using dynamic_type_cast)

◆ get_type() [2/2]

template<utils::glsl_layout Layout>
_GLSL_STRUCT_CONSTEXPR20 const base_type_handle & glslstruct::base_struct< Layout >::get_type ( const std::string_view name) const
inlinenodiscard

returns type of variable

◆ get_variables()

template<utils::glsl_layout Layout>
_GLSL_STRUCT_CONSTEXPR20 const std::unordered_map< std::string, var_data > & glslstruct::base_struct< Layout >::get_variables ( ) const
inlinenodiscardnoexcept

returns all variables and their data

◆ operator!=()

template<utils::glsl_layout Layout>
_GLSL_STRUCT_CONSTEXPR17 bool glslstruct::base_struct< Layout >::operator!= ( const base_struct< Layout > & other) const
nodiscarddefault

default not equal operator

◆ operator=() [1/2]

template<utils::glsl_layout Layout>
_GLSL_STRUCT_CONSTEXPR20 base_struct & glslstruct::base_struct< Layout >::operator= ( base_struct< Layout > && other)
inlinenoexcept

move assign operator

◆ operator=() [2/2]

template<utils::glsl_layout Layout>
_GLSL_STRUCT_CONSTEXPR20 base_struct & glslstruct::base_struct< Layout >::operator= ( const base_struct< Layout > & other)
defaultnoexcept

default copy assign operator

◆ operator==()

template<utils::glsl_layout Layout>
_GLSL_STRUCT_CONSTEXPR17 bool glslstruct::base_struct< Layout >::operator== ( const base_struct< Layout > & other) const
inlinenodiscard

checks if two structs are equal

◆ padding()

template<utils::glsl_layout Layout>
_GLSL_STRUCT_CONSTEXPR17 size_t glslstruct::base_struct< Layout >::padding ( ) const
inlinenodiscardnoexcept

returns struct padding

◆ set() [1/25]

template<utils::glsl_layout Layout>
template<utils::glsl_mats_static_size_array MA>
_GLSL_STRUCT_CONSTEXPR20 bool glslstruct::base_struct< Layout >::set ( const std::string_view name)
inline

sets mat array value with array of default values

◆ set() [2/25]

template<utils::glsl_layout Layout>
template<utils::glsl_mat M>
_GLSL_STRUCT_CONSTEXPR20 bool glslstruct::base_struct< Layout >::set ( const std::string_view name)
inline

sets default mat value

◆ set() [3/25]

template<utils::glsl_layout Layout>
template<utils::glsl_vecs_static_size_array VA>
_GLSL_STRUCT_CONSTEXPR20 bool glslstruct::base_struct< Layout >::set ( const std::string_view name)
inline

sets vec array value with array of default values

◆ set() [4/25]

template<utils::glsl_layout Layout>
template<utils::glsl_vec V>
_GLSL_STRUCT_CONSTEXPR17 bool glslstruct::base_struct< Layout >::set ( const std::string_view name)
inline

sets vec default value

◆ set() [5/25]

template<utils::glsl_layout Layout>
template<utils::glsl_scalars_static_size_array SA>
_GLSL_STRUCT_CONSTEXPR20 bool glslstruct::base_struct< Layout >::set ( const std::string_view name)
inline

sets scalar array value with array of default values

◆ set() [6/25]

template<utils::glsl_layout Layout>
template<utils::glsl_scalar S>
_GLSL_STRUCT_CONSTEXPR20 bool glslstruct::base_struct< Layout >::set ( const std::string_view name)
inline

sets default scalar value

◆ set() [7/25]

template<utils::glsl_layout Layout>
_GLSL_STRUCT_CONSTEXPR17 bool glslstruct::base_struct< Layout >::set ( const std::string_view name,
const base_struct< Layout > & value )
inline

sets struct value

◆ set() [8/25]

template<utils::glsl_layout Layout>
_GLSL_STRUCT_CONSTEXPR20 bool glslstruct::base_struct< Layout >::set ( const std::string_view name,
const layout_type & layout )
inline

sets empty struct

◆ set() [9/25]

template<utils::glsl_layout Layout>
template<class BA, std::enable_if_t< utils::is_array_of_v< std::is_same, BA, std::byte >, bool > = true>
_GLSL_STRUCT_CONSTEXPR17 bool glslstruct::base_struct< Layout >::set ( const std::string_view name,
const layout_type & layout,
const BA & data )
inline

sets struct value using array of data bytes

◆ set() [10/25]

template<utils::glsl_layout Layout>
template<class SBA, std::enable_if_t< utils::is_array_of_v< std::is_same, SBA, std::vector< std::byte > >, bool > = true>
_GLSL_STRUCT_CONSTEXPR20 bool glslstruct::base_struct< Layout >::set ( const std::string_view name,
const layout_type & layout,
const SBA & datas )
inline

sets mat array value using array of datas

◆ set() [11/25]

template<utils::glsl_layout Layout>
template<class SBA, std::enable_if_t< utils::is_array_of_v< std::is_same, SBA, std::vector< std::byte > >, bool > = true>
_GLSL_STRUCT_CONSTEXPR20 bool glslstruct::base_struct< Layout >::set ( const std::string_view name,
const layout_type & layout,
const size_t count )
inline

sets mat array value using array of datas

◆ set() [12/25]

template<utils::glsl_layout Layout>
_GLSL_STRUCT_CONSTEXPR17 bool glslstruct::base_struct< Layout >::set ( const std::string_view name,
const layout_type & layout,
const std::byte * data,
const size_t bytesCount )
inline

sets struct value using pointer to data

◆ set() [13/25]

template<utils::glsl_layout Layout>
_GLSL_STRUCT_CONSTEXPR20 bool glslstruct::base_struct< Layout >::set ( const std::string_view name,
const layout_type & layout,
const std::vector< std::byte > * datas,
const size_t datasCount )
inline

sets mat array value with pointer to values

◆ set() [14/25]

template<utils::glsl_layout Layout>
template<utils::glsl_mat M>
_GLSL_STRUCT_CONSTEXPR20 bool glslstruct::base_struct< Layout >::set ( const std::string_view name,
const M & value )
inline

sets mat value

◆ set() [15/25]

template<utils::glsl_layout Layout>
template<utils::glsl_mat M>
_GLSL_STRUCT_CONSTEXPR20 bool glslstruct::base_struct< Layout >::set ( const std::string_view name,
const M * values,
const size_t valuesCount )
inline

sets mat array value using pointer to values

◆ set() [16/25]

template<utils::glsl_layout Layout>
template<utils::glsl_mats_array MA>
_GLSL_STRUCT_CONSTEXPR20 bool glslstruct::base_struct< Layout >::set ( const std::string_view name,
const MA & values )
inline

sets mat array value with array of values

◆ set() [17/25]

template<utils::glsl_layout Layout>
template<utils::glsl_scalar S>
_GLSL_STRUCT_CONSTEXPR20 bool glslstruct::base_struct< Layout >::set ( const std::string_view name,
const S & value )
inline

sets scalar value

◆ set() [18/25]

template<utils::glsl_layout Layout>
template<utils::glsl_scalar S>
_GLSL_STRUCT_CONSTEXPR20 bool glslstruct::base_struct< Layout >::set ( const std::string_view name,
const S * values,
const size_t valuesCount )
inline

sets scalar array value using pointer to values

◆ set() [19/25]

template<utils::glsl_layout Layout>
template<utils::glsl_scalars_array SA>
_GLSL_STRUCT_CONSTEXPR20 bool glslstruct::base_struct< Layout >::set ( const std::string_view name,
const SA & values )
inline

sets scalar array value with array of values

◆ set() [20/25]

template<utils::glsl_layout Layout>
template<utils::glsl_mats_array MA>
_GLSL_STRUCT_CONSTEXPR20 bool glslstruct::base_struct< Layout >::set ( const std::string_view name,
const size_t count )
inline

sets mat array value with array of default values

◆ set() [21/25]

template<utils::glsl_layout Layout>
template<utils::glsl_vecs_array VA>
_GLSL_STRUCT_CONSTEXPR20 bool glslstruct::base_struct< Layout >::set ( const std::string_view name,
const size_t count )
inline

sets vec array value with array of default values

◆ set() [22/25]

template<utils::glsl_layout Layout>
template<utils::glsl_scalars_array SA>
_GLSL_STRUCT_CONSTEXPR20 bool glslstruct::base_struct< Layout >::set ( const std::string_view name,
const size_t count )
inline

sets scalar array value with array of default values

◆ set() [23/25]

template<utils::glsl_layout Layout>
template<utils::glsl_vec V>
_GLSL_STRUCT_CONSTEXPR17 bool glslstruct::base_struct< Layout >::set ( const std::string_view name,
const V & value )
inline

sets vec value

◆ set() [24/25]

template<utils::glsl_layout Layout>
template<utils::glsl_vec V>
_GLSL_STRUCT_CONSTEXPR20 bool glslstruct::base_struct< Layout >::set ( const std::string_view name,
const V * values,
const size_t size )
inline

sets vec array value using pointer to values

◆ set() [25/25]

template<utils::glsl_layout Layout>
template<utils::glsl_vecs_array VA>
_GLSL_STRUCT_CONSTEXPR20 bool glslstruct::base_struct< Layout >::set ( const std::string_view name,
const VA & values )
inline

sets vec array value with array of values

◆ size()

template<utils::glsl_layout Layout>
_GLSL_STRUCT_CONSTEXPR17 size_t glslstruct::base_struct< Layout >::size ( ) const
inlinenodiscardnoexcept

returns size of struct data

◆ std::hash< base_struct >

template<utils::glsl_layout Layout>
friend struct std::hash< base_struct >
friend

Member Data Documentation

◆ _data

template<utils::glsl_layout Layout>
std::vector<std::byte> glslstruct::base_struct< Layout >::_data
private

struct data

◆ _layout

template<utils::glsl_layout Layout>
layout_type glslstruct::base_struct< Layout >::_layout
private

struct layout