Share::Vector< TItem, TAllocator > Class Template Reference
[Leight-weight implementation of some STL containers]

STL vector. More...

#include <sharelib.h>

Collaboration diagram for Share::Vector< TItem, TAllocator >:

Collaboration graph
[legend]
List of all members.

Public Types

typedef pointer iterator
 STL vector iterator equivalent.
typedef const_pointer const_iterator
 STL vector const_iterator equivalent.

Public Member Functions

 Vector ()
 Vector (size_type size)
 Vector (const Vector &other)
Vectoroperator= (const Vector &other)
 ~Vector ()
reference operator[] (size_type index)
const_reference operator[] (size_type index) const
bool operator== (const Vector &other) const
bool operator!= (const Vector &other) const
iterator begin ()
iterator end ()
const_iterator begin () const
const_iterator end () const
void clear ()
bool empty () const
void push_back (const_reference item)
void pop_back ()
size_type size () const
void resize (size_type newSize, const_reference val=TItem())

Detailed Description

template<class TItem, class TAllocator = std::allocator<TItem>>
class Share::Vector< TItem, TAllocator >

STL vector.

Light-weight implementation of STL std::vector

Parameters:
TItem Type of object stored in container.
TAllocator Type of allocator for container. Default is std::allocator. For sharing use Share::Allocator instead.

Definition at line 725 of file sharelib.h.


Member Typedef Documentation

template<class TItem, class TAllocator = std::allocator<TItem>>
typedef pointer Share::Vector< TItem, TAllocator >::iterator

STL vector iterator equivalent.

Definition at line 744 of file sharelib.h.

template<class TItem, class TAllocator = std::allocator<TItem>>
typedef const_pointer Share::Vector< TItem, TAllocator >::const_iterator

STL vector const_iterator equivalent.

Definition at line 745 of file sharelib.h.


Constructor & Destructor Documentation

template<class TItem, class TAllocator = std::allocator<TItem>>
Share::Vector< TItem, TAllocator >::Vector (  )  [inline]

Construct empty vector

Definition at line 750 of file sharelib.h.

template<class TItem, class TAllocator = std::allocator<TItem>>
Share::Vector< TItem, TAllocator >::Vector ( size_type  size  )  [inline]

Definition at line 758 of file sharelib.h.

template<class TItem, class TAllocator = std::allocator<TItem>>
Share::Vector< TItem, TAllocator >::Vector ( const Vector< TItem, TAllocator > &  other  )  [inline]

Copy constructor

Definition at line 770 of file sharelib.h.

template<class TItem, class TAllocator = std::allocator<TItem>>
Share::Vector< TItem, TAllocator >::~Vector (  )  [inline]

Definition at line 794 of file sharelib.h.


Member Function Documentation

template<class TItem, class TAllocator = std::allocator<TItem>>
Vector& Share::Vector< TItem, TAllocator >::operator= ( const Vector< TItem, TAllocator > &  other  )  [inline]

assignment

Definition at line 781 of file sharelib.h.

References Share::Vector< TItem, TAllocator >::begin(), Share::Vector< TItem, TAllocator >::end(), and Share::Vector< TItem, TAllocator >::size().

template<class TItem, class TAllocator = std::allocator<TItem>>
reference Share::Vector< TItem, TAllocator >::operator[] ( size_type  index  )  [inline]

Indexer

Parameters:
index index
Returns:
Return reference to indexed object.

Definition at line 806 of file sharelib.h.

template<class TItem, class TAllocator = std::allocator<TItem>>
const_reference Share::Vector< TItem, TAllocator >::operator[] ( size_type  index  )  const [inline]

Indexer

Parameters:
index index
Returns:
Return reference to indexed object.

Definition at line 813 of file sharelib.h.

template<class TItem, class TAllocator = std::allocator<TItem>>
bool Share::Vector< TItem, TAllocator >::operator== ( const Vector< TItem, TAllocator > &  other  )  const [inline]

equivalence

Definition at line 820 of file sharelib.h.

References Share::Vector< TItem, TAllocator >::begin(), and Share::Vector< TItem, TAllocator >::end().

template<class TItem, class TAllocator = std::allocator<TItem>>
bool Share::Vector< TItem, TAllocator >::operator!= ( const Vector< TItem, TAllocator > &  other  )  const [inline]

non-equivalence

Definition at line 834 of file sharelib.h.

References Share::operator==().

template<class TItem, class TAllocator = std::allocator<TItem>>
iterator Share::Vector< TItem, TAllocator >::begin (  )  [inline]

Returns:
Return iterator pointing to begin of vector.

Definition at line 841 of file sharelib.h.

Referenced by Share::String< TAllocator >::begin(), Share::Vector< TItem, TAllocator >::operator=(), and Share::Vector< TItem, TAllocator >::operator==().

template<class TItem, class TAllocator = std::allocator<TItem>>
iterator Share::Vector< TItem, TAllocator >::end (  )  [inline]

Returns:
Return iterator pointing behind the last element of vector.

Definition at line 848 of file sharelib.h.

Referenced by Share::Vector< TItem, TAllocator >::operator=(), and Share::Vector< TItem, TAllocator >::operator==().

template<class TItem, class TAllocator = std::allocator<TItem>>
const_iterator Share::Vector< TItem, TAllocator >::begin (  )  const [inline]

Returns:
Return iterator pointing to begin of vector.

Definition at line 855 of file sharelib.h.

template<class TItem, class TAllocator = std::allocator<TItem>>
const_iterator Share::Vector< TItem, TAllocator >::end (  )  const [inline]

Returns:
Return iterator pointing behind the last element of vector.

Definition at line 862 of file sharelib.h.

template<class TItem, class TAllocator = std::allocator<TItem>>
void Share::Vector< TItem, TAllocator >::clear (  )  [inline]

Remove all items from vector.

Definition at line 869 of file sharelib.h.

template<class TItem, class TAllocator = std::allocator<TItem>>
bool Share::Vector< TItem, TAllocator >::empty (  )  const [inline]

Returns:
Return true if vector is empty.

Definition at line 879 of file sharelib.h.

template<class TItem, class TAllocator = std::allocator<TItem>>
void Share::Vector< TItem, TAllocator >::push_back ( const_reference  item  )  [inline]

Append item to end of vector.

Parameters:
item Item to append.
Note:
Vector capacity will be increased if needed.

Definition at line 888 of file sharelib.h.

template<class TItem, class TAllocator = std::allocator<TItem>>
void Share::Vector< TItem, TAllocator >::pop_back (  )  [inline]

Remove last element of vector

Attention:
This method could not be called if vector is empty.

Definition at line 898 of file sharelib.h.

template<class TItem, class TAllocator = std::allocator<TItem>>
size_type Share::Vector< TItem, TAllocator >::size (  )  const [inline]

Returns:
Return size of vector

Definition at line 906 of file sharelib.h.

Referenced by Share::Vector< TItem, TAllocator >::operator=().

template<class TItem, class TAllocator = std::allocator<TItem>>
void Share::Vector< TItem, TAllocator >::resize ( size_type  newSize,
const_reference  val = TItem() 
) [inline]

Resize vector to desired size.

Parameters:
newSize Desired size of vector
val Value to assign to new object if newSize is greater then current size.

Definition at line 915 of file sharelib.h.


The documentation for this class was generated from the following file:
Generated on Sun Aug 26 17:43:03 2007 for ShareLibrary by  doxygen 1.5.2