Elm  2
ELM is a library providing generic data structures, OS-independent interface, plugins and XML.
Queue< T, C, A > Class Template Reference

#include <elm/avl/Queue.h>

+ Inheritance diagram for Queue< T, C, A >:

Public Types

typedef T t
 
typedef Queue< T, C > self_t
 
typedef GenTree< T, IdAdapter< T >, C, A > base_t
 
- Public Types inherited from GenTree< T, IdAdapter< T >, elm::Comparator< T >, DefaultAlloc >
typedef T t
 
typedef GenTree< T, IdAdapter< T >, elm::Comparator< T >, DefaultAllocself_t
 
- Public Types inherited from Comparator< T >
typedef T t
 

Public Member Functions

const T & head () const
 
get ()
 
void put (const T &x)
 
void reset ()
 
- Public Member Functions inherited from GenTree< T, IdAdapter< T >, elm::Comparator< T >, DefaultAlloc >
 GenTree (void)
 
 GenTree (const GenTree< T > &tree)
 
 ~GenTree (void)
 
const elm::Comparator< T > & comparator () const
 
elm::Comparator< T > & comparator ()
 
const DefaultAllocallocator () const
 
DefaultAllocallocator ()
 
T * get (const typename IdAdapter< T > ::key_t &key)
 
const T * get (const typename IdAdapter< T > ::key_t &key) const
 
void set (const T &item)
 
void removeByKey (const typename IdAdapter< T > ::key_t &item)
 
int count (void) const
 
bool contains (const typename IdAdapter< T > ::key_t &item) const
 
bool containsAll (const CC &c) const
 
bool isEmpty (void) const
 
 operator bool (void) const
 
Iter begin (void) const
 
Iter end (void) const
 
bool equals (const GenTree< T, IdAdapter< T >, elm::Comparator< T > > &tree) const
 
bool operator== (const GenTree< T, IdAdapter< T >, elm::Comparator< T > > &tree) const
 
bool operator!= (const GenTree< T, IdAdapter< T >, elm::Comparator< T > > &tree) const
 
void clear (void)
 
void add (const T &item)
 
void addAll (const CC &c)
 
void remove (const T &x)
 
void remove (const Iter &iter)
 
void removeAll (const CC &c)
 
self_toperator+= (const T &x)
 
self_toperator-= (const T &x)
 
void copy (const GenTree< T, IdAdapter< T >, elm::Comparator< T > > &tree)
 
GenTree< T, IdAdapter< T >, elm::Comparator< T > > & operator= (const GenTree< T, IdAdapter< T >, elm::Comparator< T > > &tree)
 
- Public Member Functions inherited from AbstractTree
int count (void) const
 
- Public Member Functions inherited from Comparator< T >
int doCompare (const T &v1, const T &v2) const
 
- Public Member Functions inherited from DefaultAllocatorDelegate
t::ptr allocate (t::size size) const
 
void free (t::ptr p) const
 
template<class T >
T * alloc () const
 

Additional Inherited Members

- Static Public Member Functions inherited from Comparator< T >
static int compare (const T &v1, const T &v2)
 
- Protected Types inherited from AbstractTree
enum  dir_t { LEFT = -1, NONE = 0, RIGHT = +1 }
 
typedef signed char balance_t
 
- Protected Member Functions inherited from GenTree< T, IdAdapter< T >, elm::Comparator< T >, DefaultAlloc >
Noderoot (void) const
 
void remove (Stack &s, Node *n)
 
int compare (const typename IdAdapter< T > ::key_t &k1, const typename IdAdapter< T > ::key_t &k2) const
 
Nodelookup (Stack &s, const typename IdAdapter< T > ::key_t &key) const
 
Nodefind (const typename IdAdapter< T > ::key_t &key) const
 
void exchange (Node *n, Node *p)
 
- Protected Member Functions inherited from AbstractTree
 AbstractTree (void)
 
Node ** link (const Stack &s)
 
void exchange (Node *n, Node *m)
 
void insert (Stack &stack, Node *node)
 
void rotateRight (Stack &s)
 
void rotateLeft (Stack &s)
 
void remove (Stack &stack, Node *n)
 
NodeleftMost (Stack &s, Node *n)
 
- Protected Attributes inherited from AbstractTree
Node_root
 
int _cnt
 
- Static Protected Attributes inherited from AbstractTree
static const int MAX_HEIGHT = 32
 

Detailed Description

template<class T, class C = elm::Comparator<T>, class A = DefaultAlloc>
class elm::avl::Queue< T, C, A >

Implements a sorted queue based on AVL trees: putting or getting the head element is obtained in O(log n) complexity.

Implemented concepts
  • elm::concept::Collection<T>
  • elm::concept::Queue<T>
Parameters
TType of elements of the queue.
CComparator to sort the queue (default to elm::Comparator).
AAlloctaor (default (to elm::DefaultAlloc).
See also
elm::avl::GenTree

Member Typedef Documentation

◆ base_t

typedef GenTree<T, IdAdapter<T>, C, A> base_t

◆ self_t

typedef Queue<T, C> self_t

◆ t

typedef T t

Member Function Documentation

◆ get()

◆ head()

◆ put()

void put ( const T &  x)
inline

◆ reset()

void reset ( )
inline

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