Container::PrivateGenericImplementation::Array< T, Policy, ExactSize > Class Template Reference

#include <Container.hpp>

List of all members.


Detailed Description

template<typename T, class Policy = MemoryPolicy<T>, bool ExactSize = false>
class Container::PrivateGenericImplementation::Array< T, Policy, ExactSize >

The array takes ownership of the element passed in.

Pros : Fastest possible access time once constructed (as fast as pointer dereferencing). Element order is always preserved. Cons : Construction / Adding and Remove operations are slow because copying is done on per element basis

For usage,

See also:
Tests::ContainerArrayTests
Policy must follow the MemoryPolicy interface
See also:
MemoryPolicy


Public Member Functions

void Append (const T &ref) throw ()
 Append an element to the end of the array.
 Array (const Array &other)
 Copy constructor.
 Array ()
 Default Constructor.
void Clear ()
 Clear the array, and destruct any remaining objects.
const T & getElementAtUncheckedPosition (uint32 index) const
 Fast access operator, but doesn't check the index given in.
T & getElementAtUncheckedPosition (uint32 index)
 Fast access operator, but doesn't check the index given in.
size_t getSize () const
 Access size member.
uint32 indexOf (const T &objectToSearch)
 Search operator.
void insertBefore (uint32 index, const T &ref) throw ()
 Insert an element just before the given index.
uint32 lastIndexOf (const T &objectToSearch)
 Reverse search operator.
const Arrayoperator= (const Array &other)
 Classic copy operator.
bool operator== (const Array &other)
 Compare operator.
const T & operator[] (uint32 index) const
 Access operator.
T & operator[] (uint32 index)
 Access operator.
void Remove (uint32 index) throw ()
 Remove an object from the array.
 ~Array ()
 Destructor.


Constructor & Destructor Documentation

template<typename T, class Policy = MemoryPolicy<T>, bool ExactSize = false>
Container::PrivateGenericImplementation::Array< T, Policy, ExactSize >::Array (  )  [inline]

Default Constructor.

template<typename T, class Policy = MemoryPolicy<T>, bool ExactSize = false>
Container::PrivateGenericImplementation::Array< T, Policy, ExactSize >::Array ( const Array< T, Policy, ExactSize > &  other  )  [inline]

Copy constructor.

template<typename T, class Policy = MemoryPolicy<T>, bool ExactSize = false>
Container::PrivateGenericImplementation::Array< T, Policy, ExactSize >::~Array (  )  [inline]

Destructor.


Member Function Documentation

template<typename T, class Policy = MemoryPolicy<T>, bool ExactSize = false>
void Container::PrivateGenericImplementation::Array< T, Policy, ExactSize >::Append ( const T &  ref  )  throw () [inline]

Append an element to the end of the array.

template<typename T, class Policy = MemoryPolicy<T>, bool ExactSize = false>
void Container::PrivateGenericImplementation::Array< T, Policy, ExactSize >::Clear (  )  [inline]

Clear the array, and destruct any remaining objects.

template<typename T, class Policy = MemoryPolicy<T>, bool ExactSize = false>
const T& Container::PrivateGenericImplementation::Array< T, Policy, ExactSize >::getElementAtUncheckedPosition ( uint32  index  )  const [inline]

Fast access operator, but doesn't check the index given in.

template<typename T, class Policy = MemoryPolicy<T>, bool ExactSize = false>
T& Container::PrivateGenericImplementation::Array< T, Policy, ExactSize >::getElementAtUncheckedPosition ( uint32  index  )  [inline]

Fast access operator, but doesn't check the index given in.

template<typename T, class Policy = MemoryPolicy<T>, bool ExactSize = false>
size_t Container::PrivateGenericImplementation::Array< T, Policy, ExactSize >::getSize (  )  const [inline]

Access size member.

template<typename T, class Policy = MemoryPolicy<T>, bool ExactSize = false>
uint32 Container::PrivateGenericImplementation::Array< T, Policy, ExactSize >::indexOf ( const T &  objectToSearch  )  [inline]

Search operator.

Parameters:
objectToSearch The object to look for in the array
Returns:
the element index of the given element or getSize() if not found.

template<typename T, class Policy = MemoryPolicy<T>, bool ExactSize = false>
void Container::PrivateGenericImplementation::Array< T, Policy, ExactSize >::insertBefore ( uint32  index,
const T &  ref 
) throw () [inline]

Insert an element just before the given index.

Parameters:
index Zero based index of the element once inserted

template<typename T, class Policy = MemoryPolicy<T>, bool ExactSize = false>
uint32 Container::PrivateGenericImplementation::Array< T, Policy, ExactSize >::lastIndexOf ( const T &  objectToSearch  )  [inline]

Reverse search operator.

Parameters:
objectToSearch The object to look for in the array
Returns:
the element index of the given element or getSize() if not found.

template<typename T, class Policy = MemoryPolicy<T>, bool ExactSize = false>
const Array& Container::PrivateGenericImplementation::Array< T, Policy, ExactSize >::operator= ( const Array< T, Policy, ExactSize > &  other  )  [inline]

Classic copy operator.

template<typename T, class Policy = MemoryPolicy<T>, bool ExactSize = false>
bool Container::PrivateGenericImplementation::Array< T, Policy, ExactSize >::operator== ( const Array< T, Policy, ExactSize > &  other  )  [inline]

Compare operator.

template<typename T, class Policy = MemoryPolicy<T>, bool ExactSize = false>
const T& Container::PrivateGenericImplementation::Array< T, Policy, ExactSize >::operator[] ( uint32  index  )  const [inline]

Access operator.

Parameters:
index The position in the array
Returns:
the index-th element if index is in bound, or Policy::DefaultElement() else

template<typename T, class Policy = MemoryPolicy<T>, bool ExactSize = false>
T& Container::PrivateGenericImplementation::Array< T, Policy, ExactSize >::operator[] ( uint32  index  )  [inline]

Access operator.

Parameters:
index The position in the array
Returns:
the index-th element if index is in bound, or Policy::DefaultElement() else

template<typename T, class Policy = MemoryPolicy<T>, bool ExactSize = false>
void Container::PrivateGenericImplementation::Array< T, Policy, ExactSize >::Remove ( uint32  index  )  throw () [inline]

Remove an object from the array.

Parameters:
index Zero based index of the object to remove


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

(C) An X-Ryl669 project 2007

This document describes Unlimited Zooming Interface source code. UZI stands for Unlimited Zooming Interface, and source code license is