In file ../include/EST_TKVL.h:

template<class K, class V> class EST_TKVL

Templated Key-Value list.

Inheritance:


Public Fields

[more]static V* default_val
default value, returned when there is no such entry
[more]static K* default_key
default value, returned when there is no such entry

Public Methods

[more] Constructor functions

[more] EST_TKVL ()
default constructor
[more] EST_TKVL (const EST_TKVL<K, V> &kv)
copy constructor

[more]const int length () const
number of key value pairs in list
[more]EST_Litem* head () const
Return First key value pair in list
[more]void clear ()
Empty list
[more] Access functions.

[more]const V& val (const K &rkey, bool m=0) const
return value according to key (const)
[more]V& val (const K &rkey, bool m=0)
return value according to key (non-const)
[more]const V& val (EST_Litem* ptr, bool m=0) const
return value according to ptr
[more]V& val (EST_Litem* ptr, bool m=0)
return value according to ptr
[more]const V& val_def (const K &rkey, const V &def) const
value or default
[more]const K& key (EST_Litem* ptr, int m=1) const
find key, reference by ptr
[more]K& key (EST_Litem* ptr, int m=1)
find key, reference by ptr
[more]const K& key (const V &v, int m=1) const
return first matching key, referenced by val
[more]int change_val (const K &rkey, const V &rval)
change key-val pair.
[more]int change_val (EST_Litem* ptr, const V &rval)
change key-val pair.
[more]int change_key (EST_Litem* ptr, const K &rkey)
change name of key pair
[more]int add_item (const K &rkey, const V &rval, int no_search = 0)
add key-val pair to list
[more]int remove_item (const K &rkey, int quiet = 0)
remove key and val pair from list

[more]const int present (const K &rkey) const
Returns true if key is present
[more]void map (void (*func)(K&, V&))
apply function to each pair
[more]EST_TKVL<K, V> & operator = (const EST_TKVL<K, V> &kv)
full copy of KV list
[more]EST_TKVL<K, V> & operator += (const EST_TKVL<K, V> &kv)
add kv after existing list
[more]EST_TKVL<K, V> operator + (const EST_TKVL<K, V> &kv)
make new concatenated list

Public

[more] Linked list of key-val pairs.


Documentation

Templated Key-Value list. Objects of type EST_TKVL contain lists which are accessed by a key of type K, which returns a value of type V.
o Constructor functions

o EST_TKVL()
default constructor

o EST_TKVL(const EST_TKVL<K, V> &kv)
copy constructor

ostatic V* default_val
default value, returned when there is no such entry

ostatic K* default_key
default value, returned when there is no such entry

o Linked list of key-val pairs.
Linked list of key-val pairs. Don't use

oconst int length() const
number of key value pairs in list

oEST_Litem* head() const
Return First key value pair in list

ovoid clear()
Empty list

o Access functions.

oconst V& val(const K &rkey, bool m=0) const
return value according to key (const)

oV& val(const K &rkey, bool m=0)
return value according to key (non-const)

oconst V& val(EST_Litem* ptr, bool m=0) const
return value according to ptr

oV& val(EST_Litem* ptr, bool m=0)
return value according to ptr

oconst V& val_def(const K &rkey, const V &def) const
value or default

oconst K& key(EST_Litem* ptr, int m=1) const
find key, reference by ptr

oK& key(EST_Litem* ptr, int m=1)
find key, reference by ptr

oconst K& key(const V &v, int m=1) const
return first matching key, referenced by val

oint change_val(const K &rkey, const V &rval)
change key-val pair. If no corresponding entry is present, add to end of list.

oint change_val(EST_Litem* ptr, const V &rval)
change key-val pair. If no corresponding entry is present, add to end of list.

oint change_key(EST_Litem* ptr, const K &rkey)
change name of key pair

oint add_item(const K &rkey, const V &rval, int no_search = 0)
add key-val pair to list

oint remove_item(const K &rkey, int quiet = 0)
remove key and val pair from list

oconst int present(const K &rkey) const
Returns true if key is present

ovoid map(void (*func)(K&, V&))
apply function to each pair

oEST_TKVL<K, V> & operator = (const EST_TKVL<K, V> &kv)
full copy of KV list

oEST_TKVL<K, V> & operator += (const EST_TKVL<K, V> &kv)
add kv after existing list

oEST_TKVL<K, V> operator + (const EST_TKVL<K, V> &kv)
make new concatenated list


Direct child classes:
EST_Option
Friends:
ostream& operator << (ostream& s, EST_TKVL<K,V> const &kv)
class EST_TIterator< EST_TKVL<K, V>, IPointer, EST_TKVI<K, V> >
class EST_TStructIterator< EST_TKVL<K, V>, IPointer, EST_TKVI<K, V> >
class EST_TRwIterator< EST_TKVL<K, V>, IPointer, EST_TKVI<K, V> >
class EST_TRwStructIterator< EST_TKVL<K, V>, IPointer, EST_TKVI<K, V> >
class EST_TIterator< EST_TKVL<K, V>, IPointer_k, K >
class EST_TRwIterator< EST_TKVL<K, V>, IPointer_k, K >

Alphabetic index HTML hierarchy of classes or Java


This page is part of the Edinburgh Speech Tools Library documentation
Copyright University of Edinburgh 1997
Contact: speech_tools@cstr.ed.ac.uk