BLOCXX_NAMESPACE::Array< T > Class Template Reference

Array<> wraps std::vector<> in COWReference<> adding ref counting and copy on write capability. More...

#include <Array.hpp>

Inheritance diagram for BLOCXX_NAMESPACE::Array< T >:

BLOCXX_NAMESPACE::Stack< T > List of all members.

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< Vm_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.

Detailed Description

template<class T>
class BLOCXX_NAMESPACE::Array< T >

Array<> wraps std::vector<> in COWReference<> adding ref counting and copy on write capability.

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.


Member Typedef Documentation

template<class T>
typedef V::const_iterator BLOCXX_NAMESPACE::Array< T >::const_iterator
 

Definition at line 83 of file Array.hpp.

template<class T>
typedef V::const_pointer BLOCXX_NAMESPACE::Array< T >::const_pointer
 

Definition at line 81 of file Array.hpp.

template<class T>
typedef V::const_reference BLOCXX_NAMESPACE::Array< T >::const_reference
 

Reimplemented in BLOCXX_NAMESPACE::Stack< T >.

Definition at line 85 of file Array.hpp.

template<class T>
typedef V::const_reverse_iterator BLOCXX_NAMESPACE::Array< T >::const_reverse_iterator
 

Definition at line 89 of file Array.hpp.

template<class T>
typedef V::difference_type BLOCXX_NAMESPACE::Array< T >::difference_type
 

Definition at line 87 of file Array.hpp.

template<class T>
typedef V::iterator BLOCXX_NAMESPACE::Array< T >::iterator
 

Definition at line 82 of file Array.hpp.

template<class T>
typedef V::pointer BLOCXX_NAMESPACE::Array< T >::pointer
 

Definition at line 80 of file Array.hpp.

template<class T>
typedef V::reference BLOCXX_NAMESPACE::Array< T >::reference
 

Reimplemented in BLOCXX_NAMESPACE::Stack< T >.

Definition at line 84 of file Array.hpp.

template<class T>
typedef V::reverse_iterator BLOCXX_NAMESPACE::Array< T >::reverse_iterator
 

Definition at line 88 of file Array.hpp.

template<class T>
typedef V::size_type BLOCXX_NAMESPACE::Array< T >::size_type
 

Reimplemented in BLOCXX_NAMESPACE::Stack< T >.

Definition at line 86 of file Array.hpp.

template<class T>
typedef std::vector<T, std::allocator<T> > BLOCXX_NAMESPACE::Array< T >::V [private]
 

Definition at line 65 of file Array.hpp.

template<class T>
typedef V::value_type BLOCXX_NAMESPACE::Array< T >::value_type
 

Definition at line 79 of file Array.hpp.


Constructor & Destructor Documentation

template<typename T>
BLOCXX_NAMESPACE::Array< T >::Array  )  [inline]
 

Default Constructor.

Definition at line 51 of file ArrayImpl.hpp.

template<typename T>
BLOCXX_NAMESPACE::Array< T >::~Array  )  [inline]
 

Destructor.

Definition at line 57 of file ArrayImpl.hpp.

template<typename T>
BLOCXX_NAMESPACE::Array< T >::Array V toWrap  )  [inline, explicit]
 

Constructor.

Parameters:
toWrap The std::vector to wrap with this Array object.

Definition at line 62 of file ArrayImpl.hpp.

template<typename T>
BLOCXX_NAMESPACE::Array< T >::Array size_type  n,
const T &  value
[inline]
 

Construct an Array that consist of a specified number of elements that are copies of a given object.

Parameters:
n Number of elements the Array will contain.
value The value every element of the array will be initialized to.

Definition at line 68 of file ArrayImpl.hpp.

template<typename T>
BLOCXX_NAMESPACE::Array< T >::Array int  n,
const T &  value
[inline]
 

Construct an Array that consist of a specified number of elements that are copies of a given object.

Parameters:
n Number of elements the Array will contain.
value The value every element of the array will be initialized to.

Definition at line 74 of file ArrayImpl.hpp.

template<typename T>
BLOCXX_NAMESPACE::Array< T >::Array long  n,
const T &  value
[inline]
 

Construct an Array that consist of a specified number of elements that are copies of a given object.

Parameters:
n Number of elements the Array will contain.
value The value every element of the array will be initialized to.

Definition at line 80 of file ArrayImpl.hpp.

template<typename T>
BLOCXX_NAMESPACE::Array< T >::Array size_type  n  )  [inline, explicit]
 

Construct an Array that consist of a specified number of elements that have be constructed using the default constructor of class T.

Parameters:
n Number of elements the Array will contain.

Definition at line 86 of file ArrayImpl.hpp.

template<typename T>
template<class InputIterator>
BLOCXX_NAMESPACE::Array< T >::Array InputIterator  first,
InputIterator  last
[inline]
 

Construct an Array from a range specified with InputIterators.

Parameters:
first The iterator for the beginning of the range.
last The iterator for the end of the range.

Definition at line 93 of file ArrayImpl.hpp.


Member Function Documentation

template<typename T>
void BLOCXX_NAMESPACE::Array< T >::append const T &  x  )  [inline]
 

Append an element to the end of the Array.

This is identical to push_back.

Parameters:
x The element to append to the end of the Array.

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().

template<typename T>
void BLOCXX_NAMESPACE::Array< T >::appendArray const Array< T > &  x  )  [inline]
 

Append the elements of another Array to the end of this Array.

Parameters:
x The Array the elements will be copied from.

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().

template<typename T>
Array< T >::const_reference BLOCXX_NAMESPACE::Array< T >::back  )  const [inline]
 

Returns:
A read only reference to the last element of the Array.

Definition at line 240 of file ArrayImpl.hpp.

References BLOCXX_NAMESPACE::Array< T >::m_impl.

template<typename T>
Array< T >::reference BLOCXX_NAMESPACE::Array< T >::back  )  [inline]
 

Returns:
A read/write reference to the last element of the Array.

Definition at line 233 of file ArrayImpl.hpp.

References BLOCXX_NAMESPACE::Array< T >::m_impl.

Referenced by BLOCXX_NAMESPACE::Stack< T >::top().

template<typename T>
Array< T >::const_iterator BLOCXX_NAMESPACE::Array< T >::begin  )  const [inline]
 

Returns:
A read only iterator that points to the first element in the Array. Iteration is done in the normal order (1st to last) with the returned iterator.

Definition at line 107 of file ArrayImpl.hpp.

References BLOCXX_NAMESPACE::Array< T >::m_impl.

template<typename T>
Array< T >::iterator BLOCXX_NAMESPACE::Array< T >::begin  )  [inline]
 

Returns:
A read/write iterator that points to the first element in the Array. Iteration is done in the normal order (1st to last) with the returned iterator.

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().

template<typename T>
Array< T >::size_type BLOCXX_NAMESPACE::Array< T >::capacity  )  const [inline]
 

Returns:
The space that is currently allocated to hold the elements. This value will be >= size()

Definition at line 170 of file ArrayImpl.hpp.

References BLOCXX_NAMESPACE::Array< T >::m_impl.

template<typename T>
void BLOCXX_NAMESPACE::Array< T >::checkValidIndex size_type  index  )  const [inline, private]
 

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().

template<typename T>
void BLOCXX_NAMESPACE::Array< T >::clear  )  [inline]
 

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().

template<typename T>
bool BLOCXX_NAMESPACE::Array< T >::contains const T &  x  )  const [inline]
 

Determine if element x is contained in the array.

Parameters:
x The element to seach for.
Returns:
true if the 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().

template<typename T>
bool BLOCXX_NAMESPACE::Array< T >::contains const T &  x,
const_iterator  first,
const_iterator  last
const [inline]
 

Determine if element x is contained in the array range specified by the first and last iterators.

Parameters:
x The element to seach for.
first The first position iterator; begin of the range.
last The last position iterator; end of the range.
Returns:
true if the element x is contained in the specified range of the array.

Definition at line 402 of file ArrayImpl.hpp.

References BLOCXX_NAMESPACE::Array< T >::end(), and BLOCXX_NAMESPACE::Array< T >::find().

template<typename T>
bool BLOCXX_NAMESPACE::Array< T >::empty  )  const [inline]
 

Returns:
true if the Array is empty (contains zero elements)

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().

template<typename T>
Array< T >::const_iterator BLOCXX_NAMESPACE::Array< T >::end  )  const [inline]
 

Returns:
A read only iterator that points one past the last element in the Array. Iteration is done in the normal order (1st to last) with the returned iterator.

Definition at line 121 of file ArrayImpl.hpp.

References BLOCXX_NAMESPACE::Array< T >::m_impl.

template<typename T>
Array< T >::iterator BLOCXX_NAMESPACE::Array< T >::end  )  [inline]
 

Returns:
A read/write iterator that points one past the last element in the Array. Iteration is done in the normal order (1st to last) with the returned iterator.

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().

template<typename T>
Array< T >::iterator BLOCXX_NAMESPACE::Array< T >::erase iterator  first,
iterator  last
[inline]
 

Remove elements of the Array specified by a beginning and ending iterator.

Parameters:
first An iterator that specifies the first element to remove.
last An iterator that specifies the last element to remove.
Returns:
An iterator that points to the element in the Array following the removed elements.

Definition at line 332 of file ArrayImpl.hpp.

References BLOCXX_NAMESPACE::Array< T >::m_impl.

template<typename T>
Array< T >::iterator BLOCXX_NAMESPACE::Array< T >::erase iterator  position  )  [inline]
 

Remove an element of the Array specified with an iterator.

Parameters:
position An iterator that points to the element to be removed.
Returns:
An iterator that points to the element in the Array following the removed element.

Definition at line 325 of file ArrayImpl.hpp.

References BLOCXX_NAMESPACE::Array< T >::m_impl.

template<typename T>
Array< T >::iterator BLOCXX_NAMESPACE::Array< T >::find const T &  x  )  [inline]
 

Find element x in the array.

Parameters:
x The element to seach for.
Returns:
An read/write iterator pointing to the found element or the end iterator pointing one past the last element 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().

template<typename T>
Array< T >::iterator BLOCXX_NAMESPACE::Array< T >::find const T &  x,
iterator  first,
iterator  last
[inline]
 

Find element x in the array range specified by the first and last iterators.

Parameters:
x The element to seach for.
first The first position iterator; begin of the range.
last The last position iterator; end of the range.
Returns:
An read/write iterator pointing to the found element or the end iterator pointing one past the last element in the array.

Definition at line 381 of file ArrayImpl.hpp.

References BLOCXX_NAMESPACE::Array< T >::end().

template<typename T>
Array< T >::const_iterator BLOCXX_NAMESPACE::Array< T >::find const T &  x  )  const [inline]
 

Find element x in the array.

Parameters:
x The element to seach for.
Returns:
An read only iterator pointing to the found element or the end iterator pointing one past the last element 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().

template<typename T>
Array< T >::const_iterator BLOCXX_NAMESPACE::Array< T >::find const T &  x,
const_iterator  first,
const_iterator  last
const [inline]
 

Find element x in the array range specified by the first and last iterators.

Parameters:
x The element to seach for.
first The first position iterator; begin of the range.
last The last position iterator; end of the range.
Returns:
An read only iterator pointing to the found element or the end iterator pointing one past the last element in the array.

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().

template<typename T>
Array< T >::const_reference BLOCXX_NAMESPACE::Array< T >::front  )  const [inline]
 

Returns:
A read only reference to the first element of the Array.

Definition at line 226 of file ArrayImpl.hpp.

References BLOCXX_NAMESPACE::Array< T >::m_impl.

template<typename T>
Array< T >::reference BLOCXX_NAMESPACE::Array< T >::front  )  [inline]
 

Returns:
A read/write reference to the first element of the Array.

Definition at line 219 of file ArrayImpl.hpp.

References BLOCXX_NAMESPACE::Array< T >::m_impl.

template<typename T>
template<class InputIterator>
void BLOCXX_NAMESPACE::Array< T >::insert iterator  position,
InputIterator  first,
InputIterator  last
[inline]
 

Insert a range of elements before a given position in the Array.

Parameters:
position The position to insert the elements at. The insertion will be done before this position.
first The beginning of the range of elements to insert.
last The end of the range of elements to insert.

Definition at line 304 of file ArrayImpl.hpp.

References BLOCXX_NAMESPACE::Array< T >::m_impl.

template<typename T>
void BLOCXX_NAMESPACE::Array< T >::insert size_type  position,
const T &  x
[inline]
 

Insert an element in the Array before an element specified by an index.

Parameters:
position An index that specifies where the element will be inserted.
x The element to insert into the Array.

Definition at line 275 of file ArrayImpl.hpp.

References BLOCXX_NAMESPACE::Array< T >::m_impl.

template<typename T>
Array< T >::iterator BLOCXX_NAMESPACE::Array< T >::insert iterator  position,
const T &  x
[inline]
 

Insert an element in the Array before an element specified by an iterator.

Parameters:
position An iterator that points to the insertion point. The element will be inserted before this point.
x The element to insert into the Array.
Returns:
An iterator that points to the newly inserted element in the Array.

Definition at line 268 of file ArrayImpl.hpp.

References BLOCXX_NAMESPACE::Array< T >::m_impl.

Referenced by BLOCXX_NAMESPACE::Array< T >::appendArray().

template<typename T>
Array< T >::size_type BLOCXX_NAMESPACE::Array< T >::max_size  )  const [inline]
 

Returns:
The maximum number of elements the Array can hold.

Definition at line 163 of file ArrayImpl.hpp.

References BLOCXX_NAMESPACE::Array< T >::m_impl.

template<typename T>
Array< T > & BLOCXX_NAMESPACE::Array< T >::operator+= const T &  x  )  [inline]
 

Append an object to the end of the Array.

Parameters:
x The object to append to the end of the Array.
Returns:
A reference to this Array object.

Definition at line 204 of file ArrayImpl.hpp.

References BLOCXX_NAMESPACE::Array< T >::m_impl.

template<typename T>
Array< T >::const_reference BLOCXX_NAMESPACE::Array< T >::operator[] size_type  n  )  const [inline]
 

Retrieve A read only reference to an object in the Array at a given index.

Parameters:
n The index of the element to retrieve the reference for.
Returns:
A read only reference to the object at the given index.

Definition at line 194 of file ArrayImpl.hpp.

References BLOCXX_NAMESPACE::Array< T >::checkValidIndex(), and BLOCXX_NAMESPACE::Array< T >::m_impl.

template<typename T>
Array< T >::reference BLOCXX_NAMESPACE::Array< T >::operator[] size_type  n  )  [inline]
 

Retrieve A read/write reference to an object in the Array at a given index.

Parameters:
n The index of the element to retrieve the reference for.
Returns:
A read/write reference to the object at the given index.

Definition at line 184 of file ArrayImpl.hpp.

References BLOCXX_NAMESPACE::Array< T >::checkValidIndex(), and BLOCXX_NAMESPACE::Array< T >::m_impl.

template<typename T>
void BLOCXX_NAMESPACE::Array< T >::pop_back  )  [inline]
 

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().

template<typename T>
void BLOCXX_NAMESPACE::Array< T >::push_back const T &  x  )  [inline]
 

Append an element to the end of the Array.

Parameters:
x The element to append 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().

template<typename T>
Array< T >::const_reverse_iterator BLOCXX_NAMESPACE::Array< T >::rbegin  )  const [inline]
 

Returns:
A read only reverse iterator that points to the last element in the Array. Iteration is done in reverse order with the returned iterator.

Definition at line 135 of file ArrayImpl.hpp.

References BLOCXX_NAMESPACE::Array< T >::m_impl.

template<typename T>
Array< T >::reverse_iterator BLOCXX_NAMESPACE::Array< T >::rbegin  )  [inline]
 

Returns:
A read/write reverse iterator that points to the last element in the Array. Iteration is done in reverse order with the returned iterator.

Definition at line 128 of file ArrayImpl.hpp.

References BLOCXX_NAMESPACE::Array< T >::m_impl.

template<typename T>
void BLOCXX_NAMESPACE::Array< T >::remove size_type  begin,
size_type  end
[inline]
 

Remove an element specified by a range.

Parameters:
begin An iterator that specifies the beginning of the range to remove.
end An iterator that specifies the end of the range to remove.

Definition at line 292 of file ArrayImpl.hpp.

References BLOCXX_NAMESPACE::Array< T >::checkValidIndex(), and BLOCXX_NAMESPACE::Array< T >::m_impl.

template<typename T>
void BLOCXX_NAMESPACE::Array< T >::remove size_type  index  )  [inline]
 

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().

template<typename T>
Array< T >::const_reverse_iterator BLOCXX_NAMESPACE::Array< T >::rend  )  const [inline]
 

Returns:
A read only reverse iterator that points one before the first element of the Array. Iteration is done in reverse order with the returned iterator.

Definition at line 149 of file ArrayImpl.hpp.

References BLOCXX_NAMESPACE::Array< T >::m_impl.

template<typename T>
Array< T >::reverse_iterator BLOCXX_NAMESPACE::Array< T >::rend  )  [inline]
 

Returns:
A read/write reverse iterator that points one before the first element of the Array. Iteration is done in reverse order with the returned iterator.

Definition at line 142 of file ArrayImpl.hpp.

References BLOCXX_NAMESPACE::Array< T >::m_impl.

template<typename T>
void BLOCXX_NAMESPACE::Array< T >::reserve size_type  n  )  [inline]
 

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.

Parameters:
n - The minimum size this Array can be.

Definition at line 212 of file ArrayImpl.hpp.

References BLOCXX_NAMESPACE::Array< T >::m_impl.

Referenced by BLOCXX_NAMESPACE::Select::select().

template<typename T>
void BLOCXX_NAMESPACE::Array< T >::resize size_type  new_size  )  [inline]
 

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.

Parameters:
new_size The new size of the Array.

Definition at line 346 of file ArrayImpl.hpp.

References BLOCXX_NAMESPACE::Array< T >::m_impl.

template<typename T>
void BLOCXX_NAMESPACE::Array< T >::resize size_type  new_size,
const T &  x
[inline]
 

Ensure the Array is a given size.

Parameters:
new_size The new size of the Array.
x An object to append to the end of the Array if it needs to be larger than what it already is.

Definition at line 339 of file ArrayImpl.hpp.

References BLOCXX_NAMESPACE::Array< T >::m_impl.

Referenced by BLOCXX_NAMESPACE::Exec::processInputOutput().

template<typename T>
Array< T >::size_type BLOCXX_NAMESPACE::Array< T >::size  )  const [inline]
 

Returns:
The number of elements in the Array

Reimplemented in BLOCXX_NAMESPACE::Stack< T >.

Definition at line 156 of file ArrayImpl.hpp.

References BLOCXX_NAMESPACE::Array< T >::m_impl.

Referenced by BLOCXX_NAMESPACE::Array< T >::checkValidIndex(), BLOCXX_NAMESPACE::AppenderLogger::doCategoryIsEnabled(), BLOCXX_NAMESPACE::AppenderLogger::doComponentAndCategoryAreEnabled(), BLOCXX_NAMESPACE::SyslogAppender::doProcessLogMessage(), BLOCXX_NAMESPACE::AppenderLogger::doProcessLogMessage(), BLOCXX_NAMESPACE::AppenderLogger::getLevel(), BLOCXX_NAMESPACE::CmdLineParser::getNonOptionCount(), BLOCXX_NAMESPACE::RWLocker::getWriteLock(), BLOCXX_NAMESPACE::SelectEngine::go(), BLOCXX_NAMESPACE::Exec::processInputOutput(), BLOCXX_NAMESPACE::RWLocker::releaseReadLock(), BLOCXX_NAMESPACE::Exec::safePopen(), BLOCXX_NAMESPACE::Exec::safeSystem(), BLOCXX_NAMESPACE::Select::select(), BLOCXX_NAMESPACE::Select::selectRWEpoll(), BLOCXX_NAMESPACE::Select::selectRWPoll(), BLOCXX_NAMESPACE::Select::selectRWSelect(), and BLOCXX_NAMESPACE::UTF8Utils::UCS2ToString().

template<typename T>
void BLOCXX_NAMESPACE::Array< T >::swap Array< T > &  x  )  [inline]
 

Swap the elements of this Array with the elements of another.

Parameters:
x The Array object this Array will swap elements with.

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().


Friends And Related Function Documentation

template<class T>
bool operator< const Array< T > &  x,
const Array< T > &  y
[friend]
 

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:

  • It finds two corresponding elements unequal, and the result of their comparison is taken as the result of the comparison between sequences.
  • No inequalities are found, but one sequence has more elements than the other, and the shorter sequence is considered less than the longer sequence.
  • No inequalities are found and the sequences have the same number of elements, and so the sequences are equal and the result of the comparison is false.
    Parameters:
    x The first Array object in the comparison.
    y The second Array object in the comparison.
    Returns:
    true if Array x is less than Array y.

template<class T>
bool operator== const Array< T > &  x,
const Array< T > &  y
[friend]
 

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.

Parameters:
x The first Array object in the comparison.
y The second Array object in the comparison.
Returns:
true if Array x is equal to Array y.


Member Data Documentation

template<class T>
COWReference<V> BLOCXX_NAMESPACE::Array< T >::m_impl [private]
 

Definition at line 72 of file Array.hpp.

Referenced by BLOCXX_NAMESPACE::Array< T >::back(), BLOCXX_NAMESPACE::Array< T >::begin(), BLOCXX_NAMESPACE::Array< T >::capacity(), BLOCXX_NAMESPACE::Array< T >::clear(), BLOCXX_NAMESPACE::Array< T >::empty(), BLOCXX_NAMESPACE::Array< T >::end(), BLOCXX_NAMESPACE::Array< T >::erase(), BLOCXX_NAMESPACE::Array< T >::front(), BLOCXX_NAMESPACE::Array< T >::insert(), BLOCXX_NAMESPACE::Array< T >::max_size(), BLOCXX_NAMESPACE::Array< T >::operator+=(), BLOCXX_NAMESPACE::operator==(), BLOCXX_NAMESPACE::Array< T >::operator[](), BLOCXX_NAMESPACE::Array< T >::pop_back(), BLOCXX_NAMESPACE::Array< T >::push_back(), BLOCXX_NAMESPACE::Array< T >::rbegin(), BLOCXX_NAMESPACE::Array< T >::remove(), BLOCXX_NAMESPACE::Array< T >::rend(), BLOCXX_NAMESPACE::Array< T >::reserve(), BLOCXX_NAMESPACE::Array< T >::resize(), BLOCXX_NAMESPACE::Array< T >::size(), and BLOCXX_NAMESPACE::Array< T >::swap().


The documentation for this class was generated from the following files:
Generated on Fri Jun 16 15:39:10 2006 for blocxx by  doxygen 1.4.6