Array< Element, Allocator > Class Template Reference

An array whose size is variable at run-time. More...

#include <array.h>

Collaboration diagram for Array< Element, Allocator >:
Collaboration graph
[legend]

Public Types

typedef Element value_type
typedef value_typeiterator
typedef const value_typeconst_iterator

Public Member Functions

 Array ()
 Array (std::size_t size)
template<typename T1 >
 Array (std::size_t size, const T1 &value)
 Array (const Array &other)
template<typename Iterator >
 Array (Iterator start, Iterator finish)
 ~Array ()
Arrayoperator= (const Array &other)
void swap (Array &other)
iterator begin ()
const_iterator begin () const
iterator end ()
const_iterator end () const
value_typeoperator[] (std::size_t index)
const value_typeoperator[] (std::size_t index) const
value_typedata ()
const value_typedata () const
std::size_t size () const
bool empty () const
void resize (std::size_t count)
void resize (std::size_t count, const value_type &value)

Private Member Functions

Element * construct (std::size_t size)
template<typename T1 >
Element * construct (std::size_t size, const T1 &value)
void destroy (Element *data, std::size_t size)

Private Attributes

std::size_t m_size
Element * m_data

Detailed Description

template<typename Element, typename Allocator = DefaultAllocator<Element>>
class Array< Element, Allocator >

An array whose size is variable at run-time.

Parameters:
Element The type to be stored in the array. Must provide a default-constructor and a copy-constructor.
Allocator A custom memory-allocator, conforming to the std::allocator interface.

Definition at line 39 of file array.h.


Member Typedef Documentation

template<typename Element, typename Allocator = DefaultAllocator<Element>>
typedef const value_type* Array< Element, Allocator >::const_iterator

Definition at line 57 of file array.h.

template<typename Element, typename Allocator = DefaultAllocator<Element>>
typedef value_type* Array< Element, Allocator >::iterator

Definition at line 56 of file array.h.

template<typename Element, typename Allocator = DefaultAllocator<Element>>
typedef Element Array< Element, Allocator >::value_type

Definition at line 55 of file array.h.


Constructor & Destructor Documentation

template<typename Element, typename Allocator = DefaultAllocator<Element>>
Array< Element, Allocator >::Array (  )  [inline]

Definition at line 59 of file array.h.

template<typename Element, typename Allocator = DefaultAllocator<Element>>
Array< Element, Allocator >::Array ( std::size_t  size  )  [inline]

Definition at line 62 of file array.h.

template<typename Element, typename Allocator = DefaultAllocator<Element>>
template<typename T1 >
Array< Element, Allocator >::Array ( std::size_t  size,
const T1 &  value 
) [inline]

Definition at line 66 of file array.h.

template<typename Element, typename Allocator = DefaultAllocator<Element>>
Array< Element, Allocator >::Array ( const Array< Element, Allocator > &  other  )  [inline]

Definition at line 69 of file array.h.

template<typename Element, typename Allocator = DefaultAllocator<Element>>
template<typename Iterator >
Array< Element, Allocator >::Array ( Iterator  start,
Iterator  finish 
) [inline]

Definition at line 74 of file array.h.

template<typename Element, typename Allocator = DefaultAllocator<Element>>
Array< Element, Allocator >::~Array (  )  [inline]

Definition at line 78 of file array.h.


Member Function Documentation

template<typename Element, typename Allocator = DefaultAllocator<Element>>
const_iterator Array< Element, Allocator >::begin (  )  const [inline]

Definition at line 100 of file array.h.

template<typename Element, typename Allocator = DefaultAllocator<Element>>
iterator Array< Element, Allocator >::begin (  )  [inline]
template<typename Element, typename Allocator = DefaultAllocator<Element>>
template<typename T1 >
Element* Array< Element, Allocator >::construct ( std::size_t  size,
const T1 &  value 
) [inline, private]

Definition at line 47 of file array.h.

template<typename Element, typename Allocator = DefaultAllocator<Element>>
Element* Array< Element, Allocator >::construct ( std::size_t  size  )  [inline, private]

Definition at line 43 of file array.h.

template<typename Element, typename Allocator = DefaultAllocator<Element>>
const value_type* Array< Element, Allocator >::data (  )  const [inline]

Definition at line 125 of file array.h.

template<typename Element, typename Allocator = DefaultAllocator<Element>>
value_type* Array< Element, Allocator >::data (  )  [inline]
template<typename Element, typename Allocator = DefaultAllocator<Element>>
void Array< Element, Allocator >::destroy ( Element *  data,
std::size_t  size 
) [inline, private]

Definition at line 50 of file array.h.

Referenced by Array< ub4 >::~Array().

template<typename Element, typename Allocator = DefaultAllocator<Element>>
bool Array< Element, Allocator >::empty (  )  const [inline]
template<typename Element, typename Allocator = DefaultAllocator<Element>>
const_iterator Array< Element, Allocator >::end (  )  const [inline]

Definition at line 106 of file array.h.

template<typename Element, typename Allocator = DefaultAllocator<Element>>
iterator Array< Element, Allocator >::end (  )  [inline]
template<typename Element, typename Allocator = DefaultAllocator<Element>>
Array& Array< Element, Allocator >::operator= ( const Array< Element, Allocator > &  other  )  [inline]

Definition at line 82 of file array.h.

template<typename Element, typename Allocator = DefaultAllocator<Element>>
const value_type& Array< Element, Allocator >::operator[] ( std::size_t  index  )  const [inline]

Definition at line 116 of file array.h.

template<typename Element, typename Allocator = DefaultAllocator<Element>>
value_type& Array< Element, Allocator >::operator[] ( std::size_t  index  )  [inline]

Definition at line 110 of file array.h.

template<typename Element, typename Allocator = DefaultAllocator<Element>>
void Array< Element, Allocator >::resize ( std::size_t  count,
const value_type value 
) [inline]

Definition at line 141 of file array.h.

template<typename Element, typename Allocator = DefaultAllocator<Element>>
void Array< Element, Allocator >::resize ( std::size_t  count  )  [inline]
template<typename Element, typename Allocator = DefaultAllocator<Element>>
std::size_t Array< Element, Allocator >::size (  )  const [inline]
template<typename Element, typename Allocator = DefaultAllocator<Element>>
void Array< Element, Allocator >::swap ( Array< Element, Allocator > &  other  )  [inline]

Definition at line 92 of file array.h.

Referenced by Array< ub4 >::operator=(), Array< ub4 >::resize(), and Array< ub4 >::swap().


Field Documentation

template<typename Element, typename Allocator = DefaultAllocator<Element>>
Element* Array< Element, Allocator >::m_data [private]
template<typename Element, typename Allocator = DefaultAllocator<Element>>
std::size_t Array< Element, Allocator >::m_size [private]

The documentation for this class was generated from the following file:

Generated by  doxygen 1.6.2