49 template <
class K,
class V>
55 template <
class K,
class V>
60 for (ptr = list.head(); ptr != 0; ptr= ptr->
next())
61 if (list.item(ptr).k == key)
66 template <
class K,
class V>
73 for (ptr = list.head(); ptr != 0; ptr= ptr->
next())
76 if (list.item(ptr).v ==
val)
86 template <
class K,
class V>
89 if (list.index(kptr) == -1)
93 list.item(kptr).v = rval;
98 template <
class K,
class V>
101 if (list.index(kptr) == -1)
105 list.item(kptr).k = rkey;
112 template <
class K,
class V>
120 list.item(ptr).v = rval;
128 template<
class K,
class V>
141 return list.item(ptr).v;
144 template<
class K,
class V>
150 template<
class K,
class V>
157 return list.item(ptr).v;
163 template<
class K,
class V>
167 return list.item(kptr).v;
169 if (list.index(kptr) == -1)
176 return list.item(kptr).v;
180 template<
class K,
class V>
189 template<
class K,
class V>
193 return list.item(kptr).k;
194 if (list.index(kptr) == -1)
197 return list.item(kptr).k;
200 template<
class K,
class V>
206 template<
class K,
class V>
218 return list.item(ptr).k;
221 template<
class K,
class V>
224 if (find_pair_key(rkey) == 0)
232 template<
class K,
class V>
236 for(p=list.head(); p; p=p->
next())
239 (*func)(item.
k, item.
v);
247 template<
class K,
class V>
251 if (change_val(rkey, rval))
262 template<
class K,
class V>
272 EST_warning(
"EST_TKVL: no item labelled '%s'", en);
290 template<
class K,
class V>
EST_TKVL<K, V> &EST_TKVL<K, V>::operator +=
const K & key(EST_Litem *ptr, int m=1) const
find key, reference by ptr
int change_key(EST_Litem *ptr, const K &rkey)
change name of key pair.
void map(void(*func)(K &, V &))
apply function to each pair
EST_TKVL< K, V > operator+(const EST_TKVL< K, V > &kv)
make new concatenated list
int change_val(const K &rkey, const V &rval)
EST_TKVL()
default constructor
EST_String error_name(const EST_Features &a)
Templated Key-Value Item. Serves as the items in the list of the EST_TKVL class.
const V & val_def(const K &rkey, const V &def) const
value or default
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.
int remove_item(const K &rkey, int quiet=0)
remove key and val pair from list
Templated Key-Value list. Objects of type EST_TKVL contain lists which are accessed by a key of type ...
const V & val(const K &rkey, bool m=0) const
return value according to key (const)
int add_item(const K &rkey, const V &rval, int no_search=0)
add key-val pair to list
int present(const K &rkey) const
Returns true if key is present.