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)
105 explicit Array(
V* toWrap);
121 Array(
int n,
const T& value);
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;
#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.
V::const_iterator const_iterator
void append(const T &x)
Append an element to the end of the Array.
reverse_iterator rbegin()
V::const_reference const_reference
void remove(size_type index)
Remove an element from the Array at a given index.
void push_back(const T &x)
Append an element to the end of the Array.
void appendArray(const Array< T > &x)
Append the elements of another Array to the end of this Array.
iterator erase(iterator position)
Remove an element of the Array specified with an iterator.
size_type max_size() const
friend bool operator==(const Array< T > &x, const Array< T > &y)
Determine equality of two Arrays.
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 clear()
Remove all items from the Array.
V::const_reverse_iterator const_reverse_iterator
Array()
Default Constructor.
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< 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.
V::reverse_iterator reverse_iterator
std::vector< T, std::allocator< T > > V
void reserve(size_type n)
Ensure the capacity is at least the size of a given value.
V::const_pointer const_pointer
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.
V::difference_type difference_type
size_type capacity() const
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.