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

#include <elm/data/ListMap.h>

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

Classes

class  Iter
 
class  KeyIter
 

Public Types

typedef ListMap< K, T, C, E, A > self_t
 
typedef base_t::Iter PairIter
 
- Public Types inherited from Equiv< T >
typedef T t
 

Public Member Functions

 ListMap ()
 
 ListMap (const ListMap< K, T > &l)
 
E & equivalence ()
 
Iter begin (void) const
 
Iter end (void) const
 
int count (void) const
 
bool contains (const T &v) const
 
template<class CC >
bool containsAll (const CC &c) const
 
bool isEmpty (void) const
 
 operator bool (void) const
 
Iter items (void) const
 
Iter operator* (void) const
 
 operator Iter (void) const
 
bool equals (const self_t &m) const
 
bool operator== (const self_t &m) const
 
bool operator!= (const self_t &m) const
 
bool contains (const self_t &m) const
 
bool operator<= (const self_t &m) const
 
bool operator< (const self_t &m) const
 
bool operator>= (const self_t &m) const
 
bool operator> (const self_t &m) const
 
Option< T > get (const K &k) const
 
const T & get (const K &k, const T &d) const
 
bool hasKey (const K &k) const
 
Iterable< KeyIterkeys () const
 
Iterable< PairIterpairs () const
 
void put (const K &k, const T &v)
 
void remove (const Iter &i)
 
void remove (const K &k)
 
- 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::ListMap< K, T, C, E, A >

Map implemented as a list of sorted pairs. This class is relatively cheap but should not be used with a big number of entries (without enduring severe performances degradation).

For a map of size N, the complexity are:

  • retrieve time: O(N/2) on average, O(N) worst case.
  • insertion time: O(N/2) on average, O(N) worst case.
Parameters
KType of keys.
TType of values.
MManager type (default to ListMapManager).

Member Typedef Documentation

◆ PairIter

◆ self_t

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

Constructor & Destructor Documentation

◆ ListMap() [1/2]

ListMap ( )
inline

◆ ListMap() [2/2]

ListMap ( const ListMap< K, T > &  l)
inline

Member Function Documentation

◆ begin()

◆ contains() [1/2]

bool contains ( const self_t m) const
inline

◆ contains() [2/2]

◆ containsAll()

bool containsAll ( const CC &  c) const
inline

◆ count()

int count ( void  ) const
inline

◆ end()

Iter end ( void  ) const
inline

◆ equals()

◆ equivalence()

E& equivalence ( )
inline

◆ get() [1/2]

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

Referenced by Section::get(), and File::get().

◆ get() [2/2]

const T& get ( const K &  k,
const T &  d 
) const
inline

◆ hasKey()

bool hasKey ( const K &  k) const
inline

Referenced by Section::get(), and Section::isDefined().

◆ isEmpty()

bool isEmpty ( void  ) const
inline

◆ items()

Iter items ( void  ) const
inline

Referenced by File::~File().

◆ keys()

Iterable<KeyIter> keys ( ) const
inline

◆ operator bool()

operator bool ( void  ) const
inline

◆ operator Iter()

operator Iter ( void  ) const
inline

◆ operator!=()

bool operator!= ( const self_t m) const
inline

◆ operator*()

Iter operator* ( void  ) const
inline

◆ operator<()

bool operator< ( const self_t m) const
inline

◆ operator<=()

bool operator<= ( const self_t m) const
inline

◆ operator==()

bool operator== ( const self_t m) const
inline

◆ operator>()

bool operator> ( const self_t m) const
inline

◆ operator>=()

bool operator>= ( const self_t m) const
inline

◆ pairs()

Iterable<PairIter> pairs ( ) const
inline

◆ put()

void put ( const K &  k,
const T &  v 
)
inline

◆ remove() [1/2]

void remove ( const Iter i)
inline

◆ remove() [2/2]

void remove ( const K &  k)
inline

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