Plasma Engine  2.0
Loading...
Searching...
No Matches
plProcessingStream 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 : plUInt8 {
  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 plProcessingStream needs to be updated.
 

Public Member Functions

 plProcessingStream (const plHashedString &sName, DataType type, plUInt16 uiStride, plUInt16 uiAlignment)
 
 plProcessingStream (const plHashedString &sName, plArrayPtr< plUInt8 > data, DataType type, plUInt16 uiStride)
 
 plProcessingStream (const plHashedString &sName, plArrayPtr< plUInt8 > 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.
 
plUInt64 GetDataSize () const
 
const plHashedStringGetName () const
 Returns the name of the stream.
 
plUInt16 GetAlignment () const
 Returns the alignment which was used to allocate the stream.
 
DataType GetDataType () const
 Returns the data type of the stream.
 
plUInt16 GetElementSize () const
 Returns the size of one stream element in bytes.
 
plUInt16 GetElementStride () const
 Returns the stride between two elements of the stream in bytes.
 

Static Public Member Functions

static plUInt16 GetDataTypeSize (DataType type)
 
static plStringView GetDataTypeName (DataType type)
 

Protected Member Functions

void SetSize (plUInt64 uiNumElements)
 
void FreeData ()
 

Protected Attributes

void * m_pData = nullptr
 
plUInt64 m_uiDataSize = 0
 
plUInt16 m_uiAlignment = 0
 
plUInt16 m_uiTypeSize = 0
 
plUInt16 m_uiStride = 0
 
DataType m_Type
 
bool m_bExternalMemory = false
 
plHashedString m_sName
 

Friends

class plProcessingStreamGroup
 

Detailed Description

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

Member Function Documentation

◆ SetSize()

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

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