#include <include/EST_TKVL.h>
Classes | |
struct | 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 | |
const int | length () const |
number of key value pairs in list | |
EST_Litem * | head () const |
Return First key value pair in list. | |
void | clear () |
Empty list. | |
const int | present (const K &rkey) const |
Returns true if key is present. | |
void | map (void(*func)(K &, V &)) |
apply function to each pair | |
EST_TKVL< K, V > & | operator= (const EST_TKVL< K, V > &kv) |
full copy of KV list. | |
EST_TKVL< K, V > & | operator+= (const EST_TKVL< K, V > &kv) |
add kv after existing list. | |
EST_TKVL< K, V > | operator+ (const EST_TKVL< K, V > &kv) |
make new concatenated list | |
template<> | |
EST_IList * | default_val |
template<> | |
int * | default_key |
Constructor functions | |
EST_TKVL () | |
default constructor | |
EST_TKVL (const EST_TKVL< K, V > &kv) | |
copy constructor | |
Access functions. | |
const V & | val (const K &rkey, bool m=0) const |
return value according to key (const) | |
V & | val (const K &rkey, bool m=0) |
return value according to key (non-const) | |
const V & | val (EST_Litem *ptr, bool m=0) const |
return value according to ptr | |
V & | val (EST_Litem *ptr, bool m=0) |
return value according to ptr | |
const V & | val_def (const K &rkey, const V &def) const |
value or default | |
const K & | key (EST_Litem *ptr, int m=1) const |
find key, reference by ptr | |
K & | key (EST_Litem *ptr, int m=1) |
find key, reference by ptr | |
const K & | key (const V &v, int m=1) const |
return first matching key, referenced by val | |
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. | |
int | add_item (const K &rkey, const V &rval, int no_search=0) |
add key-val pair to list | |
int | remove_item (const K &rkey, int quiet=0) |
remove key and val pair from list | |
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. | |
Static Public Attributes | |
static V * | default_val |
default value, returned when there is no such entry. | |
static K * | default_key |
default value, returned when there is no such entry. | |
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 > |
ostream & | operator<< (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 72 of file EST_TKVL.h.
int EST_TKVL< K, V >::change_val | ( | const K & | rkey, |
const V & | rval | ||
) |
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.