9#ifndef __refinitiv_ema_access_EmaVector_h
10#define __refinitiv_ema_access_EmaVector_h
136 EmaVectorException(
const EmaString& text)
141 virtual ~~EmaVectorException(){}
143 EmaVectorException(
const EmaVectorException& other) :
146 EmaVectorException&
operator=(
const EmaVectorException& other)
148 if (
this == &other)
return *
this;
162 _capacity( capacity ),
165 if ( !_capacity )
return;
167 _list =
new T[ (
unsigned int)_capacity ];
172 _capacity( other._capacity ),
176 if ( ! _capacity )
return;
180 _list =
new T[ (
unsigned int)_capacity ];
182 for (
UInt32 pos = 0; pos < _size; ++pos )
184 _list[pos] = other._list[pos];
191 if (
this == &other )
return *
this;
193 if ( _capacity >= other._size )
197 for (
UInt32 pos = 0; pos < _size; ++pos )
199 _list[pos] = other._list[pos];
204 if ( _list )
delete [] _list;
206 _capacity = other._capacity;
209 _list =
new T[ (
unsigned int)(_capacity) ];
211 for (
UInt32 pos = 0; pos < _size; ++pos )
213 _list[pos] = other._list[pos];
223 if ( _size != other._size )
return false;
225 for (
UInt32 pos = 0; pos < _size; ++pos )
227 if ( ! ( _list[pos] == other._list[pos] ) )
return false;
238 if ( _list )
delete [] _list;
250 if ( _size < _capacity )
252 _list[_size] = entry;
258 if ( _capacity == 0 )
264 _capacity = 2 * _capacity;
269 tempList =
new T[ (
unsigned int)(_capacity)];
271 for ( i = 0; i < _size; i++ )
272 tempList[i] = _list[i];
274 if ( _list )
delete [] _list;
278 _list[ _size ] = entry;
298 if (position >= _size)
300 EmaVectorException exception(
"Passed in position is out of range.");
304 return _list[position];
310 if (position >= _size)
312 EmaVectorException exception(
"Passed in position is out of range.");
316 return _list[position];
324 for (
UInt32 idx = 0; idx < _size; ++idx )
326 if (
operator[]( idx ) == value )
328 position = (
Int64)(idx);
339 if ( position >= _size )
return false;
341 for (
UInt32 i = position + 1; i < _size; ++i )
343 _list[ i - 1 ] = _list[ i ];
356 while ( i < _size &&
operator[]( i ) != value )
360 for ( ++i; i < _size; ++i )
361 _list[ i - 1 ] = _list[ i ];
369 return ( _size ) ? false :
true;
*|--------------------------------------------------------------------------—
unsigned int UInt32
represents 32-bit unsigned integer
long long Int64
represents 64-bit signed integer
The access namespace contains all interfaces and definitions specified for use with the EMA Access pa...
The ema namespace contains all interfaces and definitions specified for use with EMA.
EmaString class is a container of a null terminated Ascii character string.
EmaVector class provides template vector implementation.
EmaVector< T > & operator=(const EmaVector< T > &other)
EmaVector(UInt32 capacity=0)
Int64 getPositionOf(const T &value) const
bool removeValue(const T &value)
bool operator==(const EmaVector< T > &other) const
void push_back(const T &entry)
bool removePosition(UInt32 pos)
const T & operator[](UInt32 index) const
OmmException & statusText(const EmaString &statusText)
OmmException & operator=(const OmmException &)
OmmOutOfRangeException is thrown when a passed in method argument is out of range.