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
.
More...
#include <include/EST_TKVL.h>
Classes | |
class | IPointer |
struct | IPointer_k |
Public Types | |
typedef EST_TKVI< K, V > | Entry |
typedef EST_TStructIterator< EST_TKVL< K, V >, IPointer, Entry > | Entries |
typedef EST_TRwStructIterator< EST_TKVL< K, V >, IPointer, Entry > | RwEntries |
typedef K | KeyEntry |
typedef EST_TIterator< EST_TKVL< K, V >, IPointer_k, KeyEntry > | KeyEntries |
typedef EST_TRwIterator< EST_TKVL< K, V >, IPointer_k, KeyEntry > | KeyRwEntries |
Public Member Functions | |
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... | |
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 More... | |
template<> | |
EST_IList * | default_val |
template<> | |
int * | default_key |
Constructor functions | |
EST_TKVL () | |
default constructor More... | |
EST_TKVL (const EST_TKVL< K, V > &kv) | |
copy constructor More... | |
Access functions. | |
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) |
int | change_val (EST_Litem *ptr, const V &rval) |
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... | |
Public Attributes | |
EST_TList< EST_TKVI< K, V > > | list |
Linked list of key-val pairs. Don't use this as it will be made private in the future. More... | |
Static Public Attributes | |
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. More... | |
Protected Member Functions | |
void | point_to_first (IPointer &ip) const |
void | move_pointer_forwards (IPointer &ip) const |
bool | points_to_something (const IPointer &ip) const |
EST_TKVI< K, V > & | points_at (const IPointer &ip) |
void | point_to_first (IPointer_k &ip) const |
void | move_pointer_forwards (IPointer_k &ip) const |
bool | points_to_something (const IPointer_k &ip) const |
K & | points_at (const IPointer_k &ip) |
Friends | |
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 > |
std::ostream & | operator<< (std::ostream &s, EST_TKVL< K, V > const &l) |
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
.
Definition at line 73 of file EST_TKVL.h.
Definition at line 185 of file EST_TKVL.h.
typedef EST_TStructIterator< EST_TKVL<K, V>, IPointer, Entry> EST_TKVL< K, V >::Entries |
Definition at line 186 of file EST_TKVL.h.
typedef EST_TRwStructIterator< EST_TKVL<K, V>, IPointer, Entry> EST_TKVL< K, V >::RwEntries |
Definition at line 187 of file EST_TKVL.h.
Definition at line 203 of file EST_TKVL.h.
typedef EST_TIterator< EST_TKVL<K, V>, IPointer_k, KeyEntry> EST_TKVL< K, V >::KeyEntries |
Definition at line 204 of file EST_TKVL.h.
typedef EST_TRwIterator< EST_TKVL<K, V>, IPointer_k, KeyEntry> EST_TKVL< K, V >::KeyRwEntries |
Definition at line 205 of file EST_TKVL.h.
default constructor
Definition at line 81 of file EST_TKVL.h.
copy constructor
Definition at line 44 of file EST_TKVL.cc.
number of key value pairs in list
Definition at line 97 of file EST_TKVL.h.
Return First key value pair in list.
Definition at line 100 of file EST_TKVL.h.
void EST_TKVL< K, V >::clear | ( | void | ) |
Empty list.
Definition at line 50 of file EST_TKVL.cc.
return value according to key (const)
Definition at line 145 of file EST_TKVL.cc.
return value according to key (non-const)
Definition at line 129 of file EST_TKVL.cc.
return value according to ptr
Definition at line 181 of file EST_TKVL.cc.
return value according to ptr
Definition at line 164 of file EST_TKVL.cc.
const V & EST_TKVL< K, V >::val_def | ( | const K & | rkey, |
const V & | def | ||
) | const |
value or default
Definition at line 151 of file EST_TKVL.cc.
find key, reference by ptr
Definition at line 201 of file EST_TKVL.cc.
find key, reference by ptr
Definition at line 190 of file EST_TKVL.cc.
return first matching key, referenced by val
Definition at line 207 of file EST_TKVL.cc.
change key-val pair. If no corresponding entry is present, add to end of list.
Definition at line 113 of file EST_TKVL.cc.
change key-val pair. If no corresponding entry is present, add to end of list.
Definition at line 87 of file EST_TKVL.cc.
change name of key pair.
Definition at line 99 of file EST_TKVL.cc.
int EST_TKVL< K, V >::add_item | ( | const K & | rkey, |
const V & | rval, | ||
int | no_search = 0 |
||
) |
add key-val pair to list
Definition at line 248 of file EST_TKVL.cc.
remove key and val pair from list
Definition at line 263 of file EST_TKVL.cc.
Returns true if key is present.
Definition at line 222 of file EST_TKVL.cc.
void EST_TKVL< K, V >::map | ( | void(*)(K &, V &) | func | ) |
apply function to each pair
Definition at line 233 of file EST_TKVL.cc.
EST_TKVL< K, V > & EST_TKVL< K, V >::operator= | ( | const EST_TKVL< K, V > & | kv | ) |
full copy of KV list.
Definition at line 284 of file EST_TKVL.cc.
EST_TKVL< K, V > & EST_TKVL< K, V >::operator+= | ( | const EST_TKVL< K, V > & | kv | ) |
add kv after existing list.
Definition at line 291 of file EST_TKVL.cc.
EST_TKVL< K, V > EST_TKVL< K, V >::operator+ | ( | const EST_TKVL< K, V > & | kv | ) |
make new concatenated list
Definition at line 297 of file EST_TKVL.cc.
|
inlineprotected |
Definition at line 174 of file EST_TKVL.h.
|
inlineprotected |
Definition at line 175 of file EST_TKVL.h.
|
inlineprotected |
Definition at line 176 of file EST_TKVL.h.
|
inlineprotected |
Definition at line 177 of file EST_TKVL.h.
|
inlineprotected |
Definition at line 194 of file EST_TKVL.h.
|
inlineprotected |
Definition at line 195 of file EST_TKVL.h.
|
inlineprotected |
Definition at line 196 of file EST_TKVL.h.
|
inlineprotected |
Definition at line 197 of file EST_TKVL.h.
Definition at line 62 of file wfst_ops.cc.
Definition at line 63 of file wfst_ops.cc.
|
friend |
Definition at line 179 of file EST_TKVL.h.
|
friend |
Definition at line 180 of file EST_TKVL.h.
|
friend |
Definition at line 181 of file EST_TKVL.h.
|
friend |
Definition at line 182 of file EST_TKVL.h.
|
friend |
Definition at line 199 of file EST_TKVL.h.
|
friend |
Definition at line 200 of file EST_TKVL.h.
|
friend |
Definition at line 151 of file EST_TKVL.h.
|
static |
default value, returned when there is no such entry.
Definition at line 87 of file EST_TKVL.h.
|
static |
default value, returned when there is no such entry.
Definition at line 90 of file EST_TKVL.h.
Linked list of key-val pairs. Don't use this as it will be made private in the future.
Definition at line 94 of file EST_TKVL.h.