EMA C++ Edition
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
List of all members | Protected Member Functions | Protected Attributes
thomsonreuters::ema::access::EmaBuffer Class Reference

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

Public Member Functions

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

Protected Member Functions

void markDirty () const
 

Protected Attributes

UInt32 _capacity
 
UInt32 _length
 
char * _pBuffer
 
CastingOperatorContext * _pCastingOperatorContext
 

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

thomsonreuters::ema::access::EmaBuffer::EmaBuffer ( )

Constructs EmaBuffer.

thomsonreuters::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
thomsonreuters::ema::access::EmaBuffer::EmaBuffer ( const EmaBuffer buf)

Copy constructor.

Exceptions
OmmMemoryExhaustionExceptionif application runs out of memory
Parameters
[in]bufcopied in EmaBuffer object
virtual thomsonreuters::ema::access::EmaBuffer::~EmaBuffer ( )
virtual

Destructor.

Member Function Documentation

EmaBuffer& thomsonreuters::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
EmaBuffer& thomsonreuters::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
EmaBuffer& thomsonreuters::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
const char* thomsonreuters::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
const char* thomsonreuters::ema::access::EmaBuffer::c_buf ( ) const

Returns pointer to the internal storage memory

Returns
pointer to the internal memory area containing buffer data
EmaBuffer& thomsonreuters::ema::access::EmaBuffer::clear ( )

Clears contained buffer.

Returns
reference to this object
UInt32 thomsonreuters::ema::access::EmaBuffer::length ( ) const

Returns length of the internal storage memory.

Returns
length of the internal buffer
void thomsonreuters::ema::access::EmaBuffer::markDirty ( ) const
protected
thomsonreuters::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
EmaBuffer& thomsonreuters::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
EmaBuffer& thomsonreuters::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
EmaBuffer& thomsonreuters::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
bool thomsonreuters::ema::access::EmaBuffer::operator== ( const EmaBuffer buf) const

Compare operator.

Parameters
[in]bufcompared EmaBuffer object
Returns
true if this and passed in object match
char& thomsonreuters::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
char thomsonreuters::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
EmaBuffer& thomsonreuters::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

Member Data Documentation

UInt32 thomsonreuters::ema::access::EmaBuffer::_capacity
protected

Definition at line 171 of file EmaBuffer.h.

UInt32 thomsonreuters::ema::access::EmaBuffer::_length
protected

Definition at line 170 of file EmaBuffer.h.

char* thomsonreuters::ema::access::EmaBuffer::_pBuffer
protected

Definition at line 169 of file EmaBuffer.h.

CastingOperatorContext* thomsonreuters::ema::access::EmaBuffer::_pCastingOperatorContext
mutableprotected

Definition at line 172 of file EmaBuffer.h.