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

#include </home/casse/Dev/elm/src/concepts.h>

+ Inheritance diagram for MutableMap< K, T >:

Public Member Functions

void clear ()
 
void put (const K &key, const T &value)
 
void removeByKey (const K &key)
 
void remove (const Collection< T >::Iter &iter)
 
T & operator[] (const K &k)
 
- Public Member Functions inherited from Map< K, T >
Option< const T & > get (const K &key) const
 
const T & get (const K &key, const T &def) const
 
bool hasKey (const K &key) const
 
Iterable< KeyIterkeys () const
 
Iterable< PairIter > pairs () const
 
const T & operator[] (const K &k) const
 
- Public Member Functions inherited from Collection< T >
int count (void)
 
bool contains (const T &item)
 
template<template< class _ > class C>
bool containsAll (const C< T > &collection)
 
bool isEmpty (void)
 
 operator bool (void)
 
Iter begin (void) const
 
Iter end (void) const
 
bool equals (const Collection &coll)
 
bool operator== (const Collection &coll)
 
bool operator!= (const Collection &coll)
 

Additional Inherited Members

- Public Types inherited from Collection< T >
typedef T t
 
typedef Collection< T > self_t
 
- Static Public Attributes inherited from Collection< T >
static const Collection null
 
static const Collection< T > null
 

Detailed Description

template<class K, class T>
class elm::concept::MutableMap< K, T >

A map that may be modified.

Implemented by:

Member Function Documentation

◆ clear()

void clear ( )

Remove the content of the map.

◆ operator[]()

T& operator[] ( const K &  k)

Get a value by its key, value that can be modified. If a value corresponding to the key is not available, creates it.

Parameters
kLooked key.
Returns
Corresponding value.

◆ put()

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

Put a new value in the map.

Parameters
keyKey of the item to put.
valueValue of the item to put.

◆ remove()

void remove ( const Collection< T >::Iter iter)

Remove an item using an iterator.

Parameters
iterIterator to use.

◆ removeByKey()

void removeByKey ( const K &  key)

Remove a value by its key.

Parameters
keyKey of the value to remove.

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