version 1.19, 2002/07/23 21:39:31
|
version 1.20, 2002/08/20 17:39:37
|
|
|
PEGASUS_ARRAY_T& Array<PEGASUS_ARRAY_T>::operator[](Uint32 pos) | PEGASUS_ARRAY_T& Array<PEGASUS_ARRAY_T>::operator[](Uint32 pos) |
{ | { |
if (pos >= size()) | if (pos >= size()) |
throw OutOfBounds(); |
throw IndexOutOfBoundsException(); |
| |
return static_cast<ArrayRep<PEGASUS_ARRAY_T>*>(_rep)->data()[pos]; | return static_cast<ArrayRep<PEGASUS_ARRAY_T>*>(_rep)->data()[pos]; |
} | } |
|
|
const PEGASUS_ARRAY_T& Array<PEGASUS_ARRAY_T>::operator[](Uint32 pos) const | const PEGASUS_ARRAY_T& Array<PEGASUS_ARRAY_T>::operator[](Uint32 pos) const |
{ | { |
if (pos >= size()) | if (pos >= size()) |
throw OutOfBounds(); |
throw IndexOutOfBoundsException(); |
| |
return static_cast<ArrayRep<PEGASUS_ARRAY_T>*>(_rep)->data()[pos]; | return static_cast<ArrayRep<PEGASUS_ARRAY_T>*>(_rep)->data()[pos]; |
} | } |
|
|
void Array<PEGASUS_ARRAY_T>::insert(Uint32 pos, const PEGASUS_ARRAY_T* x, Uint32 size) | void Array<PEGASUS_ARRAY_T>::insert(Uint32 pos, const PEGASUS_ARRAY_T* x, Uint32 size) |
{ | { |
if (pos > this->size()) | if (pos > this->size()) |
throw OutOfBounds(); |
throw IndexOutOfBoundsException(); |
| |
reserveCapacity(this->size() + size); | reserveCapacity(this->size() + size); |
| |
|
|
void Array<PEGASUS_ARRAY_T>::remove(Uint32 pos, Uint32 size) | void Array<PEGASUS_ARRAY_T>::remove(Uint32 pos, Uint32 size) |
{ | { |
if (pos + size - 1 > this->size()) | if (pos + size - 1 > this->size()) |
throw OutOfBounds(); |
throw IndexOutOfBoundsException(); |
| |
Destroy(_data() + pos, size); | Destroy(_data() + pos, size); |
| |