<?xml version="1.0" encoding="iso-8859-1"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title>Class: Store</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <meta http-equiv="Content-Script-Type" content="text/javascript" /> <link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" /> <script type="text/javascript"> // <![CDATA[ function popupCode( url ) { window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400") } function toggleCode( id ) { if ( document.getElementById ) elem = document.getElementById( id ); else if ( document.all ) elem = eval( "document.all." + id ); else return false; elemStyle = elem.style; if ( elemStyle.display != "block" ) { elemStyle.display = "block" } else { elemStyle.display = "none" } return true; } // Make codeblocks hidden by default document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" ) // ]]> </script> </head> <body> <div id="classHeader"> <table class="header-table"> <tr class="top-aligned-row"> <td><strong>Class</strong></td> <td class="class-name-in-header">Store</td> </tr> <tr class="top-aligned-row"> <td><strong>In:</strong></td> <td> <a href="../files/lib/storage/store_rb.html"> lib/storage/store.rb </a> <br /> </td> </tr> <tr class="top-aligned-row"> <td><strong>Parent:</strong></td> <td> Object </td> </tr> </table> </div> <!-- banner header --> <div id="bodyContent"> <div id="contextContent"> <div id="diagram"> <map id="map" name="map"> <area shape="RECT" coords="25,17,97,65" href="Store.html" alt="Store "> </map> <img src="../dot/f_50.png" usemap="#map" border=0 alt="TopLevel"> </div> <div id="description"> <p> The <a href="Store.html">Store</a> class is an abstract class defining the methods needed to access a data store </p> </div> </div> <div id="method-list"> <h3 class="section-bar">Methods</h3> <div class="name-list"> <a href="#M000022">check</a> <a href="#M000017">close</a> <a href="#M000025">delete</a> <a href="#M000026">each</a> <a href="#M000021">get</a> <a href="#M000020">getid</a> <a href="#M000018">inspect</a> <a href="#M000027">makenoswap</a> <a href="#M000028">makeswap</a> <a href="#M000023">mark</a> <a href="#M000016">new</a> <a href="#M000024">put</a> <a href="#M000019">save</a> <a href="#M000029">stats</a> </div> </div> </div> <!-- if includes --> <div id="section"> <!-- if method_list --> <div id="methods"> <h3 class="section-bar">Public Class methods</h3> <div id="method-M000016" class="method-detail"> <a name="M000016"></a> <div class="method-heading"> <a href="Store.src/M000016.html" target="Code" class="method-signature" onclick="popupCode('Store.src/M000016.html');return false;"> <span class="method-name">new</span><span class="method-args">()</span> </a> </div> <div class="method-description"> <p> Construct store </p> <dl> <dt><tt>return</tt></dt><dd>Handle to the store </dd> </dl> </div> </div> <h3 class="section-bar">Public Instance methods</h3> <div id="method-M000022" class="method-detail"> <a name="M000022"></a> <div class="method-heading"> <a href="Store.src/M000022.html" target="Code" class="method-signature" onclick="popupCode('Store.src/M000022.html');return false;"> <span class="method-name">check</span><span class="method-args">(oid)</span> </a> </div> <div class="method-description"> <p> Check if an object is in the database by its id. </p> <dl> <dt><tt>oid</tt></dt><dd>is the id to use in the search. </dd> <dt><tt>return</tt></dt><dd>true or false </dd> </dl> </div> </div> <div id="method-M000017" class="method-detail"> <a name="M000017"></a> <div class="method-heading"> <a href="Store.src/M000017.html" target="Code" class="method-signature" onclick="popupCode('Store.src/M000017.html');return false;"> <span class="method-name">close</span><span class="method-args">()</span> </a> </div> <div class="method-description"> <p> Close the store </p> <dl> <dt><tt>return</tt></dt><dd>Undefined. </dd> </dl> </div> </div> <div id="method-M000025" class="method-detail"> <a name="M000025"></a> <div class="method-heading"> <a href="Store.src/M000025.html" target="Code" class="method-signature" onclick="popupCode('Store.src/M000025.html');return false;"> <span class="method-name">delete</span><span class="method-args">(oid)</span> </a> </div> <div class="method-description"> <p> Deletes an object from the database. </p> <dl> <dt><tt>oid</tt></dt><dd>is the id to to be deleted. </dd> <dt><tt>return</tt></dt><dd>Undefined. </dd> </dl> </div> </div> <div id="method-M000026" class="method-detail"> <a name="M000026"></a> <div class="method-heading"> <a href="Store.src/M000026.html" target="Code" class="method-signature" onclick="popupCode('Store.src/M000026.html');return false;"> <span class="method-name">each</span><span class="method-args">()</span> </a> </div> <div class="method-description"> <p> Iterate through all objects </p> <dl> <dt><tt>yield</tt></dt><dd>Each object in database to block of caller. </dd> </dl> </div> </div> <div id="method-M000021" class="method-detail"> <a name="M000021"></a> <div class="method-heading"> <a href="Store.src/M000021.html" target="Code" class="method-signature" onclick="popupCode('Store.src/M000021.html');return false;"> <span class="method-name">get</span><span class="method-args">(oid)</span> </a> </div> <div class="method-description"> <p> Finds an object in the database by its id. </p> <dl> <dt><tt>oid</tt></dt><dd>is the id to use in the search. </dd> <dt><tt>return</tt></dt><dd>Handle to the object or nil. </dd> </dl> </div> </div> <div id="method-M000020" class="method-detail"> <a name="M000020"></a> <div class="method-heading"> <a href="Store.src/M000020.html" target="Code" class="method-signature" onclick="popupCode('Store.src/M000020.html');return false;"> <span class="method-name">getid</span><span class="method-args">()</span> </a> </div> <div class="method-description"> <p> Fetch the next available id. </p> <dl> <dt><tt>return</tt></dt><dd>An id. </dd> </dl> </div> </div> <div id="method-M000018" class="method-detail"> <a name="M000018"></a> <div class="method-heading"> <a href="Store.src/M000018.html" target="Code" class="method-signature" onclick="popupCode('Store.src/M000018.html');return false;"> <span class="method-name">inspect</span><span class="method-args">()</span> </a> </div> <div class="method-description"> <p> inspect the store cache (only for caches) </p> <dl> <dt><tt>return</tt></dt><dd>Undefined. </dd> </dl> </div> </div> <div id="method-M000027" class="method-detail"> <a name="M000027"></a> <div class="method-heading"> <a href="Store.src/M000027.html" target="Code" class="method-signature" onclick="popupCode('Store.src/M000027.html');return false;"> <span class="method-name">makenoswap</span><span class="method-args">(oid)</span> </a> </div> <div class="method-description"> <p> Marks an object nonswappable </p> <dl> <dt><tt>oid</tt></dt><dd>is the object id </dd> <dt><tt>return</tt></dt><dd>undefined </dd> </dl> </div> </div> <div id="method-M000028" class="method-detail"> <a name="M000028"></a> <div class="method-heading"> <a href="Store.src/M000028.html" target="Code" class="method-signature" onclick="popupCode('Store.src/M000028.html');return false;"> <span class="method-name">makeswap</span><span class="method-args">(oid)</span> </a> </div> <div class="method-description"> <p> Marks an object swappable </p> <dl> <dt><tt>oid</tt></dt><dd>is the object id </dd> <dt><tt>return</tt></dt><dd>undefined </dd> </dl> </div> </div> <div id="method-M000023" class="method-detail"> <a name="M000023"></a> <div class="method-heading"> <a href="Store.src/M000023.html" target="Code" class="method-signature" onclick="popupCode('Store.src/M000023.html');return false;"> <span class="method-name">mark</span><span class="method-args">(oid)</span> </a> </div> <div class="method-description"> <p> Marks an object dirty </p> <dl> <dt><tt>oid</tt></dt><dd>is the id to use in the search. </dd> <dt><tt>return</tt></dt><dd>undefined </dd> </dl> </div> </div> <div id="method-M000024" class="method-detail"> <a name="M000024"></a> <div class="method-heading"> <a href="Store.src/M000024.html" target="Code" class="method-signature" onclick="popupCode('Store.src/M000024.html');return false;"> <span class="method-name">put</span><span class="method-args">(obj)</span> </a> </div> <div class="method-description"> <p> Adds a new object to the database. </p> <dl> <dt><tt>obj</tt></dt><dd>is a reference to object to be added </dd> <dt><tt>return</tt></dt><dd>Undefined. </dd> </dl> </div> </div> <div id="method-M000019" class="method-detail"> <a name="M000019"></a> <div class="method-heading"> <a href="Store.src/M000019.html" target="Code" class="method-signature" onclick="popupCode('Store.src/M000019.html');return false;"> <span class="method-name">save</span><span class="method-args">()</span> </a> </div> <div class="method-description"> <p> Save or flush the store to disk </p> <dl> <dt><tt>return</tt></dt><dd>Undefined. </dd> </dl> </div> </div> <div id="method-M000029" class="method-detail"> <a name="M000029"></a> <div class="method-heading"> <a href="Store.src/M000029.html" target="Code" class="method-signature" onclick="popupCode('Store.src/M000029.html');return false;"> <span class="method-name">stats</span><span class="method-args">()</span> </a> </div> <div class="method-description"> <p> produces a statistical report of the database </p> <dl> <dt><tt>return</tt></dt><dd>a string containing the report </dd> </dl> </div> </div> </div> </div> <div id="validator-badges"> <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p> </div> </body> </html>