Go to the documentation of this file.
40 #ifndef BLOCXX_ARRAY_HPP_INCLUDE_GUARD_
41 #define BLOCXX_ARRAY_HPP_INCLUDE_GUARD_
42 #include "blocxx/BLOCXX_config.h"
65 template<
class T>
class Array
67 typedef std::vector<T, std::allocator<T> >
V;
70 #pragma warning (push)
71 #pragma warning (disable: 4251)
82 typedef typename V::pointer
pointer;
84 typedef typename V::iterator
iterator;
105 explicit Array(
V* toWrap);
129 Array(
long n,
const T& value);
142 template<
class InputIterator>
143 Array(InputIterator first, InputIterator last);
304 template<
class InputIterator>
305 void insert(
iterator position, InputIterator first, InputIterator last);
432 #ifdef BLOCXX_CHECK_ARRAY_INDEXING
433 void checkValidIndex(
size_type index)
const;
469 inline bool operator <= (
const Array<T>& x,
const Array<T>& y)
492 inline bool operator >= (
const Array<T>& x,
const Array<T>& y)
515 inline bool operator > (
const Array<T>& x,
const Array<T>& y)
V::const_reverse_iterator const_reverse_iterator
Array< Int16 > Int16Array
V::reverse_iterator reverse_iterator
bool operator>=(const Array< T > &x, const Array< T > &y)
Determine if one Array is greater than or equal to another.
bool contains(const T &x, const_iterator first, const_iterator last) const
Determine if element x is contained in the array range specified by the first and last iterators.
void remove(size_type index)
Remove an element from the Array at a given index.
Array< UInt32 > UInt32Array
void appendArray(const Array< T > &x)
Append the elements of another Array to the end of this Array.
bool operator!=(const Array< T > &x, const Array< T > &y)
Determine two Arrays are not equal.
Array< UInt8 > UInt8Array
size_type max_size() const
Array< Real64 > Real64Array
Array< T > & operator+=(const T &x)
Append an object to the end of the Array.
reverse_iterator rbegin()
Array< Real32 > Real32Array
V::const_iterator const_iterator
void swap(Array< T > &x)
Swap the elements of this Array with the elements of another.
Array< UInt64 > UInt64Array
Array< UInt16 > UInt16Array
std::vector< T, std::allocator< T > > V
const_iterator find(const T &x, const_iterator first, const_iterator last) const
Find element x in the array range specified by the first and last iterators.
#define BLOCXX_DECLARE_APIEXCEPTION(NAME, LINKAGE_SPEC)
Declare a new exception class named <NAME>Exception that derives from Exception This macro is typical...
void pop_back()
Remove the last element of the Array.
void append(const T &x)
Append an element to the end of the Array.
void resize(size_type new_size, const T &x)
Ensure the Array is a given size.
reference operator[](size_type n)
Retrieve A read/write reference to an object in the Array at a given index.
void clear()
Remove all items from the Array.
Array< Int64 > Int64Array
V::const_reference const_reference
iterator erase(iterator position)
Remove an element of the Array specified with an iterator.
iterator insert(iterator position, const T &x)
Insert an element in the Array before an element specified by an iterator.
V::const_pointer const_pointer
size_type capacity() const
void reserve(size_type n)
Ensure the capacity is at least the size of a given value.
Array()
Default Constructor.
Array< Int32 > Int32Array
void push_back(const T &x)
Append an element to the end of the Array.
Array<> wraps std::vector<> in COWReference<> adding ref counting and copy on write capability.
bool operator<=(const Array< T > &x, const Array< T > &y)
Determine if one Array is less than or equal to another.
V::difference_type difference_type
bool operator>(const Array< T > &x, const Array< T > &y)
Determine if one Array is greater than another.