Loading...
Searching...
No Matches
EST_TKVL< K, V > Class Template Reference

`#include <include/EST_TKVL.h>`

Collaboration diagram for EST_TKVL< K, V >:
[legend]

## Classes

struct | IPointer
struct | IPointer_k

## Access functions.

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
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)
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
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
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)

## Constructor functions

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.
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_TKVL ()
| default constructor
| EST_TKVL (const EST_TKVL< K, V > &kv)
| copy constructor
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.

## Detailed Description

template<class K, class V>
class EST_TKVL< K, V >

Templated Key-Value list. Objects of type EST_TKVL contain lists which are accessed by a key of type {\bf K}, which returns a value of type {\bf V}.

Definition at line 72 of file EST_TKVL.h.

## Member Typedef Documentation

## Entry

template<class K, class V>

typedef EST_TKVI<K, V> EST_TKVL< K, V >::Entry

Definition at line 180 of file EST_TKVL.h.

## Entries

template<class K, class V>

typedef EST_TStructIterator< EST_TKVL<K, V>, IPointer, Entry> EST_TKVL< K, V >::Entries

Definition at line 181 of file EST_TKVL.h.

## RwEntries

template<class K, class V>

typedef EST_TRwStructIterator< EST_TKVL<K, V>, IPointer, Entry> EST_TKVL< K, V >::RwEntries

Definition at line 182 of file EST_TKVL.h.

## KeyEntry

template<class K, class V>

typedef K EST_TKVL< K, V >::KeyEntry

Definition at line 198 of file EST_TKVL.h.

## KeyEntries

template<class K, class V>

typedef EST_TIterator< EST_TKVL<K, V>, IPointer_k, KeyEntry> EST_TKVL< K, V >::KeyEntries

Definition at line 199 of file EST_TKVL.h.

## KeyRwEntries

template<class K, class V>

typedef EST_TRwIterator< EST_TKVL<K, V>, IPointer_k, KeyEntry> EST_TKVL< K, V >::KeyRwEntries

Definition at line 200 of file EST_TKVL.h.

## Constructor & Destructor Documentation

## EST_TKVL() [1/2]

template<class K, class V>

EST_TKVL< K, V >::EST_TKVL | ( |  | ) |

inline

default constructor

Definition at line 80 of file EST_TKVL.h.

## EST_TKVL() [2/2]

template<class K, class V>

EST_TKVL< K, V >::EST_TKVL | ( | const EST_TKVL< K, V > & | kv | ) |

copy constructor

Definition at line 44 of file EST_TKVL.cc.

## Member Function Documentation

## length()

template<class K, class V>

const int EST_TKVL< K, V >::length | ( |  | ) | const

inline

number of key value pairs in list

Definition at line 96 of file EST_TKVL.h.

## head()

template<class K, class V>

EST_Litem * EST_TKVL< K, V >::head | ( |  | ) | const

inline

Return First key value pair in list.

Definition at line 99 of file EST_TKVL.h.

## clear()

template<class K, class V>

void EST_TKVL< K, V >::clear | ( | void |  | ) |

Empty list.

Definition at line 50 of file EST_TKVL.cc.

## val() [1/4]

template<class K, class V>

const V & EST_TKVL< K, V >::val | ( | const K & | rkey,
|  | bool | m = 0 ) const

return value according to key (const)

Definition at line 145 of file EST_TKVL.cc.

## val() [2/4]

template<class K, class V>

V & EST_TKVL< K, V >::val | ( | const K & | rkey,
|  | bool | m = 0 )

return value according to key (non-const)

Definition at line 129 of file EST_TKVL.cc.

## val() [3/4]

template<class K, class V>

const V & EST_TKVL< K, V >::val | ( | EST_Litem * | ptr,
|  | bool | m = 0 ) const

return value according to ptr

Definition at line 181 of file EST_TKVL.cc.

## val() [4/4]

template<class K, class V>

V & EST_TKVL< K, V >::val | ( | EST_Litem * | ptr,
|  | bool | m = 0 )

return value according to ptr

Definition at line 164 of file EST_TKVL.cc.

## val_def()

template<class K, class V>

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.

## key() [1/3]

template<class K, class V>

const K & EST_TKVL< K, V >::key | ( | EST_Litem * | ptr,
|  | int | m = 1 ) const

find key, reference by ptr

Definition at line 201 of file EST_TKVL.cc.

## key() [2/3]

template<class K, class V>

K & EST_TKVL< K, V >::key | ( | EST_Litem * | ptr,
|  | int | m = 1 )

find key, reference by ptr

Definition at line 190 of file EST_TKVL.cc.

## key() [3/3]

template<class K, class V>

const K & EST_TKVL< K, V >::key | ( | const V & | v,
|  | int | m = 1 ) const

return first matching key, referenced by val

Definition at line 207 of file EST_TKVL.cc.

## change_val() [1/2]

template<class K, class V>

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_val() [2/2]

template<class K, class V>

int EST_TKVL< K, V >::change_val | ( | EST_Litem * | ptr,
|  | const V & | rval )

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_key()

template<class K, class V>

int EST_TKVL< K, V >::change_key | ( | EST_Litem * | ptr,
|  | const K & | rkey )

change name of key pair.

Definition at line 99 of file EST_TKVL.cc.

## add_item()

template<class K, class V>

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_item()

template<class K, class V>

int EST_TKVL< K, V >::remove_item | ( | const K & | rkey,
|  | int | quiet = 0 )

remove key and val pair from list

Definition at line 263 of file EST_TKVL.cc.

## present()

template<class K, class V>

const int EST_TKVL< K, V >::present | ( | const K & | rkey | ) | const

Returns true if key is present.

Definition at line 222 of file EST_TKVL.cc.

## map()

template<class K, class V>

void EST_TKVL< K, V >::map | ( | void(* | func )(K &, V &) | ) |

apply function to each pair

Definition at line 233 of file EST_TKVL.cc.

## operator=()

template<class K, class V>

EST_TKVL< K, V > & EST_TKVL< K, V >::operator= | ( | const EST_TKVL< K, V > & | kv | ) |

full copy of KV list.

Definition at line 283 of file EST_TKVL.cc.

## operator+=()

template<class K, class V>

EST_TKVL< K, V > & EST_TKVL< K, V >::operator+= | ( | const EST_TKVL< K, V > & | kv | ) |

add kv after existing list.

Definition at line 290 of file EST_TKVL.cc.

## operator+()

template<class K, class V>

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.

## point_to_first() [1/2]

template<class K, class V>

void EST_TKVL< K, V >::point_to_first | ( | IPointer & | ip | ) | const

inline protected

Definition at line 169 of file EST_TKVL.h.

## move_pointer_forwards() [1/2]

template<class K, class V>

void EST_TKVL< K, V >::move_pointer_forwards | ( | IPointer & | ip | ) | const

inline protected

Definition at line 170 of file EST_TKVL.h.

## points_to_something() [1/2]

template<class K, class V>

bool EST_TKVL< K, V >::points_to_something | ( | const IPointer & | ip | ) | const

inline protected

Definition at line 171 of file EST_TKVL.h.

## points_at() [1/2]

template<class K, class V>

EST_TKVI< K, V > & EST_TKVL< K, V >::points_at | ( | const IPointer & | ip | ) |

inline protected

Definition at line 172 of file EST_TKVL.h.

## point_to_first() [2/2]

template<class K, class V>

void EST_TKVL< K, V >::point_to_first | ( | IPointer_k & | ip | ) | const

inline protected

Definition at line 189 of file EST_TKVL.h.

## move_pointer_forwards() [2/2]

template<class K, class V>

void EST_TKVL< K, V >::move_pointer_forwards | ( | IPointer_k & | ip | ) | const

inline protected

Definition at line 190 of file EST_TKVL.h.

## points_to_something() [2/2]

template<class K, class V>

bool EST_TKVL< K, V >::points_to_something | ( | const IPointer_k & | ip | ) | const

inline protected

Definition at line 191 of file EST_TKVL.h.

## points_at() [2/2]

template<class K, class V>

K & EST_TKVL< K, V >::points_at | ( | const IPointer_k & | ip | ) |

inline protected

Definition at line 192 of file EST_TKVL.h.

## Friends And Related Symbol Documentation

## EST_TIterator< EST_TKVL< K, V >, IPointer, EST_TKVI< K, V > >

template<class K, class V>

friend class EST_TIterator< EST_TKVL< K, V >, IPointer, EST_TKVI< K, V > >

friend

Definition at line 172 of file EST_TKVL.h.

## EST_TStructIterator< EST_TKVL< K, V >, IPointer, EST_TKVI< K, V > >

template<class K, class V>

friend class EST_TStructIterator< EST_TKVL< K, V >, IPointer, EST_TKVI< K, V > >

friend

Definition at line 172 of file EST_TKVL.h.

## EST_TRwIterator< EST_TKVL< K, V >, IPointer, EST_TKVI< K, V > >

template<class K, class V>

friend class EST_TRwIterator< EST_TKVL< K, V >, IPointer, EST_TKVI< K, V > >

friend

Definition at line 172 of file EST_TKVL.h.

## EST_TRwStructIterator< EST_TKVL< K, V >, IPointer, EST_TKVI< K, V > >

template<class K, class V>

friend class EST_TRwStructIterator< EST_TKVL< K, V >, IPointer, EST_TKVI< K, V > >

friend

Definition at line 172 of file EST_TKVL.h.

## EST_TIterator< EST_TKVL< K, V >, IPointer_k, K >

template<class K, class V>

friend class EST_TIterator< EST_TKVL< K, V >, IPointer_k, K >

friend

Definition at line 192 of file EST_TKVL.h.

## EST_TRwIterator< EST_TKVL< K, V >, IPointer_k, K >

template<class K, class V>

friend class EST_TRwIterator< EST_TKVL< K, V >, IPointer_k, K >

friend

Definition at line 192 of file EST_TKVL.h.

## operator<<

template<class K, class V>

ostream & operator<< | ( | ostream & | s,
|  | EST_TKVL< K, V > const & | l )

friend

Definition at line 150 of file EST_TKVL.h.

## Member Data Documentation

## default_val

template<class K, class V>

V* EST_TKVL< K, V >::default_val

static

default value, returned when there is no such entry.

Definition at line 86 of file EST_TKVL.h.

## default_key

template<class K, class V>

K* EST_TKVL< K, V >::default_key

static

default value, returned when there is no such entry.

Definition at line 89 of file EST_TKVL.h.

## list

template<class K, class V>

EST_TList< EST_TKVI<K,V> > EST_TKVL< K, V >::list

Linked list of key-val pairs. Don't use this as it will be made private in the future.

Definition at line 93 of file EST_TKVL.h.

The documentation for this class was generated from the following files:

- include/EST_TKVL.h
- base_class/EST_TKVL.cc