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

#include <elm/avl/Map.h>

+ Inheritance diagram for Map< K, T, C, E, A >:

Classes

class  Iter
 
class  KeyIter
 
class  PairIter
 

Public Types

typedef Map< K, T, C, E, A > self_t
 
- Public Types inherited from Equiv< T >
typedef T t
 

Public Member Functions

const C & comparator () const
 
C & comparator ()
 
const C & allocatr () const
 
C & allocator ()
 
const E & equivalence () const
 
E & equivalence ()
 
int count (void) const
 
bool contains (const T &x) const
 
template<class CC >
bool containsAll (const CC &c) const
 
bool isEmpty (void) const
 
 operator bool () const
 
Iter begin () const
 
Iter end () const
 
bool equals (const Map< K, T, C > &map) const
 
bool operator== (const Map< K, T, C > &map) const
 
bool operator!= (const Map< K, T, C > &map) const
 
Option< T > get (const K &key) const
 
const T & get (const K &key, const T &def) const
 
bool hasKey (const K &key) const
 
const T & operator[] (const K &k) const
 
Iterable< KeyIterkeys () const
 
Iterable< PairIterpairs () const
 
void put (const K &key, const T &value)
 
void remove (const K &key)
 
void remove (const Iter &i)
 
void clear (void)
 
void copy (const Map< K, T, C > &map)
 
Map< K, T, C > & operator= (const Map< K, T, C > &map)
 
- Public Member Functions inherited from Equiv< T >
bool isEqual (const T &v1, const T &v2) const
 

Additional Inherited Members

- Static Public Member Functions inherited from Equiv< T >
static bool equals (const T &v1, const T &v2)
 
- Static Public Attributes inherited from Equiv< T >
static Equiv< T > def
 

Detailed Description

template<class K, class T, class C = Comparator<K>, class E = Equiv<T>, class A = DefaultAlloc>
class elm::avl::Map< K, T, C, E, A >

Implements a map based on AVL tree, that is, a map supporting O(log n) accesses.

Implemented concepts
Parameters
KType of keys of the map.
TType of stored items.
CComparator used to sort the items (must implements the elm::concept::Comparator<K> concept, as a default elm::Comparator<K>).
See also
elm::avl::GenTree

Member Typedef Documentation

◆ self_t

typedef Map<K, T, C, E, A> self_t

Member Function Documentation

◆ allocator()

C& allocator ( )
inline

◆ allocatr()

const C& allocatr ( ) const
inline

◆ begin()

Iter begin ( ) const
inline

◆ clear()

void clear ( void  )
inline

◆ comparator() [1/2]

C& comparator ( )
inline

◆ comparator() [2/2]

const C& comparator ( ) const
inline

◆ contains()

bool contains ( const T &  x) const
inline

◆ containsAll()

bool containsAll ( const CC &  c) const
inline

◆ copy()

void copy ( const Map< K, T, C > &  map)
inline

◆ count()

int count ( void  ) const
inline

◆ end()

Iter end ( ) const
inline

◆ equals()

◆ equivalence() [1/2]

E& equivalence ( )
inline

◆ equivalence() [2/2]

const E& equivalence ( ) const
inline

◆ get() [1/2]

Option<T> get ( const K &  key) const
inline

◆ get() [2/2]

const T& get ( const K &  key,
const T &  def 
) const
inline

◆ hasKey()

bool hasKey ( const K &  key) const
inline

◆ isEmpty()

bool isEmpty ( void  ) const
inline

◆ keys()

Iterable<KeyIter> keys ( ) const
inline

◆ operator bool()

operator bool ( ) const
inline

◆ operator!=()

bool operator!= ( const Map< K, T, C > &  map) const
inline

◆ operator=()

Map<K, T, C>& operator= ( const Map< K, T, C > &  map)
inline

◆ operator==()

bool operator== ( const Map< K, T, C > &  map) const
inline

◆ operator[]()

const T& operator[] ( const K &  k) const
inline

◆ pairs()

Iterable<PairIter> pairs ( ) const
inline

◆ put()

void put ( const K &  key,
const T &  value 
)
inline

◆ remove() [1/2]

void remove ( const Iter i)
inline

◆ remove() [2/2]

void remove ( const K &  key)
inline

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