39 #ifndef __EST_TKVL_H__ 40 #define __EST_TKVL_H__ 61 return( (i.
k == k) && (i.
v == v) );
64 friend std::ostream& operator << (std::ostream& s, EST_TKVI<K,V>
const &i)
65 {
return s << i.k <<
"\t" << i.v <<
"\n"; }
75 EST_Litem *find_pair_key(
const K &key)
const;
109 const V &
val(
const K &rkey,
bool m=0)
const;
111 V &
val(
const K &rkey,
bool m=0);
117 const V &val_def(
const K &rkey,
const V &def)
const;
120 const K &key(
EST_Litem *ptr,
int m=1)
const;
125 const K &key(
const V &
v,
int m=1)
const;
130 int change_val(
const K &rkey,
const V &rval);
133 int change_val(
EST_Litem *ptr,
const V &rval);
135 int change_key(
EST_Litem *ptr,
const K &rkey);
138 int add_item(
const K &rkey,
const V &rval,
int no_search = 0);
146 int present(
const K &rkey)
const;
149 void map(
void (*func)(K&, V&));
151 friend std::ostream& operator << (std::ostream& s, EST_TKVL<K,V>
const &l)
153 for (p = l.list.head(); p ; p = p->
next())
154 s << l.list(p).k <<
"\t" << l.list(p).v << std::endl;
197 K &
points_at(
const IPointer_k &ip) {
return list(ip.p).k; }
void point_to_first(IPointer &ip) const
void move_pointer_forwards(IPointer &ip) const
bool points_to_something(const IPointer_k &ip) const
static K * default_key
default value, returned when there is no such entry.
EST_TKVI< K, V > & points_at(const IPointer &ip)
EST_TRwIterator< EST_TKVL< K, V >, IPointer_k, KeyEntry > KeyRwEntries
bool points_to_something(const IPointer &ip) const
EST_TRwStructIterator< EST_TKVL< K, V >, IPointer, Entry > RwEntries
K & points_at(const IPointer_k &ip)
EST_TKVL()
default constructor
Templated Key-Value Item. Serves as the items in the list of the EST_TKVL class.
EST_TStructIterator< EST_TKVL< K, V >, IPointer, Entry > Entries
void point_to_first(IPointer_k &ip) const
EST_TIterator< EST_TKVL< K, V >, IPointer_k, KeyEntry > KeyEntries
void move_pointer_forwards(IPointer_k &ip) const
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.
EST_Pathname & operator+=(EST_Pathname p, const EST_Pathname addition)
EST_Litem * head() const
Return First key value pair in list.
Templated Key-Value list. Objects of type EST_TKVL contain lists which are accessed by a key of type ...
static V * default_val
default value, returned when there is no such entry.
EST_Complex operator+(const EST_Complex &z1, const EST_Complex &z2)
bool operator==(const EST_TKVI< K, V > &i)
int length() const
number of key value pairs in list
void remove_item(EST_Item *l, const char *relname)