Sophie

Sophie

distrib > Fedora > 18 > x86_64 > by-pkgid > ff187cb994c94c614ecc64c5a8528b1b > files > 4440

qt-doc-4.8.5-10.fc18.noarch.rpm

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en_US" lang="en_US">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- q3asciicache.qdoc -->
  <title>Qt 4.8: Q3AsciiCache Class Reference</title>
  <link rel="stylesheet" type="text/css" href="style/style.css" />
  <script src="scripts/jquery.js" type="text/javascript"></script>
  <script src="scripts/functions.js" type="text/javascript"></script>
  <link rel="stylesheet" type="text/css" href="style/superfish.css" />
  <link rel="stylesheet" type="text/css" href="style/narrow.css" />
  <!--[if IE]>
<meta name="MSSmartTagsPreventParsing" content="true">
<meta http-equiv="imagetoolbar" content="no">
<![endif]-->
<!--[if lt IE 7]>
<link rel="stylesheet" type="text/css" href="style/style_ie6.css">
<![endif]-->
<!--[if IE 7]>
<link rel="stylesheet" type="text/css" href="style/style_ie7.css">
<![endif]-->
<!--[if IE 8]>
<link rel="stylesheet" type="text/css" href="style/style_ie8.css">
<![endif]-->

<script src="scripts/superfish.js" type="text/javascript"></script>
<script src="scripts/narrow.js" type="text/javascript"></script>

</head>
<body class="" onload="CheckEmptyAndLoadList();">
 <div class="header" id="qtdocheader">
    <div class="content"> 
    <div id="nav-logo">
      <a href="index.html">Home</a></div>
    <a href="index.html" class="qtref"><span>Qt Reference Documentation</span></a>
    <div id="narrowsearch"></div>
    <div id="nav-topright">
      <ul>
        <li class="nav-topright-home"><a href="http://qt.digia.com/">Qt HOME</a></li>
        <li class="nav-topright-dev"><a href="http://qt-project.org/">DEV</a></li>
        <li class="nav-topright-doc nav-topright-doc-active"><a href="http://qt-project.org/doc/">
          DOC</a></li>
        <li class="nav-topright-blog"><a href="http://blog.qt.digia.com/">BLOG</a></li>
      </ul>
    </div>
    <div id="shortCut">
      <ul>
        <li class="shortCut-topleft-inactive"><span><a href="index.html">Qt 4.8</a></span></li>
        <li class="shortCut-topleft-active"><a href="http://qt-project.org/doc/">ALL VERSIONS        </a></li>
      </ul>
     </div>
 <ul class="sf-menu" id="narrowmenu"> 
             <li><a href="#">API Lookup</a> 
                 <ul> 
                     <li><a href="classes.html">Class index</a></li> 
           <li><a href="functions.html">Function index</a></li> 
           <li><a href="modules.html">Modules</a></li> 
           <li><a href="namespaces.html">Namespaces</a></li> 
           <li><a href="qtglobal.html">Global Declarations</a></li> 
           <li><a href="qdeclarativeelements.html">QML elements</a></li> 
             </ul> 
             </li> 
             <li><a href="#">Qt Topics</a> 
                 <ul> 
                        <li><a href="qt-basic-concepts.html">Programming with Qt</a></li>  
                        <li><a href="qtquick.html">Device UIs &amp; Qt Quick</a></li>  
                        <li><a href="qt-gui-concepts.html">UI Design with Qt</a></li>  
                        <li><a href="supported-platforms.html">Supported Platforms</a></li>  
                        <li><a href="technology-apis.html">Qt and Key Technologies</a></li>  
                        <li><a href="best-practices.html">How-To's and Best Practices</a></li>  
              </ul> 
                 </li> 
                 <li><a href="#">Examples</a> 
                     <ul> 
                       <li><a href="all-examples.html">Examples</a></li> 
                       <li><a href="tutorials.html">Tutorials</a></li> 
                       <li><a href="demos.html">Demos</a></li> 
                       <li><a href="qdeclarativeexamples.html">QML Examples</a></li> 
                </ul> 
                     </li> 
                 </ul> 
    </div>
  </div>
  <div class="wrapper">
    <div class="hd">
      <span></span>
    </div>
    <div class="bd group">
      <div class="sidebar">
        <div class="searchlabel">
          Search index:</div>
        <div class="search" id="sidebarsearch">
          <form id="qtdocsearch" action="" onsubmit="return false;">
            <fieldset>
              <input type="text" name="searchstring" id="pageType" value="" />
 <div id="resultdialog"> 
 <a href="#" id="resultclose">Close</a> 
 <p id="resultlinks" class="all"><a href="#" id="showallresults">All</a> | <a href="#" id="showapiresults">API</a> | <a href="#" id="showarticleresults">Articles</a> | <a href="#" id="showexampleresults">Examples</a></p> 
 <p id="searchcount" class="all"><span id="resultcount"></span><span id="apicount"></span><span id="articlecount"></span><span id="examplecount"></span>&nbsp;results:</p> 
 <ul id="resultlist" class="all"> 
 </ul> 
 </div> 
            </fieldset>
          </form>
        </div>
        <div class="box first bottombar" id="lookup">
          <h2 title="API Lookup"><span></span>
            API Lookup</h2>
          <div  id="list001" class="list">
          <ul id="ul001" >
              <li class="defaultLink"><a href="classes.html">Class index</a></li>
              <li class="defaultLink"><a href="functions.html">Function index</a></li>
              <li class="defaultLink"><a href="modules.html">Modules</a></li>
              <li class="defaultLink"><a href="namespaces.html">Namespaces</a></li>
              <li class="defaultLink"><a href="qtglobal.html">Global Declarations</a></li>
              <li class="defaultLink"><a href="qdeclarativeelements.html">QML elements</a></li>
            </ul> 
          </div>
        </div>
        <div class="box bottombar" id="topics">
          <h2 title="Qt Topics"><span></span>
            Qt Topics</h2>
          <div id="list002" class="list">
            <ul id="ul002" >
               <li class="defaultLink"><a href="qt-basic-concepts.html">Programming with Qt</a></li> 
               <li class="defaultLink"><a href="qtquick.html">Device UIs &amp; Qt Quick</a></li> 
               <li class="defaultLink"><a href="qt-gui-concepts.html">UI Design with Qt</a></li> 
               <li class="defaultLink"><a href="supported-platforms.html">Supported Platforms</a></li>  
               <li class="defaultLink"><a href="technology-apis.html">Qt and Key Technologies</a></li> 
               <li class="defaultLink"><a href="best-practices.html">How-To's and Best Practices</a></li> 
            </ul>  
          </div>
        </div>
        <div class="box" id="examples">
          <h2 title="Examples"><span></span>
            Examples</h2>
          <div id="list003" class="list">
        <ul id="ul003">
              <li class="defaultLink"><a href="all-examples.html">Examples</a></li>
              <li class="defaultLink"><a href="tutorials.html">Tutorials</a></li>
              <li class="defaultLink"><a href="demos.html">Demos</a></li>
              <li class="defaultLink"><a href="qdeclarativeexamples.html">QML Examples</a></li>
            </ul> 
          </div>
        </div>
      </div>
      <div class="wrap">
        <div class="toolbar">
          <div class="breadcrumb toolblock">
            <ul>
              <li class="first"><a href="index.html">Home</a></li>
              <!--  Breadcrumbs go here -->
<li><a href="modules.html">Modules</a></li>
<li>Qt3SupportLight</li>
<li>Q3AsciiCache</li>
            </ul>
          </div>
          <div class="toolbuttons toolblock">
            <ul>
              <li id="smallA" class="t_button">A</li>
              <li id="medA" class="t_button active">A</li>
              <li id="bigA" class="t_button">A</li>
              <li id="print" class="t_button"><a href="javascript:this.print();">
                <span>Print</span></a></li>
            </ul>
        </div>
        </div>
        <div class="content mainContent">
<div class="toc">
<h3><a name="toc">Contents</a></h3>
<ul>
<li class="level1"><a href="#public-functions">Public Functions</a></li>
<li class="level1"><a href="#details">Detailed Description</a></li>
</ul>
</div>
<h1 class="title">Q3AsciiCache Class Reference</h1>
<!-- $$$Q3AsciiCache-brief -->
<p>The Q3AsciiCache class is a template class that provides a cache based on char* keys. <a href="#details">More...</a></p>
<!-- @@@Q3AsciiCache -->
<pre class="cpp"> <span class="preprocessor">#include &lt;Q3AsciiCache&gt;</span></pre><p><b>This class is part of the Qt 3 support library.</b> It is provided to keep old source code working. We strongly advise against using it in new code. See <a href="porting4.html">Porting to Qt 4</a> for more information.</p>
<p><b>Inherits: </b><a href="q3ptrcollection.html">Q3PtrCollection</a>.</p>
<ul>
<li><a href="q3asciicache-members.html">List of all members, including inherited members</a></li>
</ul>
<a name="public-functions"></a>
<h2>Public Functions</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="q3asciicache.html#Q3AsciiCache">Q3AsciiCache</a></b> ( int <i>maxCost</i> = 100, int <i>size</i> = 17, bool <i>caseSensitive</i> = true, bool <i>copyKeys</i> = true )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="q3asciicache.html#dtor.Q3AsciiCache">~Q3AsciiCache</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> type * </td><td class="memItemRight bottomAlign"><b><a href="q3asciicache.html#find">find</a></b> ( const char * <i>k</i>, bool <i>ref</i> = true ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="q3asciicache.html#insert">insert</a></b> ( const char * <i>k</i>, const type * <i>d</i>, int <i>c</i> = 1, int <i>p</i> = 0 )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="q3asciicache.html#isEmpty">isEmpty</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="q3asciicache.html#maxCost">maxCost</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="q3asciicache.html#remove">remove</a></b> ( const char * <i>k</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="q3asciicache.html#setMaxCost">setMaxCost</a></b> ( int <i>m</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> uint </td><td class="memItemRight bottomAlign"><b><a href="q3asciicache.html#size">size</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="q3asciicache.html#statistics">statistics</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> type * </td><td class="memItemRight bottomAlign"><b><a href="q3asciicache.html#take">take</a></b> ( const char * <i>k</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="q3asciicache.html#totalCost">totalCost</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> type * </td><td class="memItemRight bottomAlign"><b><a href="q3asciicache.html#operator-5b-5d">operator[]</a></b> ( const char * <i>k</i> ) const</td></tr>
</table>
<a name="reimplemented-public-functions"></a>
<h2>Reimplemented Public Functions</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="q3asciicache.html#clear">clear</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual uint </td><td class="memItemRight bottomAlign"><b><a href="q3asciicache.html#count">count</a></b> () const</td></tr>
</table>
<ul>
<li class="fn">4 public functions inherited from <a href="q3ptrcollection.html#public-functions">Q3PtrCollection</a></li>
</ul>
<h3>Additional Inherited Members</h3>
<ul>
<li class="fn">2 protected functions inherited from <a href="q3ptrcollection.html#protected-functions">Q3PtrCollection</a></li>
</ul>
<a name="details"></a>
<!-- $$$Q3AsciiCache-description -->
<div class="descr">
<h2>Detailed Description</h2>
<p>The Q3AsciiCache class is a template class that provides a cache based on char* keys.</p>
<p>Q3AsciiCache is implemented as a template class. Define a template instance Q3AsciiCache&lt;X&gt; to create a cache that operates on pointers to X (X*).</p>
<p>A cache is a least recently used (LRU) list of cache items. The cache items are accessed via <tt>char*</tt> keys. For Unicode keys use the <a href="q3cache.html">Q3Cache</a> template instead, which uses <a href="qstring.html">QString</a> keys. A <a href="q3cache.html">Q3Cache</a> has the same performace as a Q3AsciiCache.</p>
<p>Each cache item has a cost. The sum of item costs, <a href="q3asciicache.html#totalCost">totalCost</a>(), will not exceed the maximum cache cost, <a href="q3asciicache.html#maxCost">maxCost</a>(). If inserting a new item would cause the total cost to exceed the maximum cost, the least recently used items in the cache are removed.</p>
<p>Apart from <a href="q3asciicache.html#insert">insert</a>(), by far the most important function is <a href="q3asciicache.html#find">find</a>() (which also exists as operator[]()). This function looks up an item, returns it, and by default marks it as being the most recently used item.</p>
<p>There are also methods to <a href="q3asciicache.html#remove">remove</a>() or <a href="q3asciicache.html#take">take</a>() an object from the cache. Calling <a href="q3ptrcollection.html#setAutoDelete">setAutoDelete(TRUE)</a> tells the cache to delete items that are removed. The default is to not delete items when then are removed (i.e&#x2e;, <a href="q3asciicache.html#remove">remove</a>() and <a href="q3asciicache.html#take">take</a>() are equivalent).</p>
<p>When inserting an item into the cache, only the pointer is copied, not the item itself. This is called a shallow copy. It is possible to make the cache copy all of the item's data (known as a deep copy) when an item is inserted. <a href="q3asciicache.html#insert">insert</a>() calls the virtual function <a href="q3ptrcollection.html#newItem">Q3PtrCollection::newItem</a>() for the item to be inserted. Inherit a cache and reimplement <a href="q3ptrcollection.html#newItem">newItem</a>() if you want deep copies.</p>
<p>When removing a cache item the virtual function <a href="q3ptrcollection.html#deleteItem">Q3PtrCollection::deleteItem</a>() is called. Its default implementation in Q3AsciiCache is to delete the item if <a href="q3ptrcollection.html#setAutoDelete">auto-deletion</a> is enabled.</p>
<p>There is a <a href="q3asciicacheiterator.html">Q3AsciiCacheIterator</a> which may be used to traverse the items in the cache in arbitrary order.</p>
</div>
<p><b>See also </b><a href="q3asciicacheiterator.html">Q3AsciiCacheIterator</a>, <a href="q3cache.html">Q3Cache</a>, and <a href="q3intcache.html">Q3IntCache</a>.</p>
<!-- @@@Q3AsciiCache -->
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$Q3AsciiCache[overload1]$$$Q3AsciiCacheintintboolbool -->
<h3 class="fn"><a name="Q3AsciiCache"></a>Q3AsciiCache::<span class="name">Q3AsciiCache</span> ( <span class="type">int</span> <i>maxCost</i> = 100, <span class="type">int</span> <i>size</i> = 17, <span class="type">bool</span> <i>caseSensitive</i> = true, <span class="type">bool</span> <i>copyKeys</i> = true )</h3>
<p>Constructs a cache whose contents will never have a total cost greater than <i>maxCost</i> and which is expected to contain less than <i>size</i> items.</p>
<p><i>size</i> is actually the size of an internal hash array; it's usually best to make it prime and at least 50% bigger than the largest expected number of items in the cache.</p>
<p>Each inserted item has an associated cost. When inserting a new item, if the total cost of all items in the cache will exceed <i>maxCost</i>, the cache will start throwing out the older (least recently used) items until there is enough room for the new item to be inserted.</p>
<p>If <i>caseSensitive</i> is TRUE (the default), the cache keys are case sensitive; if it is FALSE, they are case-insensitive. Case-insensitive comparison only affects the 26 letters in US-ASCII. If <i>copyKeys</i> is TRUE (the default), <a href="q3asciicache.html" class="compat">Q3AsciiCache</a> makes a copy of the cache keys, otherwise it copies just the const char * pointer - slightly faster if you can guarantee that the keys will never change, but very risky.</p>
<!-- @@@Q3AsciiCache -->
<!-- $$$~Q3AsciiCache[overload1]$$$~Q3AsciiCache -->
<h3 class="fn"><a name="dtor.Q3AsciiCache"></a>Q3AsciiCache::<span class="name">~Q3AsciiCache</span> ()</h3>
<p>Removes all items from the cache and destroys it. All iterators that access this cache will be reset.</p>
<!-- @@@~Q3AsciiCache -->
<!-- $$$clear[overload1]$$$clear -->
<h3 class="fn"><a name="clear"></a><span class="type">void</span> Q3AsciiCache::<span class="name">clear</span> ()<tt> [virtual]</tt></h3>
<p>Reimplemented from <a href="q3ptrcollection.html#clear">Q3PtrCollection::clear</a>().</p>
<p>Removes all items from the cache, and deletes them if <a href="q3ptrcollection.html#setAutoDelete">auto-deletion</a> has been enabled.</p>
<p>All cache iterators that operate on this cache are reset.</p>
<p><b>See also </b><a href="q3asciicache.html#remove">remove</a>() and <a href="q3asciicache.html#take">take</a>().</p>
<!-- @@@clear -->
<!-- $$$count[overload1]$$$count -->
<h3 class="fn"><a name="count"></a><span class="type"><a href="qtglobal.html#uint-typedef">uint</a></span> Q3AsciiCache::<span class="name">count</span> () const<tt> [virtual]</tt></h3>
<p>Reimplemented from <a href="q3ptrcollection.html#count">Q3PtrCollection::count</a>().</p>
<p>Returns the number of items in the cache.</p>
<p><b>See also </b><a href="q3asciicache.html#totalCost">totalCost</a>() and <a href="q3asciicache.html#size">size</a>().</p>
<!-- @@@count -->
<!-- $$$find[overload1]$$$findconstchar*bool -->
<h3 class="fn"><a name="find"></a><span class="type">type</span> * Q3AsciiCache::<span class="name">find</span> ( const <span class="type">char</span> * <i>k</i>, <span class="type">bool</span> <i>ref</i> = true ) const</h3>
<p>Returns the item with key <i>k</i>, or 0 if the key does not exist in the cache. If <i>ref</i> is TRUE (the default), the item is moved to the front of the least recently used list.</p>
<p>If there are two or more items with equal keys, the one that was inserted last is returned.</p>
<!-- @@@find -->
<!-- $$$insert[overload1]$$$insertconstchar*consttype*intint -->
<h3 class="fn"><a name="insert"></a><span class="type">bool</span> Q3AsciiCache::<span class="name">insert</span> ( const <span class="type">char</span> * <i>k</i>, const <span class="type">type</span> * <i>d</i>, <span class="type">int</span> <i>c</i> = 1, <span class="type">int</span> <i>p</i> = 0 )</h3>
<p>Inserts the item <i>d</i> into the cache using key <i>k</i>, and with an associated cost of <i>c</i>. Returns TRUE if the item is successfully inserted. Returns FALSE if the item is not inserted, for example, if the cost of the item exceeds <a href="q3asciicache.html#maxCost">maxCost</a>().</p>
<p>The cache's size is limited, and if the total cost is too high, <a href="q3asciicache.html" class="compat">Q3AsciiCache</a> will remove old, least recently used items until there is room for this new item.</p>
<p>Items with duplicate keys can be inserted.</p>
<p>The parameter <i>p</i> is internal and should be left at the default value (0).</p>
<p><b>Warning:</b> If this function returns FALSE, you must delete <i>d</i> yourself. Additionally, be very careful about using <i>d</i> after calling this function, because any other insertions into the cache, from anywhere in the application or within Qt itself, could cause the object to be discarded from the cache and the pointer to become invalid.</p>
<!-- @@@insert -->
<!-- $$$isEmpty[overload1]$$$isEmpty -->
<h3 class="fn"><a name="isEmpty"></a><span class="type">bool</span> Q3AsciiCache::<span class="name">isEmpty</span> () const</h3>
<p>Returns TRUE if the cache is empty; otherwise returns FALSE.</p>
<!-- @@@isEmpty -->
<!-- $$$maxCost[overload1]$$$maxCost -->
<h3 class="fn"><a name="maxCost"></a><span class="type">int</span> Q3AsciiCache::<span class="name">maxCost</span> () const</h3>
<p>Returns the maximum allowed total cost of the cache.</p>
<p><b>See also </b><a href="q3asciicache.html#setMaxCost">setMaxCost</a>() and <a href="q3asciicache.html#totalCost">totalCost</a>().</p>
<!-- @@@maxCost -->
<!-- $$$remove[overload1]$$$removeconstchar* -->
<h3 class="fn"><a name="remove"></a><span class="type">bool</span> Q3AsciiCache::<span class="name">remove</span> ( const <span class="type">char</span> * <i>k</i> )</h3>
<p>Removes the item with key <i>k</i> and returns TRUE if the item was present in the cache; otherwise returns FALSE.</p>
<p>The item is deleted if auto-deletion has been enabled, i.e&#x2e;, if you have called <a href="q3ptrcollection.html#setAutoDelete">setAutoDelete(TRUE)</a>.</p>
<p>If there are two or more items with equal keys, the one that was inserted last is removed.</p>
<p>All iterators that refer to the removed item are set to point to the next item in the cache's traversal order.</p>
<p><b>See also </b><a href="q3asciicache.html#take">take</a>() and <a href="q3asciicache.html#clear">clear</a>().</p>
<!-- @@@remove -->
<!-- $$$setMaxCost[overload1]$$$setMaxCostint -->
<h3 class="fn"><a name="setMaxCost"></a><span class="type">void</span> Q3AsciiCache::<span class="name">setMaxCost</span> ( <span class="type">int</span> <i>m</i> )</h3>
<p>Sets the maximum allowed total cost of the cache to <i>m</i>. If the current total cost is greater than <i>m</i>, some items are removed immediately.</p>
<p><b>See also </b><a href="q3asciicache.html#maxCost">maxCost</a>() and <a href="q3asciicache.html#totalCost">totalCost</a>().</p>
<!-- @@@setMaxCost -->
<!-- $$$size[overload1]$$$size -->
<h3 class="fn"><a name="size"></a><span class="type"><a href="qtglobal.html#uint-typedef">uint</a></span> Q3AsciiCache::<span class="name">size</span> () const</h3>
<p>Returns the size of the hash array used to implement the cache. This should be a bit bigger than <a href="q3asciicache.html#count">count</a>() is likely to be.</p>
<!-- @@@size -->
<!-- $$$statistics[overload1]$$$statistics -->
<h3 class="fn"><a name="statistics"></a><span class="type">void</span> Q3AsciiCache::<span class="name">statistics</span> () const</h3>
<p>A debug-only utility function. Prints out cache usage, hit/miss, and distribution information using <a href="qtglobal.html#qDebug">qDebug</a>(). This function does nothing in the release library.</p>
<!-- @@@statistics -->
<!-- $$$take[overload1]$$$takeconstchar* -->
<h3 class="fn"><a name="take"></a><span class="type">type</span> * Q3AsciiCache::<span class="name">take</span> ( const <span class="type">char</span> * <i>k</i> )</h3>
<p>Takes the item associated with <i>k</i> out of the cache without deleting it and returns a pointer to the item taken out, or 0 if the key does not exist in the cache.</p>
<p>If there are two or more items with equal keys, the one that was inserted last is taken.</p>
<p>All iterators that refer to the taken item are set to point to the next item in the cache's traversal order.</p>
<p><b>See also </b><a href="q3asciicache.html#remove">remove</a>() and <a href="q3asciicache.html#clear">clear</a>().</p>
<!-- @@@take -->
<!-- $$$totalCost[overload1]$$$totalCost -->
<h3 class="fn"><a name="totalCost"></a><span class="type">int</span> Q3AsciiCache::<span class="name">totalCost</span> () const</h3>
<p>Returns the total cost of the items in the cache. This is an integer in the range 0 to <a href="q3asciicache.html#maxCost">maxCost</a>().</p>
<p><b>See also </b><a href="q3asciicache.html#setMaxCost">setMaxCost</a>().</p>
<!-- @@@totalCost -->
<!-- $$$operator[][overload1]$$$operator[]constchar* -->
<h3 class="fn"><a name="operator-5b-5d"></a><span class="type">type</span> * Q3AsciiCache::<span class="name">operator[]</span> ( const <span class="type">char</span> * <i>k</i> ) const</h3>
<p>Returns the item with key <i>k</i>, or 0 if <i>k</i> does not exist in the cache, and moves the item to the front of the least recently used list.</p>
<p>If there are two or more items with equal keys, the one that was inserted last is returned.</p>
<p>This is the same as find( k, TRUE ).</p>
<p><b>See also </b><a href="q3asciicache.html#find">find</a>().</p>
<!-- @@@operator[] -->
</div>
      </div>
    </div>
    </div> 
    <div class="ft">
      <span></span>
    </div>
  </div> 
  <div class="footer">
    <p>
      <acronym title="Copyright">&copy;</acronym> 2013 Digia Plc and/or its
      subsidiaries. Documentation contributions included herein are the copyrights of
      their respective owners.</p>
    <br />
    <p>
      The documentation provided herein is licensed under the terms of the
      <a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation
      License version 1.3</a> as published by the Free Software Foundation.</p>
    <p>
      Documentation sources may be obtained from <a href="http://www.qt-project.org">
      www.qt-project.org</a>.</p>
    <br />
    <p>
      Digia, Qt and their respective logos are trademarks of Digia Plc 
      in Finland and/or other countries worldwide. All other trademarks are property
      of their respective owners. <a title="Privacy Policy"
      href="http://en.gitorious.org/privacy_policy/">Privacy Policy</a></p>
  </div>

  <script src="scripts/functions.js" type="text/javascript"></script>
</body>
</html>