Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes
P::Array< Elem > Class Template Reference

#include <Array.hh>

List of all members.

Public Member Functions

 Array (unsigned s=0) throw (Except)
 Array (const Array &a)
unsigned CircularNext (unsigned i)
unsigned CircularPrev (unsigned i)
void Clear ()
bool Contains (const Elem &el) const
bool ContainsBackwards (const Elem &el) const
void * Data ()
void DeepCopy (const Array &a)
bool Empty ()
void Erase (unsigned i)
void EraseFirst ()
void EraseLast ()
unsigned Find (const Elem &el)
unsigned Find (unsigned start, const Elem &el)
unsigned FindBackwards (const Elem &el)
Elem & First () throw (Except)
const Elem & First () const throw (Except)
void InsertAfter (unsigned i, const Elem &el)
void InsertBefore (unsigned i, const Elem &el)
void InsertSorted (const Elem &el, int(*compar)(const void *, const void *))
bool Intersect (const Array &a)
Elem & Last () throw (Except)
const Elem & Last () const throw (Except)
Arrayoperator= (const Array &a)
Elem & operator[] (unsigned i)
const Elem & operator[] (unsigned i) const
void PushBack (const Elem &el)
void PushFront (const Elem &el)
void Resize (unsigned new_size)
void Reverse ()
void Set (const Elem &el)
unsigned Size () const
void Sort (int(*compar)(const void *, const void *))
void Swap (unsigned i, unsigned j)
 ~Array ()

Private Member Functions

void CheckIndex (unsigned i) const throw (Except)
void EnsureCapacity (unsigned need_size) throw (Except)

Private Attributes

Elem * array
 actual array
unsigned capacity
 allocated size of array
unsigned size
 used size of array

Static Private Attributes

static const unsigned DEFAULT_SIZE = 10

Detailed Description

template<class Elem>
class P::Array< Elem >

My own array class. STL vectors are just too complicated to debug and sorting is a nightmare, Note: Although I loathe templates, I am using them here, hoping that they won't make too many troubles later on...

Definition at line 21 of file Array.hh.


Constructor & Destructor Documentation

template<class Elem>
P::Array< Elem >::Array ( unsigned  s = 0) throw (Except)
template<class Elem>
P::Array< Elem >::Array ( const Array< Elem > &  a)
template<class Elem>
P::Array< Elem >::~Array ( )

Member Function Documentation

template<class Elem>
void P::Array< Elem >::CheckIndex ( unsigned  i) const throw (Except) [private]
template<class Elem>
unsigned P::Array< Elem >::CircularNext ( unsigned  i)
template<class Elem>
unsigned P::Array< Elem >::CircularPrev ( unsigned  i)
template<class Elem>
void P::Array< Elem >::Clear ( ) [inline]

Definition at line 60 of file Array.hh.

template<class Elem>
bool P::Array< Elem >::Contains ( const Elem &  el) const
template<class Elem>
bool P::Array< Elem >::ContainsBackwards ( const Elem &  el) const
template<class Elem>
void* P::Array< Elem >::Data ( )
template<class Elem>
void P::Array< Elem >::DeepCopy ( const Array< Elem > &  a)
template<class Elem>
bool P::Array< Elem >::Empty ( ) [inline]

Definition at line 40 of file Array.hh.

template<class Elem>
void P::Array< Elem >::EnsureCapacity ( unsigned  need_size) throw (Except) [private]
template<class Elem>
void P::Array< Elem >::Erase ( unsigned  i)
template<class Elem>
void P::Array< Elem >::EraseFirst ( )
template<class Elem>
void P::Array< Elem >::EraseLast ( )
template<class Elem>
unsigned P::Array< Elem >::Find ( const Elem &  el)
template<class Elem>
unsigned P::Array< Elem >::Find ( unsigned  start,
const Elem &  el 
)
template<class Elem>
unsigned P::Array< Elem >::FindBackwards ( const Elem &  el)
template<class Elem>
Elem& P::Array< Elem >::First ( ) throw (Except)
template<class Elem>
const Elem& P::Array< Elem >::First ( ) const throw (Except)
template<class Elem>
void P::Array< Elem >::InsertAfter ( unsigned  i,
const Elem &  el 
)
template<class Elem>
void P::Array< Elem >::InsertBefore ( unsigned  i,
const Elem &  el 
)
template<class Elem>
void P::Array< Elem >::InsertSorted ( const Elem &  el,
int(*)(const void *, const void *)  compar 
)
template<class Elem>
bool P::Array< Elem >::Intersect ( const Array< Elem > &  a)
template<class Elem>
Elem& P::Array< Elem >::Last ( ) throw (Except)
template<class Elem>
const Elem& P::Array< Elem >::Last ( ) const throw (Except)
template<class Elem>
Array& P::Array< Elem >::operator= ( const Array< Elem > &  a) [inline]

Definition at line 37 of file Array.hh.

template<class Elem>
Elem& P::Array< Elem >::operator[] ( unsigned  i)
template<class Elem>
const Elem& P::Array< Elem >::operator[] ( unsigned  i) const
template<class Elem>
void P::Array< Elem >::PushBack ( const Elem &  el)
template<class Elem>
void P::Array< Elem >::PushFront ( const Elem &  el)
template<class Elem>
void P::Array< Elem >::Resize ( unsigned  new_size)
template<class Elem>
void P::Array< Elem >::Reverse ( )
template<class Elem>
void P::Array< Elem >::Set ( const Elem &  el)
template<class Elem>
unsigned P::Array< Elem >::Size ( ) const [inline]

Definition at line 50 of file Array.hh.

template<class Elem>
void P::Array< Elem >::Sort ( int(*)(const void *, const void *)  compar)
template<class Elem>
void P::Array< Elem >::Swap ( unsigned  i,
unsigned  j 
)

Member Data Documentation

template<class Elem>
Elem* P::Array< Elem >::array [private]

actual array

Definition at line 26 of file Array.hh.

template<class Elem>
unsigned P::Array< Elem >::capacity [private]

allocated size of array

Definition at line 28 of file Array.hh.

template<class Elem>
const unsigned P::Array< Elem >::DEFAULT_SIZE = 10 [static, private]

Definition at line 24 of file Array.hh.

template<class Elem>
unsigned P::Array< Elem >::size [private]

used size of array

Definition at line 27 of file Array.hh.


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


blort
Author(s): Michael Zillich, Thomas Mörwald, Johann Prankl, Andreas Richtsfeld, Bence Magyar (ROS version)
autogenerated on Thu Jan 2 2014 11:38:26