XII Release 0.1.0
Loading...
Searching...
No Matches
xiiProcessingStream Class Reference

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

#include <ProcessingStream.h>

Public Types

enum class  DataType : xiiUInt8 {
  Half , Half2 , Half3 , Half4 ,
  Float , Float2 , Float3 , Float4 ,
  Double , Double2 , Double3 , Double4 ,
  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 xiiProcessingStream needs to be updated.
 

Public Member Functions

 xiiProcessingStream (const xiiHashedString &sName, DataType type, xiiUInt16 uiStride, xiiUInt16 uiAlignment)
 
 xiiProcessingStream (const xiiHashedString &sName, xiiArrayPtr< xiiUInt8 > data, DataType type, xiiUInt16 uiStride)
 
 xiiProcessingStream (const xiiHashedString &sName, xiiArrayPtr< xiiUInt8 > 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.
 
xiiUInt64 GetDataSize () const
 
const xiiHashedStringGetName () const
 Returns the name of the stream.
 
xiiUInt16 GetAlignment () const
 Returns the alignment which was used to allocate the stream.
 
DataType GetDataType () const
 Returns the data type of the stream.
 
xiiUInt16 GetElementSize () const
 Returns the size of one stream element in bytes.
 
xiiUInt16 GetElementStride () const
 Returns the stride between two elements of the stream in bytes.
 

Static Public Member Functions

static xiiUInt16 GetDataTypeSize (DataType type)
 
static xiiStringView GetDataTypeName (DataType type)
 

Protected Member Functions

void SetSize (xiiUInt64 uiNumElements)
 
void FreeData ()
 

Protected Attributes

void * m_pData = nullptr
 
xiiUInt64 m_uiDataSize = 0
 
xiiUInt16 m_uiAlignment = 0
 
xiiUInt16 m_uiTypeSize = 0
 
xiiUInt16 m_uiStride = 0
 
DataType m_Type
 
bool m_bExternalMemory = false
 
xiiHashedString m_sName
 

Friends

class xiiProcessingStreamGroup
 

Detailed Description

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

Member Function Documentation

◆ SetSize()

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

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