EMA C++ Edition
List of all members
refinitiv::ema::access::EmaBuffer Class Reference

EmaBuffer represents a general use binary buffer. More...

Public Member Functions

Constructor
 EmaBuffer ()
  More...
 
 EmaBuffer (const char *buf, UInt32 length)
  More...
 
 EmaBuffer (const EmaBuffer &buf)
  More...
 
Destructor
virtual ~EmaBuffer ()
  More...
 
Operations
EmaBufferclear ()
  More...
 
EmaBufferoperator= (const EmaBuffer &buf)
  More...
 
EmaBuffersetFrom (const char *buf, UInt32 length)
  More...
 
EmaBufferappend (const EmaBuffer &buf)
  More...
 
EmaBufferappend (char c)
  More...
 
EmaBufferappend (const char *buf, UInt32 length)
  More...
 
EmaBufferoperator+= (const EmaBuffer &buf)
  More...
 
EmaBufferoperator+= (char)
  More...
 
char & operator[] (UInt32 index)
  More...
 

Accessors

char * _pBuffer
 
UInt32 _length
 
UInt32 _capacity
 
CastingOperatorContext * _pCastingOperatorContext
 
const char * c_buf () const
  More...
 
UInt32 length () const
  More...
 
const char * asRawHexString () const
  More...
 
 operator const char * () const
  More...
 
bool operator== (const EmaBuffer &buf) const
  More...
 
char operator[] (UInt32 index) const
  More...
 
void markDirty () const
 

Detailed Description

EmaBuffer is a buffer of 8 bit long characters where each character is represented by char or byte.

Remarks
EmaBuffer class contains a copy of the passed in buffer.
All methods in this class are Lock-free Method.

Definition at line 32 of file EmaBuffer.h.

Constructor & Destructor Documentation

◆ EmaBuffer() [1/3]

refinitiv::ema::access::EmaBuffer::EmaBuffer ( )

Constructs EmaBuffer.

◆ EmaBuffer() [2/3]

refinitiv::ema::access::EmaBuffer::EmaBuffer ( const char *  buf,
UInt32  length 
)

Assignment constructor

Exceptions
OmmMemoryExhaustionExceptionif application runs out of memory
Parameters
[in]bufpointer to the memory containing copied in buffer
[in]lengthspecifies number of characters to copy

◆ EmaBuffer() [3/3]

refinitiv::ema::access::EmaBuffer::EmaBuffer ( const EmaBuffer buf)

Copy constructor.

Exceptions
OmmMemoryExhaustionExceptionif application runs out of memory
Parameters
[in]bufcopied in EmaBuffer object

◆ ~EmaBuffer()

virtual refinitiv::ema::access::EmaBuffer::~EmaBuffer ( )
virtual

Destructor.

Member Function Documentation

◆ append() [1/3]

EmaBuffer& refinitiv::ema::access::EmaBuffer::append ( char  c)

method to append this object with the passed in char

Exceptions
OmmMemoryExhaustionExceptionif application runs out of memory
Parameters
[in]ccharacter to append to this object
Returns
reference to this object

◆ append() [2/3]

EmaBuffer& refinitiv::ema::access::EmaBuffer::append ( const char *  buf,
UInt32  length 
)

method to append this object with the passed in char buffer

Exceptions
OmmMemoryExhaustionExceptionif application runs out of memory
Parameters
[in]bufpointer to the memory containing appended buffer
[in]lengthspecifies number of characters to append
Returns
reference to this object

◆ append() [3/3]

EmaBuffer& refinitiv::ema::access::EmaBuffer::append ( const EmaBuffer buf)

method to append this object with the passed in EmaBuffer object

Exceptions
OmmMemoryExhaustionExceptionif application runs out of memory
Parameters
[in]bufEmaBuffer to append to this object
Returns
reference to this object

◆ asRawHexString()

const char* refinitiv::ema::access::EmaBuffer::asRawHexString ( ) const

Returns an alphanumeric null-terminated hexadecimal string representation.

Returns
const char pointer used for printing out content of the internal buffer to screen

◆ c_buf()

const char* refinitiv::ema::access::EmaBuffer::c_buf ( ) const

Returns pointer to the internal storage memory

Returns
pointer to the internal memory area containing buffer data

◆ clear()

EmaBuffer& refinitiv::ema::access::EmaBuffer::clear ( )

Clears contained buffer.

Returns
reference to this object

◆ length()

UInt32 refinitiv::ema::access::EmaBuffer::length ( ) const

Returns length of the internal storage memory.

Returns
length of the internal buffer

◆ operator const char *()

refinitiv::ema::access::EmaBuffer::operator const char * ( ) const

Returns an alphanumeric null-terminated hexadecimal string representation via conversion to operator const char*.

Returns
const char pointer used for printing out content of the internal buffer to screen

◆ operator+=() [1/2]

EmaBuffer& refinitiv::ema::access::EmaBuffer::operator+= ( char  )

method to append this object with the passed in char

Exceptions
OmmMemoryExhaustionExceptionif application runs out of memory
Parameters
[in]ccharacter to append to this object
Returns
reference to this object

◆ operator+=() [2/2]

EmaBuffer& refinitiv::ema::access::EmaBuffer::operator+= ( const EmaBuffer buf)

method to append this object with the passed in EmaBuffer object

Exceptions
OmmMemoryExhaustionExceptionif application runs out of memory
Parameters
[in]bufEmaBuffer to append to this object
Returns
reference to this object

◆ operator=()

EmaBuffer& refinitiv::ema::access::EmaBuffer::operator= ( const EmaBuffer buf)

Assignment operator.

Exceptions
OmmMemoryExhaustionExceptionif application runs out of memory
Parameters
[in]bufcopied in EmaBuffer object
Returns
reference to this object

◆ operator==()

bool refinitiv::ema::access::EmaBuffer::operator== ( const EmaBuffer buf) const

Compare operator.

Parameters
[in]bufcompared EmaBuffer object
Returns
true if this and passed in object match

◆ operator[]() [1/2]

char& refinitiv::ema::access::EmaBuffer::operator[] ( UInt32  index)

read write index operator

Exceptions
OmmOutOfRangeExceptionif passed in index is greater than the length of the contained buffer
Parameters
[in]indexspecifies position to read or write
Returns
reference to the byte at the specified position

◆ operator[]() [2/2]

char refinitiv::ema::access::EmaBuffer::operator[] ( UInt32  index) const

read only index operator

Exceptions
OmmOutOfRangeExceptionif passed in index is greater than the length of the contained buffer
Parameters
[in]indexspecifies position to read
Returns
byte at the specified position

◆ setFrom()

EmaBuffer& refinitiv::ema::access::EmaBuffer::setFrom ( const char *  buf,
UInt32  length 
)

Method to set Buffer.

Exceptions
OmmMemoryExhaustionExceptionif application runs out of memory
Parameters
[in]bufpointer to the memory are containing copied in buffer
[in]lengthspecifies number of characters to copy
Returns
reference to this object