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