Zen
A cross-platform functional programming language

dictbase< derT, K, V > Class Template Reference

base class for all dicts More...

#include <zbl.hpp>

Inheritance diagram for dictbase< derT, K, V >:
containerbase< QMap< K, V > >

List of all members.

Classes

class  creator
 Class to create and populate a dict instance. More...
class  found
 Class holding result of a find() in a dict. More...
class  iterator
 Dictionary iterator class. More...

Public Member Functions

void insert (const K &k, const V &v)
 Insert a key-value pair in the dictionary.
bool has (const K &k) const
 Check if key is in the dictionary.
found find (const K &k) const
 Find key in the dictionary.
const QMap< K, V > & get () const
 Returns the stored value.
V & at (const K &key)
 Return reference to value of key.
V & operator[] (const K &key)
 Return reference to value of key.

Private Types

typedef containerbase< QMap< K,
V > > 
baseT
 The base class type.

Detailed Description

template<typename derT, typename K, typename V>
class z::dictbase< derT, K, V >

base class for all dicts


Member Function Documentation

V& at ( const K &  key) [inline]

Return reference to value of key.

Parameters:
keyThe key
Returns:
Reference to value at specified key

Todo:
Find out why _list.value() returns a const value.

found find ( const K &  k) const [inline]

Find key in the dictionary.

Parameters:
kKey to find
Returns:
found instance containing result of search
const QMap<K,V>& get ( ) const [inline]

Returns the stored value.

Returns:
The value
bool has ( const K &  k) const [inline]

Check if key is in the dictionary.

Parameters:
kKey to find
Returns:
True if key is found
void insert ( const K &  k,
const V &  v 
) [inline]

Insert a key-value pair in the dictionary.

Parameters:
kKey to add
vValue to add
V& operator[] ( const K &  key) [inline]

Return reference to value of key.

Parameters:
keyThe key
Returns:
Reference to value at specified key

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