#include <Array.hpp>
Inheritance diagram for BLOCXX_NAMESPACE::Array< T >:
Public Types | |
typedef V::value_type | value_type |
typedef V::pointer | pointer |
typedef V::const_pointer | const_pointer |
typedef V::iterator | iterator |
typedef V::const_iterator | const_iterator |
typedef V::reference | reference |
typedef V::const_reference | const_reference |
typedef V::size_type | size_type |
typedef V::difference_type | difference_type |
typedef V::reverse_iterator | reverse_iterator |
typedef V::const_reverse_iterator | const_reverse_iterator |
Public Member Functions | |
Array () | |
Default Constructor. | |
~Array () | |
Destructor. | |
Array (V *toWrap) | |
Constructor. | |
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. | |
Array (int n, const T &value) | |
Construct an Array that consist of a specified number of elements that are copies of a given object. | |
Array (long n, const T &value) | |
Construct an Array that consist of a specified number of elements that are copies of a given object. | |
Array (size_type n) | |
Construct an Array that consist of a specified number of elements that have be constructed using the default constructor of class T. | |
template<class InputIterator> | |
Array (InputIterator first, InputIterator last) | |
Construct an Array from a range specified with InputIterators. | |
iterator | begin () |
const_iterator | begin () const |
iterator | end () |
const_iterator | end () const |
reverse_iterator | rbegin () |
const_reverse_iterator | rbegin () const |
reverse_iterator | rend () |
const_reverse_iterator | rend () const |
size_type | size () const |
size_type | max_size () const |
size_type | capacity () const |
bool | empty () const |
reference | operator[] (size_type n) |
Retrieve A read/write reference to an object in the Array at a given index. | |
const_reference | operator[] (size_type n) const |
Retrieve A read only reference to an object in the Array at a given index. | |
Array< T > & | operator+= (const T &x) |
Append an object to the end of the Array. | |
void | reserve (size_type n) |
Ensure the capacity is at least the size of a given value. | |
reference | front () |
const_reference | front () const |
reference | back () |
const_reference | back () const |
void | push_back (const T &x) |
Append an element to the end of the Array. | |
void | append (const T &x) |
Append an element to the end of the Array. | |
void | swap (Array< T > &x) |
Swap the elements of this Array with the elements of another. | |
iterator | insert (iterator position, const T &x) |
Insert an element in the Array before an element specified by an iterator. | |
void | insert (size_type position, const T &x) |
Insert an element in the Array before an element specified by an index. | |
void | remove (size_type index) |
Remove an element from the Array at a given index. | |
void | remove (size_type begin, size_type end) |
Remove an element specified by a range. | |
template<class InputIterator> | |
void | insert (iterator position, InputIterator first, InputIterator last) |
Insert a range of elements before a given position in the Array. | |
void | appendArray (const Array< T > &x) |
Append the elements of another Array to the end of this Array. | |
void | pop_back () |
Remove the last element of the Array. | |
iterator | erase (iterator position) |
Remove an element of the Array specified with an iterator. | |
iterator | erase (iterator first, iterator last) |
Remove elements of the Array specified by a beginning and ending iterator. | |
void | resize (size_type new_size, const T &x) |
Ensure the Array is a given size. | |
void | resize (size_type new_size) |
Ensure the Array is a given size. | |
void | clear () |
Remove all items from the Array. | |
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. | |
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. | |
iterator | find (const T &x) |
Find element x in the array. | |
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. | |
bool | contains (const T &x) const |
Determine if element x is contained in the array. | |
Private Types | |
typedef std::vector< T, std::allocator< T > > | V |
Private Member Functions | |
void | checkValidIndex (size_type index) const |
Private Attributes | |
COWReference< V > | m_impl |
Friends | |
bool | operator== (const Array< T > &x, const Array< T > &y) |
Determine equality of two Arrays. | |
bool | operator< (const Array< T > &x, const Array< T > &y) |
Determine if one Array is less than another. |
It also adds valid range checks to operator[] if BLOCXX_CHECK_ARRAY_INDEXING is defined.
Invariants: See std::vector<> Thread safety: read Copy semantics: Copy On Write Exception safety: same as std::vector<T>
Definition at line 63 of file Array.hpp.
|
|
|
|
|
Reimplemented in BLOCXX_NAMESPACE::Stack< T >. |
|
|
|
|
|
|
|
|
|
Reimplemented in BLOCXX_NAMESPACE::Stack< T >. |
|
|
|
Reimplemented in BLOCXX_NAMESPACE::Stack< T >. |
|
|
|
|
|
Default Constructor.
Definition at line 51 of file ArrayImpl.hpp. |
|
Destructor.
Definition at line 57 of file ArrayImpl.hpp. |
|
Constructor.
Definition at line 62 of file ArrayImpl.hpp. |
|
Construct an Array that consist of a specified number of elements that are copies of a given object.
Definition at line 68 of file ArrayImpl.hpp. |
|
Construct an Array that consist of a specified number of elements that are copies of a given object.
Definition at line 74 of file ArrayImpl.hpp. |
|
Construct an Array that consist of a specified number of elements that are copies of a given object.
Definition at line 80 of file ArrayImpl.hpp. |
|
Construct an Array that consist of a specified number of elements that have be constructed using the default constructor of class T.
Definition at line 86 of file ArrayImpl.hpp. |
|
Construct an Array from a range specified with InputIterators.
Definition at line 93 of file ArrayImpl.hpp. |
|
Append an element to the end of the Array. This is identical to push_back.
Definition at line 254 of file ArrayImpl.hpp. References BLOCXX_NAMESPACE::Array< T >::push_back(). Referenced by BLOCXX_NAMESPACE::AppenderLogger::addLogAppender(), and BLOCXX_NAMESPACE::String::tokenize(). |
|
Append the elements of another Array to the end of this Array.
Definition at line 311 of file ArrayImpl.hpp. References BLOCXX_NAMESPACE::Array< T >::begin(), BLOCXX_NAMESPACE::Array< T >::end(), and BLOCXX_NAMESPACE::Array< T >::insert(). |
|
Definition at line 240 of file ArrayImpl.hpp. References BLOCXX_NAMESPACE::Array< T >::m_impl. |
|
Definition at line 233 of file ArrayImpl.hpp. References BLOCXX_NAMESPACE::Array< T >::m_impl. Referenced by BLOCXX_NAMESPACE::Stack< T >::top(). |
|
Definition at line 107 of file ArrayImpl.hpp. References BLOCXX_NAMESPACE::Array< T >::m_impl. |
|
Definition at line 100 of file ArrayImpl.hpp. References BLOCXX_NAMESPACE::Array< T >::m_impl. Referenced by BLOCXX_NAMESPACE::Array< T >::appendArray(), BLOCXX_NAMESPACE::Array< T >::contains(), BLOCXX_NAMESPACE::Array< T >::find(), BLOCXX_NAMESPACE::LogMessagePatternFormatter::formatMessage(), and BLOCXX_NAMESPACE::PosixRegEx::grep(). |
|
Definition at line 170 of file ArrayImpl.hpp. References BLOCXX_NAMESPACE::Array< T >::m_impl. |
|
Definition at line 421 of file ArrayImpl.hpp. References BLOCXX_NAMESPACE::Array< T >::size(), and BLOCXX_NAMESPACE::throwArrayOutOfBoundsException(). Referenced by BLOCXX_NAMESPACE::Array< T >::operator[](), and BLOCXX_NAMESPACE::Array< T >::remove(). |
|
Remove all items from the Array. The size() of the Array should be zero after calling this method. Definition at line 353 of file ArrayImpl.hpp. References BLOCXX_NAMESPACE::Array< T >::m_impl. Referenced by BLOCXX_NAMESPACE::Exec::processInputOutput(). |
|
Determine if element x is contained in the array.
Definition at line 409 of file ArrayImpl.hpp. References BLOCXX_NAMESPACE::Array< T >::begin(), BLOCXX_NAMESPACE::Array< T >::end(), and BLOCXX_NAMESPACE::Array< T >::find(). |
|
Determine if element x is contained in the array range specified by the first and last iterators.
Definition at line 402 of file ArrayImpl.hpp. References BLOCXX_NAMESPACE::Array< T >::end(), and BLOCXX_NAMESPACE::Array< T >::find(). |
|
Reimplemented in BLOCXX_NAMESPACE::Stack< T >. Definition at line 177 of file ArrayImpl.hpp. References BLOCXX_NAMESPACE::Array< T >::m_impl. Referenced by BLOCXX_NAMESPACE::PosixRegEx::grep(). |
|
Definition at line 121 of file ArrayImpl.hpp. References BLOCXX_NAMESPACE::Array< T >::m_impl. |
|
Definition at line 114 of file ArrayImpl.hpp. References BLOCXX_NAMESPACE::Array< T >::m_impl. Referenced by BLOCXX_NAMESPACE::Array< T >::appendArray(), BLOCXX_NAMESPACE::Array< T >::contains(), BLOCXX_NAMESPACE::Array< T >::find(), BLOCXX_NAMESPACE::LogMessagePatternFormatter::formatMessage(), and BLOCXX_NAMESPACE::PosixRegEx::grep(). |
|
Remove elements of the Array specified by a beginning and ending iterator.
Definition at line 332 of file ArrayImpl.hpp. References BLOCXX_NAMESPACE::Array< T >::m_impl. |
|
Remove an element of the Array specified with an iterator.
Definition at line 325 of file ArrayImpl.hpp. References BLOCXX_NAMESPACE::Array< T >::m_impl. |
|
Find element x in the array.
Definition at line 395 of file ArrayImpl.hpp. References BLOCXX_NAMESPACE::Array< T >::begin(), BLOCXX_NAMESPACE::Array< T >::end(), and BLOCXX_NAMESPACE::Array< T >::find(). |
|
Find element x in the array range specified by the first and last iterators.
Definition at line 381 of file ArrayImpl.hpp. References BLOCXX_NAMESPACE::Array< T >::end(). |
|
Find element x in the array.
Definition at line 374 of file ArrayImpl.hpp. References BLOCXX_NAMESPACE::Array< T >::begin(), BLOCXX_NAMESPACE::Array< T >::end(), and BLOCXX_NAMESPACE::Array< T >::find(). |
|
Find element x in the array range specified by the first and last iterators.
Definition at line 360 of file ArrayImpl.hpp. References BLOCXX_NAMESPACE::Array< T >::end(). Referenced by BLOCXX_NAMESPACE::Array< T >::contains(), BLOCXX_NAMESPACE::Array< T >::find(), and BLOCXX_NAMESPACE::Stack< T >::search(). |
|
Definition at line 226 of file ArrayImpl.hpp. References BLOCXX_NAMESPACE::Array< T >::m_impl. |
|
Definition at line 219 of file ArrayImpl.hpp. References BLOCXX_NAMESPACE::Array< T >::m_impl. |
|
Insert a range of elements before a given position in the Array.
Definition at line 304 of file ArrayImpl.hpp. References BLOCXX_NAMESPACE::Array< T >::m_impl. |
|
Insert an element in the Array before an element specified by an index.
Definition at line 275 of file ArrayImpl.hpp. References BLOCXX_NAMESPACE::Array< T >::m_impl. |
|
Insert an element in the Array before an element specified by an iterator.
Definition at line 268 of file ArrayImpl.hpp. References BLOCXX_NAMESPACE::Array< T >::m_impl. Referenced by BLOCXX_NAMESPACE::Array< T >::appendArray(). |
|
Definition at line 163 of file ArrayImpl.hpp. References BLOCXX_NAMESPACE::Array< T >::m_impl. |
|
Append an object to the end of the Array.
Definition at line 204 of file ArrayImpl.hpp. References BLOCXX_NAMESPACE::Array< T >::m_impl. |
|
Retrieve A read only reference to an object in the Array at a given index.
Definition at line 194 of file ArrayImpl.hpp. References BLOCXX_NAMESPACE::Array< T >::checkValidIndex(), and BLOCXX_NAMESPACE::Array< T >::m_impl. |
|
Retrieve A read/write reference to an object in the Array at a given index.
Definition at line 184 of file ArrayImpl.hpp. References BLOCXX_NAMESPACE::Array< T >::checkValidIndex(), and BLOCXX_NAMESPACE::Array< T >::m_impl. |
|
Remove the last element of the Array.
Definition at line 318 of file ArrayImpl.hpp. References BLOCXX_NAMESPACE::Array< T >::m_impl. Referenced by BLOCXX_NAMESPACE::Stack< T >::pop(). |
|
Append an element to the end of the Array.
Definition at line 247 of file ArrayImpl.hpp. References BLOCXX_NAMESPACE::Array< T >::m_impl. Referenced by BLOCXX_NAMESPACE::SelectEngine::addSelectableObject(), BLOCXX_NAMESPACE::Array< T >::append(), BLOCXX_NAMESPACE::PosixRegEx::capture(), BLOCXX_NAMESPACE::Exec::executeProcessAndGatherOutput(), BLOCXX_NAMESPACE::Exec::gatherOutput(), BLOCXX_NAMESPACE::SelectEngine::go(), BLOCXX_NAMESPACE::PosixRegEx::grep(), BLOCXX_NAMESPACE::Stack< T >::push(), BLOCXX_NAMESPACE::Select::select(), BLOCXX_NAMESPACE::PosixRegEx::split(), BLOCXX_NAMESPACE::UTF8Utils::StringToUCS2Common(), and BLOCXX_NAMESPACE::SocketUtils::waitForIO(). |
|
Definition at line 135 of file ArrayImpl.hpp. References BLOCXX_NAMESPACE::Array< T >::m_impl. |
|
Definition at line 128 of file ArrayImpl.hpp. References BLOCXX_NAMESPACE::Array< T >::m_impl. |
|
Remove an element specified by a range.
Definition at line 292 of file ArrayImpl.hpp. References BLOCXX_NAMESPACE::Array< T >::checkValidIndex(), and BLOCXX_NAMESPACE::Array< T >::m_impl. |
|
Remove an element from the Array at a given index.
Definition at line 282 of file ArrayImpl.hpp. References BLOCXX_NAMESPACE::Array< T >::checkValidIndex(), and BLOCXX_NAMESPACE::Array< T >::m_impl. Referenced by BLOCXX_NAMESPACE::RWLocker::releaseReadLock(). |
|
Definition at line 149 of file ArrayImpl.hpp. References BLOCXX_NAMESPACE::Array< T >::m_impl. |
|
Definition at line 142 of file ArrayImpl.hpp. References BLOCXX_NAMESPACE::Array< T >::m_impl. |
|
Ensure the capacity is at least the size of a given value. If the given value is > max_size() the method with throw an std::length_error exception.
Definition at line 212 of file ArrayImpl.hpp. References BLOCXX_NAMESPACE::Array< T >::m_impl. Referenced by BLOCXX_NAMESPACE::Select::select(). |
|
Ensure the Array is a given size. If the Array needs to be larger that what it already is, this method will append items that have been initialized using the default constructor of class T.
Definition at line 346 of file ArrayImpl.hpp. References BLOCXX_NAMESPACE::Array< T >::m_impl. |
|
Ensure the Array is a given size.
Definition at line 339 of file ArrayImpl.hpp. References BLOCXX_NAMESPACE::Array< T >::m_impl. Referenced by BLOCXX_NAMESPACE::Exec::processInputOutput(). |
|
|
Swap the elements of this Array with the elements of another.
Definition at line 261 of file ArrayImpl.hpp. References BLOCXX_NAMESPACE::Array< T >::m_impl, and BLOCXX_NAMESPACE::COWReference< T >::swap(). Referenced by BLOCXX_NAMESPACE::swap(). |
|
Determine if one Array is less than another. This is done by doing a lexicographical compare on the Arrays. a lexicographical compare will compares the Arrays element by element until:
|
|
Determine equality of two Arrays. Two Arrays are considered equal if they are of the same size and elements in the same position are equal as defined by the “==” operator of the type in the Array. |
|