Fledge
An open source edge computing platform for industrial users
OMFBuffer Class Reference

Buffer class designed to hold OMF payloads that can grow as required but have minimal copy semantics. More...

#include <omfbuffer.h>

Public Member Functions

 OMFBuffer ()
 Buffer class designed to hold OMF payloads that can as required but have minimal copy semantics. More...
 
 ~OMFBuffer ()
 OMFBuffer destructor.
 
bool isEmpty ()
 
void append (const char)
 Append a character to a buffer. More...
 
void append (const char *)
 Append a character string to a buffer. More...
 
void append (const int)
 Append an integer to a buffer. More...
 
void append (const unsigned int)
 Append an unsigned integer to a buffer. More...
 
void append (const long)
 Append a long to a buffer. More...
 
void append (const unsigned long)
 Append an unsigned long to a buffer. More...
 
void append (const double)
 Append a double to a buffer. More...
 
void append (const std::string &)
 
void quote (const std::string &)
 Quote and append a string to a buffer. More...
 
const char * coalesce ()
 Create a coalesced buffer from the buffer chain. More...
 
void clear ()
 Clear all the buffers from the OMFBuffer and allow it to be reused.
 

Detailed Description

Buffer class designed to hold OMF payloads that can grow as required but have minimal copy semantics.

TODO Add a coalesce and compress public entry point

Constructor & Destructor Documentation

◆ OMFBuffer()

OMFBuffer::OMFBuffer ( )

Buffer class designed to hold OMF payloads that can as required but have minimal copy semantics.

OMFBuffer constructor

Member Function Documentation

◆ append() [1/7]

void OMFBuffer::append ( const char  data)

Append a character to a buffer.

Parameters
dataThe character to append to the buffer

◆ append() [2/7]

void OMFBuffer::append ( const char *  data)

Append a character string to a buffer.

data The string to append to the buffer

◆ append() [3/7]

void OMFBuffer::append ( const int  value)

Append an integer to a buffer.

Parameters
valueThe value to append to the buffer

◆ append() [4/7]

void OMFBuffer::append ( const unsigned int  value)

Append an unsigned integer to a buffer.

Parameters
valueThe unsigned long value to append to the buffer

◆ append() [5/7]

void OMFBuffer::append ( const long  value)

Append a long to a buffer.

Parameters
valueThe long value to append to the buffer

◆ append() [6/7]

void OMFBuffer::append ( const unsigned long  value)

Append an unsigned long to a buffer.

Parameters
valueThe value to append to the buffer

◆ append() [7/7]

void OMFBuffer::append ( const double  value)

Append a double to a buffer.

Parameters
valueThe double value to append to the buffer

◆ coalesce()

const char * OMFBuffer::coalesce ( )

Create a coalesced buffer from the buffer chain.

The buffer returned has been created using the new[] operator and must be deleted by the caller.

Returns
char* The OMF payload in a single buffer

◆ quote()

void OMFBuffer::quote ( const std::string &  )

Quote and append a string to a buffer.

Parameters
strThe string to quote and append to the buffer

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