iPlug2 - C++ Audio Plug-in Framework
Loading...
Searching...
No Matches
Public Member Functions | List of all members
IByteStream Class Reference

Manages a non-owned block of memory, for receiving arbitrary message byte streams. More...

#include <IPlugStructs.h>

Inheritance diagram for IByteStream:
[legend]

Public Member Functions

 IByteStream (const void *pData, int dataSize)
 
int GetBytes (void *pDst, int nBytesToCopy, int startPos) const
 Copy raw bytes from the stream, returning the new position for subsequent calls. More...
 
template<class T >
int Get (T *pDst, int startPos) const
 Get arbitary typed data from the stream. More...
 
int GetStr (WDL_String &str, int startPos) const
 Get a string from the stream. More...
 
int Size () const
 Returns the size of the stream. More...
 
bool IsEqual (IByteStream &otherStream) const
 Compares the size & values of the data of another stream with this one. More...
 
const uint8_t * GetData ()
 Gets a const ptr to the stream data. More...
 

Detailed Description

Manages a non-owned block of memory, for receiving arbitrary message byte streams.

Definition at line 267 of file IPlugStructs.h.

Constructor & Destructor Documentation

◆ IByteStream()

IByteStream::IByteStream ( const void *  pData,
int  dataSize 
)
inline

Definition at line 270 of file IPlugStructs.h.

◆ ~IByteStream()

IByteStream::~IByteStream ( )
inline

Definition at line 271 of file IPlugStructs.h.

Member Function Documentation

◆ Get()

template<class T >
int IByteStream::Get ( T *  pDst,
int  startPos 
) const
inline

Get arbitary typed data from the stream.

Template Parameters
TThe type of data to be extracted
Parameters
pDstPtr to the destination where the data will be extracted
startPosThe starting position in bytes in the stream
Returns
int The end position in the stream (in bytes) after the copy, or -1 if the copy would have copied more data than in the stream

Definition at line 289 of file IPlugStructs.h.

References GetBytes().

Referenced by IBMeterControl::OnMsgFromDelegate(), IRTTextControl< MAXNC, T >::OnMsgFromDelegate(), IVDisplayControl::OnMsgFromDelegate(), IVMeterControl< MAXNC >::OnMsgFromDelegate(), IVPeakAvgMeterControl< MAXNC >::OnMsgFromDelegate(), and IVScopeControl< MAXNC, MAXBUF >::OnMsgFromDelegate().

◆ GetBytes()

int IByteStream::GetBytes ( void *  pDst,
int  nBytesToCopy,
int  startPos 
) const
inline

Copy raw bytes from the stream, returning the new position for subsequent calls.

Parameters
pDstThe destination buffer
nBytesToCopyThe number of bytes to copy from the stream
startPosThe starting position in bytes in the stream
Returns
int The end position in the stream (in bytes) after the copy, or -1 if the copy would have copied more data than in the stream

Definition at line 278 of file IPlugStructs.h.

References IByteGetter::GetBytes(), and Size().

Referenced by Get().

◆ GetData()

const uint8_t * IByteStream::GetData ( )
inline

Gets a const ptr to the stream data.

Returns
uint8_t* const ptr to the stream data

Definition at line 320 of file IPlugStructs.h.

◆ GetStr()

int IByteStream::GetStr ( WDL_String &  str,
int  startPos 
) const
inline

Get a string from the stream.

Parameters
strWDL_String to fill
startPosThe starting position in bytes in the stream
Returns
int The end position in the stream (in bytes) after the copy, or -1 if the copy would have copied more data than in the stream

Definition at line 298 of file IPlugStructs.h.

References IByteGetter::GetStr(), and Size().

◆ IsEqual()

bool IByteStream::IsEqual ( IByteStream otherStream) const
inline

Compares the size & values of the data of another stream with this one.

Parameters
otherChunkThe stream to compare with
Returns
true if the streams are equal

Definition at line 313 of file IPlugStructs.h.

References Size().

◆ Size()

int IByteStream::Size ( ) const
inline

Returns the size of the stream.

Returns
size (in bytes)

Definition at line 305 of file IPlugStructs.h.

Referenced by GetBytes(), GetStr(), and IsEqual().


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