Kanzi 4.0.0-beta2
kanzi::gfx::reflection::UniformBlockBuilder Class Reference

A helper class to build uniform blocks based on reflection information. More...

#include <kanzi/gfx/reflection.hpp>

Public Types

enum class  ReturnCode { Success , MemberNotFound , MismatchingTypeInformation , DataWrongSize }
 Defines the return codes for the set operation. More...
 

Public Member Functions

auto getData () const
 Gets the data span.
 
template<typename T >
ReturnCode set (const string &name, const T &data)
 Sets a uniform value with a given name and value.
 
 UniformBlockBuilder (const InterfaceBlock &reflectionInfo, span< byte > data)
 Constructor.
 

Detailed Description

A helper class to build uniform blocks based on reflection information.

Since
Kanzi 4.0.0

Member Enumeration Documentation

◆ ReturnCode

Defines the return codes for the set operation.

Enumerator
Success 

The operation completed successfully.

MemberNotFound 

The member name was not found.

MismatchingTypeInformation 

The type information does not match reflection.

DataWrongSize 

The provided data has the wrong size.

Constructor & Destructor Documentation

◆ UniformBlockBuilder()

kanzi::gfx::reflection::UniformBlockBuilder::UniformBlockBuilder ( const InterfaceBlock & reflectionInfo,
span< byte > data )
inline

Constructor.

Parameters
reflectionInfoThe interface block reflection data.
dataThe data to build into.

Member Function Documentation

◆ getData()

auto kanzi::gfx::reflection::UniformBlockBuilder::getData ( ) const
inline

Gets the data span.

Returns
The data span.

◆ set()

template<typename T >
ReturnCode kanzi::gfx::reflection::UniformBlockBuilder::set ( const string & name,
const T & data )
inline

Sets a uniform value with a given name and value.

Parameters
nameThe name of the uniform.
dataThe value to set.
Template Parameters
TThe value type.

The documentation for this class was generated from the following file: