3 <!-- This HTML file has been created by texi2html 1.54
4 from suif1.texi on 28 April 1999 -->
6 <TITLE>The SUIF Version
1 Library - Move-to-front Lists
</TITLE>
7 <link href=
"suif1_94.html" rel=Next
>
8 <link href=
"suif1_92.html" rel=Previous
>
9 <link href=
"suif1_toc.html" rel=ToC
>
13 <p>Go to the
<A HREF=
"suif1_1.html">first
</A>,
<A HREF=
"suif1_92.html">previous
</A>,
<A HREF=
"suif1_94.html">next
</A>,
<A HREF=
"suif1_113.html">last
</A> section,
<A HREF=
"suif1_toc.html">table of contents
</A>.
17 <H2><A NAME=
"SEC93" HREF=
"suif1_toc.html#TOC93">Move-to-front Lists
</A></H2>
26 The move-to-front list class
<CODE>mtflist
</CODE> is just a minor variation of
27 the
<CODE>glist
</CODE> class. See section
<A HREF=
"suif1_92.html#SEC92">Generic Lists
</A>. The user must provide a
28 function that compares a list element with some other unspecified
29 object. The
<CODE>mtflist
</CODE> class then provides a
<CODE>lookup
</CODE> method
30 that uses the comparison function to search for a particular element.
31 After every successful lookup, the returned element is moved to the
32 front of the list. This works well for applications with good locality.
33 The
<CODE>DECLARE_MTFLIST_CLASS
</CODE> macro works just like the
34 <CODE>DECLARE_LIST_CLASS
</CODE> macro, but it generates move-to-front list
35 classes. The code for the
<CODE>mtflist
</CODE> class is in the files
36 <TT>`mtflist.h'
</TT> and
<TT>`mtflist.cc'
</TT>.
41 <p>Go to the
<A HREF=
"suif1_1.html">first
</A>,
<A HREF=
"suif1_92.html">previous
</A>,
<A HREF=
"suif1_94.html">next
</A>,
<A HREF=
"suif1_113.html">last
</A> section,
<A HREF=
"suif1_toc.html">table of contents
</A>.