My Project
Public Types | Public Member Functions
Dynamic_array< Elem > Class Template Reference

List of all members.

Public Types

typedef int(* CMP_FUNC )(const Elem *el1, const Elem *el2)

Public Member Functions

 Dynamic_array (uint prealloc=16, uint increment=16)
void init (uint prealloc=16, uint increment=16)
Elem & at (int idx)
const Elem & at (int idx) const
 Const variant of at(), which cannot change data.
Elem * front ()
const Elem * front () const
Elem * back ()
const Elem * back () const
bool append (const Elem &el)
Elem & pop ()
 Pops the last element. Does nothing if array is empty.
void del (uint idx)
int elements () const
void elements (uint num_elements)
void clear ()
void set (uint idx, const Elem &el)
void sort (CMP_FUNC cmp_func)

template<class Elem>
class Dynamic_array< Elem >


Member Function Documentation

template<class Elem>
bool Dynamic_array< Elem >::append ( const Elem &  el) [inline]
Return values:
falseok
trueOOM, my_error() has been called.
template<class Elem>
Elem& Dynamic_array< Elem >::at ( int  idx) [inline]
Note:
Though formally this could be declared "const" it would be misleading at it returns a non-const pointer to array's data.
template<class Elem>
Elem* Dynamic_array< Elem >::back ( ) [inline]
Returns:
pointer to last element; undefined behaviour if array is empty.
template<class Elem>
const Elem* Dynamic_array< Elem >::back ( ) const [inline]
Returns:
pointer to last element; undefined behaviour if array is empty.
template<class Elem>
Elem* Dynamic_array< Elem >::front ( ) [inline]
Returns:
pointer to first element; undefined behaviour if array is empty
template<class Elem>
const Elem* Dynamic_array< Elem >::front ( ) const [inline]
Returns:
pointer to first element; undefined behaviour if array is empty

The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines