<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML> <HEAD> <TITLE>template<class K, class V> class EST_TKVL</TITLE> <META NAME="GENERATOR" CONTENT="DOC++ 3.4.6"> </HEAD> <body bgcolor="#ffffff" link="#0000ff" vlink="#dd0000" text="#000088" alink="9000ff"> <A HREF = "http://www.cstr.ed.ac.uk/"> <IMG align=left BORDER=0 SRC = "cstr.gif"></A> <A HREF="http://www.cstr.ed.ac.uk/projects/speech_tools.html"> <IMG BORDER=0 ALIGN=right SRC="est.jpg" width=150 height=93></A> <br> <br clear=left> <p align=right> In file ../include/EST_TKVL.h:<TABLE BORDER=0><TR> <TD VALIGN=TOP><H2>template<class K, class V> class <A HREF="#DOC.DOCU">EST_TKVL</A></H2></TD></H2></TD></TR></TABLE> <BLOCKQUOTE>Templated Key-Value list.</BLOCKQUOTE> <HR> <H2>Inheritance:</H2> <APPLET CODE="ClassGraph.class" WIDTH=600 HEIGHT=65> <param name=classes value="CEST_TKVL,MEST_TKVL.html,CEST_Option,MEST_Option.html"> <param name=before value="M,M^_"> <param name=after value="M,M"> <param name=indent value="0,0"> <param name=arrowdir value="down"> </APPLET> <HR> <DL> <P><TABLE> <DT><H3>Public Fields</H3><DD><TR> <TD VALIGN=TOP><A HREF="#DOC.2.2"><IMG ALT="[more]" BORDER=0 SRC=icon1.gif></A>static V* </TD><TD><B>default_val</B> <BR> <I>default value, returned when there is no such entry</I> </TD></TR><TR> <TD VALIGN=TOP><A HREF="#DOC.2.3"><IMG ALT="[more]" BORDER=0 SRC=icon1.gif></A>static K* </TD><TD><B>default_key</B> <BR> <I>default value, returned when there is no such entry</I> </TD></TR></TABLE></P> <P><TABLE> <DT><H3>Public Methods</H3><DD><TR> <TD VALIGN=TOP><A HREF="#DOC.2.1"><IMG ALT="[more]" BORDER=0 SRC=icon1.gif></A> </TD><TD><B>Constructor functions </B> <BR> <I></I> <P><TABLE> <TR> <TD VALIGN=TOP><A HREF="#DOC.2.1.1"><IMG ALT="[more]" BORDER=0 SRC=icon1.gif></A> </TD><TD><B>EST_TKVL</B> ()<BR> <I>default constructor</I> </TD></TR><TR> <TD VALIGN=TOP><A HREF="#DOC.2.1.2"><IMG ALT="[more]" BORDER=0 SRC=icon1.gif></A> </TD><TD><B>EST_TKVL</B> (const <!1><A HREF="EST_TKVL.html#DOC.2.1.2">EST_TKVL</A><K, V> &kv)<BR> <I>copy constructor</I> </TD></TR></TABLE></P> </TD></TR><TR> <TD VALIGN=TOP><A HREF="#DOC.2.5"><IMG ALT="[more]" BORDER=0 SRC=icon1.gif></A>const int </TD><TD><B>length</B> () const <BR> <I>number of key value pairs in list</I> </TD></TR><TR> <TD VALIGN=TOP><A HREF="#DOC.2.6"><IMG ALT="[more]" BORDER=0 SRC=icon1.gif></A>EST_Litem* </TD><TD><B>head</B> () const <BR> <I>Return First key value pair in list</I> </TD></TR><TR> <TD VALIGN=TOP><A HREF="#DOC.2.7"><IMG ALT="[more]" BORDER=0 SRC=icon1.gif></A>void </TD><TD><B>clear</B> ()<BR> <I>Empty list</I> </TD></TR><TR> <TD VALIGN=TOP><A HREF="#DOC.2.8"><IMG ALT="[more]" BORDER=0 SRC=icon1.gif></A> </TD><TD><B>Access functions.</B> <BR> <I></I> <P><TABLE> <TR> <TD VALIGN=TOP><A HREF="#DOC.2.8.1"><IMG ALT="[more]" BORDER=0 SRC=icon1.gif></A>const V& </TD><TD><B>val</B> (const K &rkey, bool m=0) const <BR> <I>return value according to key (const)</I> </TD></TR><TR> <TD VALIGN=TOP><A HREF="#DOC.2.8.2"><IMG ALT="[more]" BORDER=0 SRC=icon1.gif></A>V& </TD><TD><B>val</B> (const K &rkey, bool m=0)<BR> <I>return value according to key (non-const)</I> </TD></TR><TR> <TD VALIGN=TOP><A HREF="#DOC.2.8.3"><IMG ALT="[more]" BORDER=0 SRC=icon1.gif></A>const V& </TD><TD><B>val</B> (EST_Litem* ptr, bool m=0) const <BR> <I>return value according to ptr</I> </TD></TR><TR> <TD VALIGN=TOP><A HREF="#DOC.2.8.4"><IMG ALT="[more]" BORDER=0 SRC=icon1.gif></A>V& </TD><TD><B>val</B> (EST_Litem* ptr, bool m=0)<BR> <I>return value according to ptr</I> </TD></TR><TR> <TD VALIGN=TOP><A HREF="#DOC.2.8.5"><IMG ALT="[more]" BORDER=0 SRC=icon1.gif></A>const V& </TD><TD><B>val_def</B> (const K &rkey, const V &def) const <BR> <I>value or default </I> </TD></TR><TR> <TD VALIGN=TOP><A HREF="#DOC.2.8.6"><IMG ALT="[more]" BORDER=0 SRC=icon1.gif></A>const K& </TD><TD><B>key</B> (EST_Litem* ptr, int m=1) const <BR> <I>find key, reference by ptr </I> </TD></TR><TR> <TD VALIGN=TOP><A HREF="#DOC.2.8.7"><IMG ALT="[more]" BORDER=0 SRC=icon1.gif></A>K& </TD><TD><B>key</B> (EST_Litem* ptr, int m=1)<BR> <I>find key, reference by ptr </I> </TD></TR><TR> <TD VALIGN=TOP><A HREF="#DOC.2.8.8"><IMG ALT="[more]" BORDER=0 SRC=icon1.gif></A>const K& </TD><TD><B>key</B> (const V &<!1><A HREF="EST_Hash_Pair.html#DOC.91.2.2">v</A>, int m=1) const <BR> <I>return first matching key, referenced by val</I> </TD></TR><TR> <TD VALIGN=TOP><A HREF="#DOC.2.8.9"><IMG ALT="[more]" BORDER=0 SRC=icon1.gif></A>int </TD><TD><B>change_val</B> (const K &rkey, const V &rval)<BR> <I>change key-val pair.</I> </TD></TR><TR> <TD VALIGN=TOP><A HREF="#DOC.2.8.10"><IMG ALT="[more]" BORDER=0 SRC=icon1.gif></A>int </TD><TD><B>change_val</B> (EST_Litem* ptr, const V &rval)<BR> <I>change key-val pair.</I> </TD></TR><TR> <TD VALIGN=TOP><A HREF="#DOC.2.8.11"><IMG ALT="[more]" BORDER=0 SRC=icon1.gif></A>int </TD><TD><B>change_key</B> (EST_Litem* ptr, const K &rkey)<BR> <I>change name of key pair</I> </TD></TR><TR> <TD VALIGN=TOP><A HREF="#DOC.2.8.12"><IMG ALT="[more]" BORDER=0 SRC=icon1.gif></A>int </TD><TD><B>add_item</B> (const K &rkey, const V &rval, int no_search = 0)<BR> <I>add key-val pair to list</I> </TD></TR><TR> <TD VALIGN=TOP><A HREF="#DOC.2.8.13"><IMG ALT="[more]" BORDER=0 SRC=icon1.gif></A>int </TD><TD><B>remove_item</B> (const K &rkey, int quiet = 0)<BR> <I>remove key and val pair from list</I> </TD></TR></TABLE></P> </TD></TR><TR> <TD VALIGN=TOP><A HREF="#DOC.2.9"><IMG ALT="[more]" BORDER=0 SRC=icon1.gif></A>const int </TD><TD><B>present</B> (const K &rkey) const <BR> <I>Returns true if key is present</I> </TD></TR><TR> <TD VALIGN=TOP><A HREF="#DOC.2.10"><IMG ALT="[more]" BORDER=0 SRC=icon1.gif></A>void </TD><TD><B>map</B> (void (*func)(K&, V&))<BR> <I>apply function to each pair</I> </TD></TR><TR> <TD VALIGN=TOP><A HREF="#DOC.2.11"><IMG ALT="[more]" BORDER=0 SRC=icon1.gif></A><!1><A HREF="EST_TKVL.html">EST_TKVL</A><K, V> & </TD><TD><B>operator = </B> (const <!1><A HREF="EST_TKVL.html">EST_TKVL</A><K, V> &kv)<BR> <I>full copy of KV list</I> </TD></TR><TR> <TD VALIGN=TOP><A HREF="#DOC.2.12"><IMG ALT="[more]" BORDER=0 SRC=icon1.gif></A><!1><A HREF="EST_TKVL.html">EST_TKVL</A><K, V> & </TD><TD><B>operator += </B> (const <!1><A HREF="EST_TKVL.html">EST_TKVL</A><K, V> &kv)<BR> <I>add kv after existing list</I> </TD></TR><TR> <TD VALIGN=TOP><A HREF="#DOC.2.13"><IMG ALT="[more]" BORDER=0 SRC=icon1.gif></A><!1><A HREF="EST_TKVL.html">EST_TKVL</A><K, V> </TD><TD><B>operator + </B> (const <!1><A HREF="EST_TKVL.html">EST_TKVL</A><K, V> &kv)<BR> <I>make new concatenated list</I> </TD></TR></TABLE></P> <P><TABLE> <DT><H3>Public</H3><DD><TR> <TD VALIGN=TOP><A HREF="#DOC.2.4"><IMG ALT="[more]" BORDER=0 SRC=icon1.gif></A> </TD><TD><B>Linked list of key-val pairs.</B> <BR> <I></I> </TD></TR></TABLE></P> </DL> <A NAME="DOC.DOCU"></A> <HR> <H2>Documentation</H2> <BLOCKQUOTE>Templated Key-Value list. Objects of type EST_TKVL contain lists which are accessed by a key of type <B>K</B>, which returns a value of type <B>V</B>. </BLOCKQUOTE> <DL> <A NAME="Constructor functions "></A> <A NAME="DOC.2.1"></A> <DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B> Constructor functions </B></TT> <DL><DT><DD></DL><P><DL> <A NAME="EST_TKVL"></A> <A NAME="DOC.2.1.1"></A> <DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B> EST_TKVL()</B></TT> <DD>default constructor <DL><DT><DD></DL><P> <A NAME="EST_TKVL"></A> <A NAME="DOC.2.1.2"></A> <DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B> EST_TKVL(const <!1><A HREF="EST_TKVL.html#DOC.2.1.2">EST_TKVL</A><K, V> &kv)</B></TT> <DD>copy constructor <DL><DT><DD></DL><P></DL> <A NAME="default_val"></A> <A NAME="DOC.2.2"></A> <DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>static V* default_val</B></TT> <DD>default value, returned when there is no such entry <DL><DT><DD></DL><P> <A NAME="default_key"></A> <A NAME="DOC.2.3"></A> <DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>static K* default_key</B></TT> <DD>default value, returned when there is no such entry <DL><DT><DD></DL><P> <A NAME="Linked list of key-val pairs."></A> <A NAME="DOC.2.4"></A> <DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B> Linked list of key-val pairs.</B></TT> <DD>Linked list of key-val pairs. Don't use <DL><DT><DD></DL><P> <A NAME="length"></A> <A NAME="DOC.2.5"></A> <DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>const int length() const </B></TT> <DD>number of key value pairs in list <DL><DT><DD></DL><P> <A NAME="head"></A> <A NAME="DOC.2.6"></A> <DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>EST_Litem* head() const </B></TT> <DD>Return First key value pair in list <DL><DT><DD></DL><P> <A NAME="clear"></A> <A NAME="DOC.2.7"></A> <DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>void clear()</B></TT> <DD>Empty list <DL><DT><DD></DL><P> <A NAME="Access functions."></A> <A NAME="DOC.2.8"></A> <DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B> Access functions.</B></TT> <DL><DT><DD></DL><P><DL> <A NAME="val"></A> <A NAME="DOC.2.8.1"></A> <DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>const V& val(const K &rkey, bool m=0) const </B></TT> <DD>return value according to key (const) <DL><DT><DD></DL><P> <A NAME="val"></A> <A NAME="DOC.2.8.2"></A> <DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>V& val(const K &rkey, bool m=0)</B></TT> <DD>return value according to key (non-const) <DL><DT><DD></DL><P> <A NAME="val"></A> <A NAME="DOC.2.8.3"></A> <DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>const V& val(EST_Litem* ptr, bool m=0) const </B></TT> <DD>return value according to ptr <DL><DT><DD></DL><P> <A NAME="val"></A> <A NAME="DOC.2.8.4"></A> <DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>V& val(EST_Litem* ptr, bool m=0)</B></TT> <DD>return value according to ptr <DL><DT><DD></DL><P> <A NAME="val_def"></A> <A NAME="DOC.2.8.5"></A> <DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>const V& val_def(const K &rkey, const V &def) const </B></TT> <DD>value or default <DL><DT><DD></DL><P> <A NAME="key"></A> <A NAME="DOC.2.8.6"></A> <DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>const K& key(EST_Litem* ptr, int m=1) const </B></TT> <DD>find key, reference by ptr <DL><DT><DD></DL><P> <A NAME="key"></A> <A NAME="DOC.2.8.7"></A> <DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>K& key(EST_Litem* ptr, int m=1)</B></TT> <DD>find key, reference by ptr <DL><DT><DD></DL><P> <A NAME="key"></A> <A NAME="DOC.2.8.8"></A> <DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>const K& key(const V &<!1><A HREF="EST_Hash_Pair.html#DOC.91.2.2">v</A>, int m=1) const </B></TT> <DD>return first matching key, referenced by val <DL><DT><DD></DL><P> <A NAME="change_val"></A> <A NAME="DOC.2.8.9"></A> <DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>int change_val(const K &rkey, const V &rval)</B></TT> <DD>change key-val pair. If no corresponding entry is present, add to end of list. <DL><DT><DD></DL><P> <A NAME="change_val"></A> <A NAME="DOC.2.8.10"></A> <DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>int change_val(EST_Litem* ptr, const V &rval)</B></TT> <DD>change key-val pair. If no corresponding entry is present, add to end of list. <DL><DT><DD></DL><P> <A NAME="change_key"></A> <A NAME="DOC.2.8.11"></A> <DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>int change_key(EST_Litem* ptr, const K &rkey)</B></TT> <DD>change name of key pair <DL><DT><DD></DL><P> <A NAME="add_item"></A> <A NAME="DOC.2.8.12"></A> <DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>int add_item(const K &rkey, const V &rval, int no_search = 0)</B></TT> <DD>add key-val pair to list <DL><DT><DD></DL><P> <A NAME="remove_item"></A> <A NAME="DOC.2.8.13"></A> <DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>int remove_item(const K &rkey, int quiet = 0)</B></TT> <DD>remove key and val pair from list <DL><DT><DD></DL><P></DL> <A NAME="present"></A> <A NAME="DOC.2.9"></A> <DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>const int present(const K &rkey) const </B></TT> <DD>Returns true if key is present <DL><DT><DD></DL><P> <A NAME="map"></A> <A NAME="DOC.2.10"></A> <DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>void map(void (*func)(K&, V&))</B></TT> <DD>apply function to each pair <DL><DT><DD></DL><P> <A NAME="operator = "></A> <A NAME="DOC.2.11"></A> <DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B><!1><A HREF="EST_TKVL.html">EST_TKVL</A><K, V> & operator = (const <!1><A HREF="EST_TKVL.html">EST_TKVL</A><K, V> &kv)</B></TT> <DD>full copy of KV list <DL><DT><DD></DL><P> <A NAME="operator += "></A> <A NAME="DOC.2.12"></A> <DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B><!1><A HREF="EST_TKVL.html">EST_TKVL</A><K, V> & operator += (const <!1><A HREF="EST_TKVL.html">EST_TKVL</A><K, V> &kv)</B></TT> <DD>add kv after existing list <DL><DT><DD></DL><P> <A NAME="operator + "></A> <A NAME="DOC.2.13"></A> <DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B><!1><A HREF="EST_TKVL.html">EST_TKVL</A><K, V> operator + (const <!1><A HREF="EST_TKVL.html">EST_TKVL</A><K, V> &kv)</B></TT> <DD>make new concatenated list <DL><DT><DD></DL><P></DL> <HR> <DL><DT><B>Direct child classes: </B><DD><A HREF="EST_Option.html">EST_Option</A><BR> </DL> <DL><DT><DT><B>Friends:</B><DD> ostream& operator << (ostream& s, <!1><A HREF="EST_TKVL.html">EST_TKVL</A><K,V> const &kv)<BR> class <!1><A HREF="EST_TIterator.html">EST_TIterator</A>< <!1><A HREF="EST_TKVL.html">EST_TKVL</A><K, V>, IPointer, <!1><A HREF="EST_TKVI.html">EST_TKVI</A><K, V> ><BR> class EST_TStructIterator< <!1><A HREF="EST_TKVL.html">EST_TKVL</A><K, V>, IPointer, <!1><A HREF="EST_TKVI.html">EST_TKVI</A><K, V> ><BR> class EST_TRwIterator< <!1><A HREF="EST_TKVL.html">EST_TKVL</A><K, V>, IPointer, <!1><A HREF="EST_TKVI.html">EST_TKVI</A><K, V> ><BR> class EST_TRwStructIterator< <!1><A HREF="EST_TKVL.html">EST_TKVL</A><K, V>, IPointer, <!1><A HREF="EST_TKVI.html">EST_TKVI</A><K, V> ><BR> class <!1><A HREF="EST_TIterator.html">EST_TIterator</A>< <!1><A HREF="EST_TKVL.html">EST_TKVL</A><K, V>, IPointer_k, K ><BR> class EST_TRwIterator< <!1><A HREF="EST_TKVL.html">EST_TKVL</A><K, V>, IPointer_k, K ><BR><DD></DL><P><P><I><A HREF="index.html">Alphabetic index</A></I> <I><A HREF="HIER.html">HTML hierarchy of classes</A> or <A HREF="HIERjava.html">Java</A></I></P><HR> <A HREF = "http://www.ed.ac.uk/"> <IMG align=right BORDER=0 SRC = "edcrest.gif"></A> <P Align=left><I>This page is part of the <A HREF="http://www.cstr.ed.ac.uk/projects/speech_tools.html"> Edinburgh Speech Tools Library</A> documentation <br> Copyright <A HREF="http://www.ed.ac.uk"> University of Edinburgh</A> 1997 <br> Contact: <A HREF="mailto:speech_toolss@cstr.ed.ac.uk"> speech_tools@cstr.ed.ac.uk </a> </P> <br clear=right>