ezEngine  Release 25.03
ezProcessingStream Class Reference

A single stream in a stream group holding contiguous data of a given type. More...

#include <ProcessingStream.h>

Public Types

enum  DataType : ezUInt8 {
  Half, Half2, Half3, Half4,
  Float, Float2, Float3, Float4,
  Byte, Byte2, Byte3, Byte4,
  Short, Short2, Short3, Short4,
  Int, Int2, Int3, Int4,
  Count
}
 The data types which can be stored in the stream. When adding new data types the GetDataTypeSize() of ezProcessingStream needs to be updated.
 

Public Member Functions

 ezProcessingStream (const ezHashedString &sName, DataType type, ezUInt16 uiStride, ezUInt16 uiAlignment)
 
 ezProcessingStream (const ezHashedString &sName, ezArrayPtr< ezUInt8 > data, DataType type, ezUInt16 uiStride)
 
 ezProcessingStream (const ezHashedString &sName, ezArrayPtr< ezUInt8 > data, DataType type)
 
template<typename T >
const T * GetData () const
 Returns a const pointer to the data casted to the type T, note that no type check is done!
 
const void * GetData () const
 Returns a const pointer to the start of the data block.
 
template<typename T >
T * GetWritableData () const
 Returns a non-const pointer to the data casted to the type T, note that no type check is done!
 
void * GetWritableData () const
 Returns a non-const pointer to the start of the data block.
 
ezUInt64 GetDataSize () const
 
const ezHashedStringGetName () const
 Returns the name of the stream.
 
ezUInt16 GetAlignment () const
 Returns the alignment which was used to allocate the stream.
 
DataType GetDataType () const
 Returns the data type of the stream.
 
ezUInt16 GetElementSize () const
 Returns the size of one stream element in bytes.
 
ezUInt16 GetElementStride () const
 Returns the stride between two elements of the stream in bytes.
 

Static Public Member Functions

static ezUInt16 GetDataTypeSize (DataType type)
 
static ezStringView GetDataTypeName (DataType type)
 

Protected Member Functions

void SetSize (ezUInt64 uiNumElements)
 
void FreeData ()
 

Protected Attributes

void * m_pData = nullptr
 
ezUInt64 m_uiDataSize = 0
 
ezUInt16 m_uiAlignment = 0
 
ezUInt16 m_uiTypeSize = 0
 
ezUInt16 m_uiStride = 0
 
DataType m_Type
 
bool m_bExternalMemory = false
 
ezHashedString m_sName
 

Friends

class ezProcessingStreamGroup
 

Detailed Description

A single stream in a stream group holding contiguous data of a given type.

Member Function Documentation

◆ SetSize()

void ezProcessingStream::SetSize ( ezUInt64  uiNumElements)
protected
Todo:
Allow to reuse memory from a pool ?

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