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

EmaBufferU16 represents general use binary buffer. More...

Public Member Functions

Constructor
 EmaBufferU16 ()
 
 EmaBufferU16 (const UInt16 *buf, UInt32 length)
 
 EmaBufferU16 (const EmaBufferU16 &buf)
 
Destructor
virtual ~EmaBufferU16 ()
 
Operations
EmaBufferU16clear ()
 
EmaBufferU16operator= (const EmaBufferU16 &buf)
 
EmaBufferU16setFrom (const UInt16 *buf, UInt32 length)
 
EmaBufferU16append (const EmaBufferU16 &buf)
 
EmaBufferU16append (UInt16 c)
 
EmaBufferU16append (const UInt16 *buf, UInt32 length)
 
EmaBufferU16operator+= (const EmaBufferU16 &buf)
 
EmaBufferU16operator+= (UInt16)
 
UInt16operator[] (UInt32 index)
 
Accessors
const UInt16u16_buf () const
 
UInt32 length () const
 
bool operator== (const EmaBufferU16 &buf) const
 
UInt16 operator[] (UInt32 index) const
 

Protected Attributes

UInt32 _capacity
 
UInt32 _length
 
UInt16_pBuffer
 

Detailed Description

EmaBufferU16 is a buffer of 16 bit long characters where each character is represented by UInt16. EmaBufferU16 is used to contain UTF16 data.

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

Definition at line 31 of file EmaBufferU16.h.

Constructor & Destructor Documentation

thomsonreuters::ema::access::EmaBufferU16::EmaBufferU16 ( )

Constructs EmaBufferU16

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

Copy constructor.

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

Destructor.

Member Function Documentation

EmaBufferU16& thomsonreuters::ema::access::EmaBufferU16::append ( const EmaBufferU16 buf)

method to append this object with the passed in EmaBufferU16 object

Exceptions
OmmMemoryExhaustionExceptionif application runs out of memory
Parameters
[in]bufEmaBufferU16 to append to this object
Returns
reference to this object
EmaBufferU16& thomsonreuters::ema::access::EmaBufferU16::append ( UInt16  c)

method to append this object with the passed in 16 byte long character

Exceptions
OmmMemoryExhaustionExceptionif application runs out of memory
Parameters
[in]ccharacter to append to this object
Returns
reference to this object
EmaBufferU16& thomsonreuters::ema::access::EmaBufferU16::append ( const UInt16 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
EmaBufferU16& thomsonreuters::ema::access::EmaBufferU16::clear ( )

Clears contained buffer.

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

Returns length of the internal storage memory.

Returns
length of the internal buffer
EmaBufferU16& thomsonreuters::ema::access::EmaBufferU16::operator+= ( const EmaBufferU16 buf)

method to append this object with the passed in EmaBufferU16 object

Exceptions
OmmMemoryExhaustionExceptionif application runs out of memory
Parameters
[in]bufEmaBuffer to append to this object
Returns
reference to this object
EmaBufferU16& thomsonreuters::ema::access::EmaBufferU16::operator+= ( UInt16  )

method to append this object with the passed in 16 byte long char

Exceptions
OmmMemoryExhaustionExceptionif application runs out of memory
Parameters
[in]ccharacter to append to this object
Returns
reference to this object
EmaBufferU16& thomsonreuters::ema::access::EmaBufferU16::operator= ( const EmaBufferU16 buf)

Assignment operator.

Exceptions
OmmMemoryExhaustionExceptionif application runs out of memory
Parameters
[in]bufcopied in EmaBufferU16 object
Returns
reference to this object
bool thomsonreuters::ema::access::EmaBufferU16::operator== ( const EmaBufferU16 buf) const

Compare operator.

Parameters
[in]bufcompared EmaBufferU16 object
Returns
true if this and passed in object match
UInt16& thomsonreuters::ema::access::EmaBufferU16::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
UInt16 thomsonreuters::ema::access::EmaBufferU16::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
EmaBufferU16& thomsonreuters::ema::access::EmaBufferU16::setFrom ( const UInt16 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
const UInt16* thomsonreuters::ema::access::EmaBufferU16::u16_buf ( ) const

Returns pointer to the internal storage memory

Returns
pointer to the internal memory area containing buffer data

Member Data Documentation

UInt32 thomsonreuters::ema::access::EmaBufferU16::_capacity
protected

Definition at line 158 of file EmaBufferU16.h.

UInt32 thomsonreuters::ema::access::EmaBufferU16::_length
protected

Definition at line 157 of file EmaBufferU16.h.

UInt16* thomsonreuters::ema::access::EmaBufferU16::_pBuffer
protected

Definition at line 156 of file EmaBufferU16.h.