Dynalib Utils
Public Member Functions | Static Public Attributes | List of all members
DynaBuffer Class Reference

#include <DynaBuffer.h>

Inheritance diagram for DynaBuffer:
Inheritance graph
[legend]
Collaboration diagram for DynaBuffer:
Collaboration graph
[legend]

Public Member Functions

 DynaBuffer ()
 
 DynaBuffer (uint size, bool zeroOut=false)
 
virtual ~DynaBuffer ()
 
 DynaBuffer (const DynaBuffer &other)
 
DynaBuffercopy () override
 
uint8_t * getInternalTypedArray ()
 
void * getInternalRawArray ()
 
uint8_t * getInternalTypedArrayAtPos (ulong pos)
 
void reset ()
 
void clear ()
 
void zeroFill (int fromIndex=0, int toIndex=-1)
 
bool isDirty ()
 
void setIsDirty (bool isDirty)
 
uint getPos () const
 
bool setPos (uint pos)
 
uint adjustPos (int delta)
 
bool insertRegion (int index, int count)
 
bool deleteRegion (int index, int count)
 
void setElemMode (uint headerSize, uint elemSize)
 
ulong getElemPos (int index)
 
uint getElemCapacity ()
 
uint getElemCount ()
 
bool getHeader (uint8_t &headerBuf)
 
bool putHeader (uint8_t &headerBuf)
 
bool getElem (int index, uint8_t &elemBuf)
 
bool setElem (int index, uint8_t &elemBuf)
 
bool getNextElem (uint8_t &elemBuf)
 
bool insertElem (int index, uint8_t &elemBuf)
 
bool insertElems (int index, uint8_t &elemBuf, int count)
 
bool appendElem (uint8_t &elemBuf)
 
bool removeElem (int index, uint8_t &elemBuf)
 
bool deleteElem (int index)
 
bool deleteElems (int frIndex, int toIndex)
 
bool moveElem (int index, int destIndex)
 
bool moveElems (int frIndex, int toIndex, int destIndex)
 
bool moveElems (int frIndex, int toIndex, DynaBuffer *dest, int destIndex)
 Move element from one Buffer to Another one. More...
 
void invalidate ()
 
bool isEmpty ()
 
bool isFull ()
 
bool hasCapacity ()
 
bool hasRemainingCapacity (uint count)
 
uint getRemainingCapacity () const
 
bool hasRemaining (uint count)
 
uint getRemaining () const
 
bool requiresRemaining (uint count)
 
uint getBufEnd () const
 
void setBufEnd (uint count)
 
uint getBufferSize () const
 
void setBufferSize (uint bufSize)
 
bool hasNextByte ()
 
uint8_t getNextByte ()
 
uint8_t popLastByte ()
 
short getNextShort ()
 
ushort getNextUShort ()
 
int getNextInt ()
 
uint getNextUInt ()
 
long getNextLong ()
 
ulong getNextULong ()
 
long long getNextLongLong ()
 
ulonglong getNextULongLong ()
 
int64_t getNextInt64 ()
 
uint64_t getNextUInt64 ()
 
index_t getNextIndex ()
 
UUID getNextUUID ()
 
float getNextFloat ()
 
double getNextDouble ()
 
long double getNextLongDouble ()
 
bool getNextString (char *buf, uint count, bool addTerm)
 
void getNextString (char *buf, uint maxCount)
 
bool getNextString (String &str, uint maxCount=0)
 
bool getNextLine (String &str)
 
bool getNextBuffer (byte *buf, uint offset, uint count)
 
bool getNextToken (String &str, char delim, uint maxCount=0)
 
String getBufferAsString ()
 
void _putByte (uint8_t value)
 
bool putByte (uint8_t value)
 
bool putShort (short value)
 
bool putUShort (ushort value)
 
bool putInt (int value)
 
bool putUInt (uint value)
 
bool putLong (long value)
 
bool putULong (ulong value)
 
bool putLongLong (long long value)
 
bool putULongLong (ulonglong value)
 
bool putInt64 (int64_t value)
 
bool putUInt64 (uint64_t value)
 
bool putIndex (index_t value)
 
bool putUUID (UUID *value)
 
bool putFloat (float value)
 
bool putDouble (double value)
 
bool putLongDouble (long double value)
 
bool putString (const char *value, uint maxCount=0, bool addTerm=true)
 
bool putString (const String &strValue, uint maxCount=0, bool addTerm=true)
 
bool putBuffer (uint8_t *buf, uint offset, uint count)
 

Static Public Attributes

static bool THROW_EXCEPTIONS = true
 

Constructor & Destructor Documentation

◆ DynaBuffer() [1/3]

DynaBuffer::DynaBuffer ( )

◆ DynaBuffer() [2/3]

DynaBuffer::DynaBuffer ( uint  size,
bool  zeroOut = false 
)
explicit

◆ ~DynaBuffer()

DynaBuffer::~DynaBuffer ( )
virtual

◆ DynaBuffer() [3/3]

DynaBuffer::DynaBuffer ( const DynaBuffer other)

Member Function Documentation

◆ _putByte()

void DynaBuffer::_putByte ( uint8_t  value)
inline

◆ adjustPos()

uint DynaBuffer::adjustPos ( int  delta)

◆ appendElem()

bool DynaBuffer::appendElem ( uint8_t &  elemBuf)

◆ clear()

void DynaBuffer::clear ( )

◆ copy()

DynaBuffer * DynaBuffer::copy ( )
overridevirtual

◆ deleteElem()

bool DynaBuffer::deleteElem ( int  index)

◆ deleteElems()

bool DynaBuffer::deleteElems ( int  frIndex,
int  toIndex 
)

◆ deleteRegion()

bool DynaBuffer::deleteRegion ( int  index,
int  count 
)

◆ getBufEnd()

uint DynaBuffer::getBufEnd ( ) const

◆ getBufferAsString()

String DynaBuffer::getBufferAsString ( )

◆ getBufferSize()

uint DynaBuffer::getBufferSize ( ) const

◆ getElem()

bool DynaBuffer::getElem ( int  index,
uint8_t &  elemBuf 
)

◆ getElemCapacity()

uint DynaBuffer::getElemCapacity ( )

◆ getElemCount()

uint DynaBuffer::getElemCount ( )

◆ getElemPos()

ulong DynaBuffer::getElemPos ( int  index)
inline

◆ getHeader()

bool DynaBuffer::getHeader ( uint8_t &  headerBuf)

◆ getInternalRawArray()

void* DynaBuffer::getInternalRawArray ( )
inline

◆ getInternalTypedArray()

uint8_t* DynaBuffer::getInternalTypedArray ( )
inline

◆ getInternalTypedArrayAtPos()

uint8_t* DynaBuffer::getInternalTypedArrayAtPos ( ulong  pos)
inline

◆ getNextBuffer()

bool DynaBuffer::getNextBuffer ( byte *  buf,
uint  offset,
uint  count 
)

◆ getNextByte()

uint8_t DynaBuffer::getNextByte ( )

◆ getNextDouble()

double DynaBuffer::getNextDouble ( )

◆ getNextElem()

bool DynaBuffer::getNextElem ( uint8_t &  elemBuf)

◆ getNextFloat()

float DynaBuffer::getNextFloat ( )

◆ getNextIndex()

index_t DynaBuffer::getNextIndex ( )

◆ getNextInt()

int DynaBuffer::getNextInt ( )

◆ getNextInt64()

int64_t DynaBuffer::getNextInt64 ( )

◆ getNextLine()

bool DynaBuffer::getNextLine ( String str)

◆ getNextLong()

long DynaBuffer::getNextLong ( )

◆ getNextLongDouble()

long double DynaBuffer::getNextLongDouble ( )

◆ getNextLongLong()

long long DynaBuffer::getNextLongLong ( )

◆ getNextShort()

short DynaBuffer::getNextShort ( )

◆ getNextString() [1/3]

bool DynaBuffer::getNextString ( char *  buf,
uint  count,
bool  addTerm 
)

◆ getNextString() [2/3]

void DynaBuffer::getNextString ( char *  buf,
uint  maxCount 
)

◆ getNextString() [3/3]

bool DynaBuffer::getNextString ( String str,
uint  maxCount = 0 
)

◆ getNextToken()

bool DynaBuffer::getNextToken ( String str,
char  delim,
uint  maxCount = 0 
)

◆ getNextUInt()

uint DynaBuffer::getNextUInt ( )

◆ getNextUInt64()

uint64_t DynaBuffer::getNextUInt64 ( )

◆ getNextULong()

ulong DynaBuffer::getNextULong ( )

◆ getNextULongLong()

ulonglong DynaBuffer::getNextULongLong ( )

◆ getNextUShort()

ushort DynaBuffer::getNextUShort ( )

◆ getNextUUID()

UUID DynaBuffer::getNextUUID ( )

◆ getPos()

uint DynaBuffer::getPos ( ) const

◆ getRemaining()

uint DynaBuffer::getRemaining ( ) const

◆ getRemainingCapacity()

uint DynaBuffer::getRemainingCapacity ( ) const

◆ hasCapacity()

bool DynaBuffer::hasCapacity ( )

◆ hasNextByte()

bool DynaBuffer::hasNextByte ( )

◆ hasRemaining()

bool DynaBuffer::hasRemaining ( uint  count)

◆ hasRemainingCapacity()

bool DynaBuffer::hasRemainingCapacity ( uint  count)

◆ insertElem()

bool DynaBuffer::insertElem ( int  index,
uint8_t &  elemBuf 
)

◆ insertElems()

bool DynaBuffer::insertElems ( int  index,
uint8_t &  elemBuf,
int  count 
)

◆ insertRegion()

bool DynaBuffer::insertRegion ( int  index,
int  count 
)

◆ invalidate()

void DynaBuffer::invalidate ( )

◆ isDirty()

bool DynaBuffer::isDirty ( )

◆ isEmpty()

bool DynaBuffer::isEmpty ( )

◆ isFull()

bool DynaBuffer::isFull ( )

◆ moveElem()

bool DynaBuffer::moveElem ( int  index,
int  destIndex 
)

◆ moveElems() [1/2]

bool DynaBuffer::moveElems ( int  frIndex,
int  toIndex,
int  destIndex 
)

◆ moveElems() [2/2]

bool DynaBuffer::moveElems ( int  frIndex,
int  toIndex,
DynaBuffer dest,
int  destIndex 
)

Move element from one Buffer to Another one.

Parameters
frIndexstarting element index in source buffer
toIndexend element (cinclusive) in source buffer
destdestination buffer pointer
destIndexdestination index int which insert he items
Returns
true if current buffer not empty and is move successed
false if current buffer is empty

◆ popLastByte()

uint8_t DynaBuffer::popLastByte ( )

◆ putBuffer()

bool DynaBuffer::putBuffer ( uint8_t *  buf,
uint  offset,
uint  count 
)

◆ putByte()

bool DynaBuffer::putByte ( uint8_t  value)

◆ putDouble()

bool DynaBuffer::putDouble ( double  value)

◆ putFloat()

bool DynaBuffer::putFloat ( float  value)

◆ putHeader()

bool DynaBuffer::putHeader ( uint8_t &  headerBuf)

◆ putIndex()

bool DynaBuffer::putIndex ( index_t  value)

◆ putInt()

bool DynaBuffer::putInt ( int  value)

◆ putInt64()

bool DynaBuffer::putInt64 ( int64_t  value)

◆ putLong()

bool DynaBuffer::putLong ( long  value)

◆ putLongDouble()

bool DynaBuffer::putLongDouble ( long double  value)

◆ putLongLong()

bool DynaBuffer::putLongLong ( long long  value)

◆ putShort()

bool DynaBuffer::putShort ( short  value)

◆ putString() [1/2]

bool DynaBuffer::putString ( const char *  value,
uint  maxCount = 0,
bool  addTerm = true 
)

◆ putString() [2/2]

bool DynaBuffer::putString ( const String strValue,
uint  maxCount = 0,
bool  addTerm = true 
)

◆ putUInt()

bool DynaBuffer::putUInt ( uint  value)

◆ putUInt64()

bool DynaBuffer::putUInt64 ( uint64_t  value)

◆ putULong()

bool DynaBuffer::putULong ( ulong  value)

◆ putULongLong()

bool DynaBuffer::putULongLong ( ulonglong  value)

◆ putUShort()

bool DynaBuffer::putUShort ( ushort  value)

◆ putUUID()

bool DynaBuffer::putUUID ( UUID value)

◆ removeElem()

bool DynaBuffer::removeElem ( int  index,
uint8_t &  elemBuf 
)

◆ requiresRemaining()

bool DynaBuffer::requiresRemaining ( uint  count)

◆ reset()

void DynaBuffer::reset ( )

◆ setBufEnd()

void DynaBuffer::setBufEnd ( uint  count)

◆ setBufferSize()

void DynaBuffer::setBufferSize ( uint  bufSize)

◆ setElem()

bool DynaBuffer::setElem ( int  index,
uint8_t &  elemBuf 
)

◆ setElemMode()

void DynaBuffer::setElemMode ( uint  headerSize,
uint  elemSize 
)

◆ setIsDirty()

void DynaBuffer::setIsDirty ( bool  isDirty)

◆ setPos()

bool DynaBuffer::setPos ( uint  pos)

◆ zeroFill()

void DynaBuffer::zeroFill ( int  fromIndex = 0,
int  toIndex = -1 
)

Member Data Documentation

◆ THROW_EXCEPTIONS

bool DynaBuffer::THROW_EXCEPTIONS = true
static

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