23 #ifndef __ccxx_DynamicArray_hxx 24 #define __ccxx_DynamicArray_hxx 82 _data = (_size > 0) ?
new T[_size] : NULL;
87 std::memcpy(reinterpret_cast<void *>(_data),
88 reinterpret_cast<void *>(old),
111 {
return(_data == NULL); }
144 if((index < 0) || (index >= static_cast<int>(_size)))
147 return(_data[index]);
156 if((index < 0) || (index >= static_cast<int>(_size)))
159 return(_data[index]);
167 operator const T*()
const 181 {
return(_data + _size); }
183 const_iterator
end()
const 184 {
return(_data + _size); }
194 #endif // __ccxx_DynamicArray_hxx T * iterator
Definition: DynamicArray.h++:46
const T & const_reference
Definition: DynamicArray.h++:49
const_iterator begin() const
Definition: DynamicArray.h++:177
const T * const_iterator
Definition: DynamicArray.h++:47
A simple object wrapper for dynamically-allocated arrays.
Definition: DynamicArray.h++:41
T * data()
Get the underlying array.
Definition: DynamicArray.h++:118
~DynamicArray()
Destructor.
Definition: DynamicArray.h++:64
unsigned int uint_t
An alias for unsigned int.
Definition: Integers.h++:74
const T * data() const
Get the underlying array.
Definition: DynamicArray.h++:126
bool isNull() const
Determine if this array is NULL.
Definition: DynamicArray.h++:110
DynamicArray(uint_t size)
Construct a new DynamicArray with the given initial size.
Definition: DynamicArray.h++:56
T & operator[](int index)
Index operator.
Definition: DynamicArray.h++:142
const_iterator end() const
Definition: DynamicArray.h++:183
void resize(uint_t size, bool copy=false)
Resize the array to a new size.
Definition: DynamicArray.h++:76
T & reference
Definition: DynamicArray.h++:48
T value_type
Definition: DynamicArray.h++:45
uint_t size() const
Get the size of the array.
Definition: DynamicArray.h++:134
An exception indicating that an attempted operation would result in an out-of-range array index acces...
Definition: OutOfBoundsException.h++:38
bool operator!() const
Unary NOT operator.
Definition: DynamicArray.h++:171
T operator[](int index) const
Index operator.
Definition: DynamicArray.h++:154
T * release()
Release ownership of the array.
Definition: DynamicArray.h++:100
iterator end()
Definition: DynamicArray.h++:180
Definition: AllocationMap.c++:25
iterator begin()
Definition: DynamicArray.h++:174