#include <Array.hh>
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) |
| Array & | operator= (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 |
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...
| void P::Array< Elem >::CheckIndex | ( | unsigned | i | ) | const throw (Except) [private] |
| unsigned P::Array< Elem >::CircularNext | ( | unsigned | i | ) |
| unsigned P::Array< Elem >::CircularPrev | ( | unsigned | i | ) |
| bool P::Array< Elem >::ContainsBackwards | ( | const Elem & | el | ) | const |
| void P::Array< Elem >::EnsureCapacity | ( | unsigned | need_size | ) | throw (Except) [private] |
| void P::Array< Elem >::EraseFirst | ( | ) |
| unsigned P::Array< Elem >::FindBackwards | ( | const Elem & | el | ) |
| void P::Array< Elem >::InsertAfter | ( | unsigned | i, |
| const Elem & | el | ||
| ) |
| void P::Array< Elem >::InsertBefore | ( | unsigned | i, |
| const Elem & | el | ||
| ) |
| void P::Array< Elem >::InsertSorted | ( | const Elem & | el, |
| int(*)(const void *, const void *) | compar | ||
| ) |
| Elem& P::Array< Elem >::operator[] | ( | unsigned | i | ) |
| const Elem& P::Array< Elem >::operator[] | ( | unsigned | i | ) | const |
const unsigned P::Array< Elem >::DEFAULT_SIZE = 10 [static, private] |