<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> <title>libdap++: HTTPCacheTable.cc File Reference</title> <link href="tabs.css" rel="stylesheet" type="text/css"> <link href="doxygen.css" rel="stylesheet" type="text/css"> </head><body> <!-- Generated by Doxygen 1.5.9 --> <div class="navigation" id="top"> <div class="tabs"> <ul> <li><a href="main.html"><span>Main Page</span></a></li> <li><a href="pages.html"><span>Related Pages</span></a></li> <li><a href="namespaces.html"><span>Namespaces</span></a></li> <li><a href="annotated.html"><span>Classes</span></a></li> <li class="current"><a href="files.html"><span>Files</span></a></li> </ul> </div> <div class="tabs"> <ul> <li><a href="files.html"><span>File List</span></a></li> <li><a href="globals.html"><span>File Members</span></a></li> </ul> </div> </div> <div class="contents"> <h1>HTTPCacheTable.cc File Reference</h1><code>#include "<a class="el" href="config_8h_source.html">config.h</a>"</code><br> <code>#include <pthread.h></code><br> <code>#include <limits.h></code><br> <code>#include <unistd.h></code><br> <code>#include <sys/types.h></code><br> <code>#include <sys/stat.h></code><br> <code>#include <cstring></code><br> <code>#include <iostream></code><br> <code>#include <sstream></code><br> <code>#include <algorithm></code><br> <code>#include <iterator></code><br> <code>#include <set></code><br> <code>#include "<a class="el" href="Error_8h_source.html">Error.h</a>"</code><br> <code>#include "<a class="el" href="InternalErr_8h_source.html">InternalErr.h</a>"</code><br> <code>#include "<a class="el" href="ResponseTooBigErr_8h_source.html">ResponseTooBigErr.h</a>"</code><br> <code>#include "<a class="el" href="SignalHandler_8h_source.html">SignalHandler.h</a>"</code><br> <code>#include "<a class="el" href="HTTPCacheInterruptHandler_8h_source.html">HTTPCacheInterruptHandler.h</a>"</code><br> <code>#include "<a class="el" href="HTTPCacheTable_8h_source.html">HTTPCacheTable.h</a>"</code><br> <code>#include "<a class="el" href="util__mit_8h_source.html">util_mit.h</a>"</code><br> <code>#include "<a class="el" href="debug_8h_source.html">debug.h</a>"</code><br> <p> <div class="dynheader"> Include dependency graph for HTTPCacheTable.cc:</div> <div class="dynsection"> <p><center><img src="HTTPCacheTable_8cc__incl.png" border="0" usemap="#HTTPCacheTable.cc_map" alt=""></center> <map name="HTTPCacheTable.cc_map"> <area shape="rect" id="node3" href="config_8h.html" title="config.h" alt="" coords="5,80,107,107"><area shape="rect" id="node27" href="Error_8h.html" title="Error.h" alt="" coords="1817,379,1908,405"><area shape="rect" id="node34" href="InternalErr_8h.html" title="InternalErr.h" alt="" coords="1673,304,1825,331"><area shape="rect" id="node38" href="ResponseTooBigErr_8h.html" title="ResponseTooBigErr.h" alt="" coords="1729,229,1940,256"><area shape="rect" id="node42" href="SignalHandler_8h.html" title="SignalHandler.h" alt="" coords="1011,80,1181,107"><area shape="rect" id="node50" href="HTTPCacheInterruptHandler_8h.html" title="HTTPCacheInterruptHandler.h" alt="" coords="1405,80,1696,107"><area shape="rect" id="node65" href="HTTPCacheTable_8h.html" title="HTTPCacheTable.h" alt="" coords="2481,229,2663,256"><area shape="rect" id="node71" href="debug_8h.html" title="debug.h" alt="" coords="2765,304,2856,331"><area shape="rect" id="node85" href="util__mit_8h.html" title="util_mit.h" alt="" coords="2725,379,2845,405"><area shape="rect" id="node46" href="EventHandler_8h.html" title="EventHandler.h" alt="" coords="1233,155,1393,181"><area shape="rect" id="node57" href="HTTPCache_8h.html" title="HTTPCache.h" alt="" coords="2145,155,2276,181"><area shape="rect" id="node76" href="HTTPCacheDisconnectedMode_8h.html" title="HTTPCacheDisconnectedMode.h" alt="" coords="2065,229,2356,256"><area shape="rect" id="node78" href="SignalHandlerRegisteredErr_8h.html" title="SignalHandlerRegisteredErr.h" alt="" coords="1900,304,2201,331"></map> </div> <p> <a href="HTTPCacheTable_8cc_source.html">Go to the source code of this file.</a><table border="0" cellpadding="0" cellspacing="0"> <tr><td></td></tr> <tr><td colspan="2"><br><h2>Namespaces</h2></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">namespace </td><td class="memItemRight" valign="bottom"><a class="el" href="namespacelibdap.html">libdap</a></td></tr> <tr><td colspan="2"><br><h2>Defines</h2></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="HTTPCacheTable_8cc.html#69b733628460a6923e506281cd95c43f">CACHE_EMPTY_ETAG</a> "@cache@"</td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="HTTPCacheTable_8cc.html#2fcbe1f1875c3c4b38a63ea99b906c49">CACHE_INDEX</a> ".index"</td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="HTTPCacheTable_8cc.html#9f34e7ee25eb923739b1ea126dce4528">CACHE_META</a> ".meta"</td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="HTTPCacheTable_8cc.html#1d22fde6e7501aebedb7663f0b0aa4e2">DIR_SEPARATOR_CHAR</a> '/'</td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="HTTPCacheTable_8cc.html#23e72ca2d8456a971c13441bdfc4586f">DIR_SEPARATOR_STR</a> "/"</td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="HTTPCacheTable_8cc.html#c34ecfc4f379afa6b7cbcf41c7781d0d">LM_EXPIRATION</a>(t) (min((MAX_LM_EXPIRATION), static_cast<int>((t) / 10)))</td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="HTTPCacheTable_8cc.html#edf844327e904ce70cf4112a5d9fc334">MAX_LM_EXPIRATION</a> 48*3600</td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="HTTPCacheTable_8cc.html#2bf44344e285663ad0b0b7bb001ac4fd">MKDIR</a>(a, b) mkdir((a), (b))</td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="HTTPCacheTable_8cc.html#e76603c1b2ef94cb2664dbad1b82a4c6">MKSTEMP</a>(a) mkstemp((a))</td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="HTTPCacheTable_8cc.html#fefcb1315dce44b5c9459b8f0ad22cb7">NO_LM_EXPIRATION</a> 24*3600</td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="HTTPCacheTable_8cc.html#2a6edcee170a79b132872d22066754ed">REMOVE</a>(a) remove((a))</td></tr> <tr><td colspan="2"><br><h2>Functions</h2></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="namespacelibdap.html#68a16ef70e29c367dabd3cb5165c386a">libdap::get_hash</a> (const string &url)</td></tr> <tr><td colspan="2"><br><h2>Variables</h2></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">const int </td><td class="memItemRight" valign="bottom"><a class="el" href="HTTPCacheTable_8cc.html#17929d1ac6258253df584173f0c6e279">CACHE_TABLE_SIZE</a> = 1499</td></tr> </table> <hr><h2>Define Documentation</h2> <a class="anchor" name="69b733628460a6923e506281cd95c43f"></a><!-- doxytag: member="HTTPCacheTable.cc::CACHE_EMPTY_ETAG" ref="69b733628460a6923e506281cd95c43f" args="" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">#define CACHE_EMPTY_ETAG "@cache@" </td> </tr> </table> </div> <div class="memdoc"> <p> <p>Definition at line <a class="el" href="HTTPCacheTable_8cc_source.html#l00076">76</a> of file <a class="el" href="HTTPCacheTable_8cc_source.html">HTTPCacheTable.cc</a>.</p> <p>Referenced by <a class="el" href="HTTPCacheTable_8cc_source.html#l00330">libdap::HTTPCacheTable::cache_index_parse_line()</a>.</p> </div> </div><p> <a class="anchor" name="2fcbe1f1875c3c4b38a63ea99b906c49"></a><!-- doxytag: member="HTTPCacheTable.cc::CACHE_INDEX" ref="2fcbe1f1875c3c4b38a63ea99b906c49" args="" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">#define CACHE_INDEX ".index" </td> </tr> </table> </div> <div class="memdoc"> <p> <p>Definition at line <a class="el" href="HTTPCacheTable_8cc_source.html#l00075">75</a> of file <a class="el" href="HTTPCacheTable_8cc_source.html">HTTPCacheTable.cc</a>.</p> </div> </div><p> <a class="anchor" name="9f34e7ee25eb923739b1ea126dce4528"></a><!-- doxytag: member="HTTPCacheTable.cc::CACHE_META" ref="9f34e7ee25eb923739b1ea126dce4528" args="" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">#define CACHE_META ".meta" </td> </tr> </table> </div> <div class="memdoc"> <p> <p>Definition at line <a class="el" href="HTTPCacheTable_8cc_source.html#l00074">74</a> of file <a class="el" href="HTTPCacheTable_8cc_source.html">HTTPCacheTable.cc</a>.</p> </div> </div><p> <a class="anchor" name="1d22fde6e7501aebedb7663f0b0aa4e2"></a><!-- doxytag: member="HTTPCacheTable.cc::DIR_SEPARATOR_CHAR" ref="1d22fde6e7501aebedb7663f0b0aa4e2" args="" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">#define DIR_SEPARATOR_CHAR '/' </td> </tr> </table> </div> <div class="memdoc"> <p> <p>Definition at line <a class="el" href="HTTPCacheTable_8cc_source.html#l00070">70</a> of file <a class="el" href="HTTPCacheTable_8cc_source.html">HTTPCacheTable.cc</a>.</p> </div> </div><p> <a class="anchor" name="23e72ca2d8456a971c13441bdfc4586f"></a><!-- doxytag: member="HTTPCacheTable.cc::DIR_SEPARATOR_STR" ref="23e72ca2d8456a971c13441bdfc4586f" args="" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">#define DIR_SEPARATOR_STR "/" </td> </tr> </table> </div> <div class="memdoc"> <p> <p>Definition at line <a class="el" href="HTTPCacheTable_8cc_source.html#l00071">71</a> of file <a class="el" href="HTTPCacheTable_8cc_source.html">HTTPCacheTable.cc</a>.</p> </div> </div><p> <a class="anchor" name="c34ecfc4f379afa6b7cbcf41c7781d0d"></a><!-- doxytag: member="HTTPCacheTable.cc::LM_EXPIRATION" ref="c34ecfc4f379afa6b7cbcf41c7781d0d" args="(t)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">#define LM_EXPIRATION </td> <td>(</td> <td class="paramtype">t </td> <td class="paramname"> </td> <td> ) </td> <td> (min((MAX_LM_EXPIRATION), static_cast<int>((t) / 10)))</td> </tr> </table> </div> <div class="memdoc"> <p> <p>Definition at line <a class="el" href="HTTPCacheTable_8cc_source.html#l00084">84</a> of file <a class="el" href="HTTPCacheTable_8cc_source.html">HTTPCacheTable.cc</a>.</p> <p>Referenced by <a class="el" href="HTTPCacheTable_8cc_source.html#l00740">libdap::HTTPCacheTable::calculate_time()</a>.</p> </div> </div><p> <a class="anchor" name="edf844327e904ce70cf4112a5d9fc334"></a><!-- doxytag: member="HTTPCacheTable.cc::MAX_LM_EXPIRATION" ref="edf844327e904ce70cf4112a5d9fc334" args="" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">#define MAX_LM_EXPIRATION 48*3600 </td> </tr> </table> </div> <div class="memdoc"> <p> <p>Definition at line <a class="el" href="HTTPCacheTable_8cc_source.html#l00079">79</a> of file <a class="el" href="HTTPCacheTable_8cc_source.html">HTTPCacheTable.cc</a>.</p> </div> </div><p> <a class="anchor" name="2bf44344e285663ad0b0b7bb001ac4fd"></a><!-- doxytag: member="HTTPCacheTable.cc::MKDIR" ref="2bf44344e285663ad0b0b7bb001ac4fd" args="(a, b)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">#define MKDIR </td> <td>(</td> <td class="paramtype">a, <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">b </td> <td class="paramname"> </td> <td> ) </td> <td> mkdir((a), (b))</td> </tr> </table> </div> <div class="memdoc"> <p> <p>Definition at line <a class="el" href="HTTPCacheTable_8cc_source.html#l00067">67</a> of file <a class="el" href="HTTPCacheTable_8cc_source.html">HTTPCacheTable.cc</a>.</p> </div> </div><p> <a class="anchor" name="e76603c1b2ef94cb2664dbad1b82a4c6"></a><!-- doxytag: member="HTTPCacheTable.cc::MKSTEMP" ref="e76603c1b2ef94cb2664dbad1b82a4c6" args="(a)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">#define MKSTEMP </td> <td>(</td> <td class="paramtype">a </td> <td class="paramname"> </td> <td> ) </td> <td> mkstemp((a))</td> </tr> </table> </div> <div class="memdoc"> <p> <p>Definition at line <a class="el" href="HTTPCacheTable_8cc_source.html#l00069">69</a> of file <a class="el" href="HTTPCacheTable_8cc_source.html">HTTPCacheTable.cc</a>.</p> </div> </div><p> <a class="anchor" name="fefcb1315dce44b5c9459b8f0ad22cb7"></a><!-- doxytag: member="HTTPCacheTable.cc::NO_LM_EXPIRATION" ref="fefcb1315dce44b5c9459b8f0ad22cb7" args="" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">#define NO_LM_EXPIRATION 24*3600 </td> </tr> </table> </div> <div class="memdoc"> <p> <p>Definition at line <a class="el" href="HTTPCacheTable_8cc_source.html#l00078">78</a> of file <a class="el" href="HTTPCacheTable_8cc_source.html">HTTPCacheTable.cc</a>.</p> </div> </div><p> <a class="anchor" name="2a6edcee170a79b132872d22066754ed"></a><!-- doxytag: member="HTTPCacheTable.cc::REMOVE" ref="2a6edcee170a79b132872d22066754ed" args="(a)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">#define REMOVE </td> <td>(</td> <td class="paramtype">a </td> <td class="paramname"> </td> <td> ) </td> <td> remove((a))</td> </tr> </table> </div> <div class="memdoc"> <p> <p>Definition at line <a class="el" href="HTTPCacheTable_8cc_source.html#l00068">68</a> of file <a class="el" href="HTTPCacheTable_8cc_source.html">HTTPCacheTable.cc</a>.</p> </div> </div><p> <hr><h2>Variable Documentation</h2> <a class="anchor" name="17929d1ac6258253df584173f0c6e279"></a><!-- doxytag: member="HTTPCacheTable.cc::CACHE_TABLE_SIZE" ref="17929d1ac6258253df584173f0c6e279" args="" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">const int <a class="el" href="HTTPCacheTable_8cc.html#17929d1ac6258253df584173f0c6e279">CACHE_TABLE_SIZE</a> = 1499 </td> </tr> </table> </div> <div class="memdoc"> <p> <p>Definition at line <a class="el" href="HTTPCacheTable_8cc_source.html#l00087">87</a> of file <a class="el" href="HTTPCacheTable_8cc_source.html">HTTPCacheTable.cc</a>.</p> <p>Referenced by <a class="el" href="HTTPCacheTable_8cc_source.html#l00404">libdap::HTTPCacheTable::cache_index_write()</a>, <a class="el" href="HTTPCacheTable_8cc_source.html#l00711">libdap::HTTPCacheTable::delete_all_entries()</a>, <a class="el" href="HTTPCacheTable_8cc_source.html#l00219">libdap::HTTPCacheTable::delete_by_hits()</a>, <a class="el" href="HTTPCacheTable_8cc_source.html#l00254">libdap::HTTPCacheTable::delete_by_size()</a>, <a class="el" href="HTTPCacheTable_8cc_source.html#l00182">libdap::HTTPCacheTable::delete_expired_entries()</a>, and <a class="el" href="HTTPCacheTable_8cc_source.html#l00137">libdap::HTTPCacheTable::~HTTPCacheTable()</a>.</p> </div> </div><p> </div> <hr size="1"><address style="text-align: right;"><small>Generated on Wed Oct 7 19:57:54 2009 for libdap++ by <a href="http://www.doxygen.org/index.html"> <img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.9 </small></address> </body> </html>