?? cons_8hpp.html
字號:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"><title>a1: cons.hpp File Reference</title><link href="doxygen.css" rel="stylesheet" type="text/css"></head><body><!-- Generated by Doxygen 1.3.9.1 --><div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="namespaces.html">Namespace List</a> | <a class="qindex" href="hierarchy.html">Class Hierarchy</a> | <a class="qindex" href="annotated.html">Class List</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="functions.html">Class Members</a> | <a class="qindex" href="globals.html">File Members</a></div><h1>cons.hpp File Reference</h1><code>#include <iostream></code><br><code>#include "<a class="el" href="Cell_8hpp-source.html">Cell.hpp</a>"</code><br><p><a href="cons_8hpp-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>Functions</h2></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="classCell.html">Cell</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="cons_8hpp.html#a1">make_int</a> (const int i)</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">Make an int cell. <a href="#a1"></a><br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="classCell.html">Cell</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="cons_8hpp.html#a2">make_double</a> (const double d)</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">Make a double cell. <a href="#a2"></a><br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="classCell.html">Cell</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="cons_8hpp.html#a3">make_symbol</a> (const char *const s)</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">Make a symbol cell. <a href="#a3"></a><br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="classCell.html">Cell</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="cons_8hpp.html#a4">cons</a> (<a class="el" href="classCell.html">Cell</a> *const my_car, <a class="el" href="classCell.html">Cell</a> *const my_cdr)</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">Make a conspair cell. <a href="#a4"></a><br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="cons_8hpp.html#a5">nullp</a> (<a class="el" href="classCell.html">Cell</a> *const c)</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">Check if c points to an empty list, i.e., is a null pointer. <a href="#a5"></a><br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="cons_8hpp.html#a6">listp</a> (<a class="el" href="classCell.html">Cell</a> *const c)</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">Check if c points to a list (i.e., nil or a cons cell). <a href="#a6"></a><br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="cons_8hpp.html#a7">intp</a> (<a class="el" href="classCell.html">Cell</a> *const c)</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">Check if c points to an int cell. <a href="#a7"></a><br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="cons_8hpp.html#a8">doublep</a> (<a class="el" href="classCell.html">Cell</a> *const c)</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">Check if c points to a double cell. <a href="#a8"></a><br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="cons_8hpp.html#a9">symbolp</a> (<a class="el" href="classCell.html">Cell</a> *const c)</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">Check if c points to a symbol cell. <a href="#a9"></a><br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="cons_8hpp.html#a10">get_int</a> (<a class="el" href="classCell.html">Cell</a> *const c)</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">Accessor (error if c is not an int cell). <a href="#a10"></a><br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="cons_8hpp.html#a11">get_double</a> (<a class="el" href="classCell.html">Cell</a> *const c)</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">Accessor (error if c is not a double cell). <a href="#a11"></a><br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">string </td><td class="memItemRight" valign="bottom"><a class="el" href="cons_8hpp.html#a12">get_symbol</a> (<a class="el" href="classCell.html">Cell</a> *const c)</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">Retrieve the symbol name as a string (error if c is not a symbol cell). <a href="#a12"></a><br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="classCell.html">Cell</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="cons_8hpp.html#a13">car</a> (<a class="el" href="classCell.html">Cell</a> *const c)</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">Accessor (error if c is not a cons cell). <a href="#a13"></a><br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="classCell.html">Cell</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="cons_8hpp.html#a14">cdr</a> (<a class="el" href="classCell.html">Cell</a> *const c)</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">Accessor (error if c is not a string cell). <a href="#a14"></a><br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">ostream & </td><td class="memItemRight" valign="bottom"><a class="el" href="cons_8hpp.html#a15">operator<<</a> (ostream &os, const <a class="el" href="classCell.html">Cell</a> &c)</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">Print the subtree rooted at c, in s-expression notation. <a href="#a15"></a><br></td></tr><tr><td colspan="2"><br><h2>Variables</h2></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="classCell.html">Cell</a> *const </td><td class="memItemRight" valign="bottom"><a class="el" href="cons_8hpp.html#a0">nil</a></td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">The null pointer value. <a href="#a0"></a><br></td></tr></table><hr><a name="_details"></a><h2>Detailed Description</h2>Encapsulates an abstract interface layer for a cons list ADT, without using member functions. Makes no assumptions about what kind of concrete type <a class="el" href="classCell.html">Cell</a> will be defined to be.<hr><h2>Function Documentation</h2><a class="anchor" name="a13" doxytag="cons.hpp::car"></a><p><table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"><a class="el" href="classCell.html">Cell</a>* car </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top"><a class="el" href="classCell.html">Cell</a> *const </td> <td class="mdname1" valign="top" nowrap> <em>c</em> </td> <td class="md" valign="top"> ) </td> <td class="md" nowrap><code> [inline]</code></td> </tr> </table> </td> </tr></table><table cellspacing="5" cellpadding="0" border="0"> <tr> <td> </td> <td><p>Accessor (error if c is not a cons cell). <p><dl compact><dt><b>Returns:</b></dt><dd>The car pointer in the cons cell pointed to by c. </dd></dl> </td> </tr></table><a class="anchor" name="a14" doxytag="cons.hpp::cdr"></a><p><table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"><a class="el" href="classCell.html">Cell</a>* cdr </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top"><a class="el" href="classCell.html">Cell</a> *const </td> <td class="mdname1" valign="top" nowrap> <em>c</em> </td> <td class="md" valign="top"> ) </td> <td class="md" nowrap><code> [inline]</code></td> </tr> </table> </td> </tr></table><table cellspacing="5" cellpadding="0" border="0"> <tr> <td> </td> <td><p>Accessor (error if c is not a string cell). <p><dl compact><dt><b>Returns:</b></dt><dd>The cdr pointer in the cons cell pointed to by c. </dd></dl> </td> </tr></table><a class="anchor" name="a4" doxytag="cons.hpp::cons"></a><p><table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"><a class="el" href="classCell.html">Cell</a>* cons </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top"><a class="el" href="classCell.html">Cell</a> *const </td> <td class="mdname" nowrap> <em>my_car</em>, </td> </tr> <tr> <td class="md" nowrap align="right"></td> <td class="md"></td> <td class="md" nowrap><a class="el" href="classCell.html">Cell</a> *const </td> <td class="mdname" nowrap> <em>my_cdr</em></td> </tr> <tr> <td class="md"></td> <td class="md">) </td> <td class="md" colspan="2"><code> [inline]</code></td> </tr> </table> </td> </tr></table><table cellspacing="5" cellpadding="0" border="0"> <tr> <td> </td> <td><p>Make a conspair cell. <p><dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>my_car</em> </td><td>The initial car pointer to be stored in the new cell. </td></tr> <tr><td valign="top"></td><td valign="top"><em>my_cdr</em> </td><td>The initial cdr pointer to be stored in the new cell. </td></tr> </table></dl> </td> </tr></table><a class="anchor" name="a8" doxytag="cons.hpp::doublep"></a><p><table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top">bool doublep </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top"><a class="el" href="classCell.html">Cell</a> *const </td> <td class="mdname1" valign="top" nowrap> <em>c</em> </td> <td class="md" valign="top"> ) </td> <td class="md" nowrap><code> [inline]</code></td> </tr> </table> </td> </tr></table><table cellspacing="5" cellpadding="0" border="0"> <tr> <td> </td> <td><p>Check if c points to a double cell. <p><dl compact><dt><b>Returns:</b></dt><dd>True iff c points to a double cell. </dd></dl> </td> </tr></table><a class="anchor" name="a11" doxytag="cons.hpp::get_double"></a><p><table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top">double get_double </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top"><a class="el" href="classCell.html">Cell</a> *const </td> <td class="mdname1" valign="top" nowrap> <em>c</em> </td> <td class="md" valign="top"> ) </td> <td class="md" nowrap><code> [inline]</code></td> </tr> </table> </td> </tr></table><table cellspacing="5" cellpadding="0" border="0"> <tr> <td> </td> <td><p>Accessor (error if c is not a double cell). <p><dl compact><dt><b>Returns:</b></dt><dd>The value in the double cell pointed to by c. </dd></dl> </td> </tr></table><a class="anchor" name="a10" doxytag="cons.hpp::get_int"></a><p><table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top">int get_int </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top"><a class="el" href="classCell.html">Cell</a> *const </td> <td class="mdname1" valign="top" nowrap> <em>c</em> </td> <td class="md" valign="top"> ) </td> <td class="md" nowrap><code> [inline]</code></td> </tr> </table> </td> </tr></table><table cellspacing="5" cellpadding="0" border="0"> <tr> <td> </td> <td><p>Accessor (error if c is not an int cell). <p><dl compact><dt><b>Returns:</b></dt><dd>The value in the int cell pointed to by c. </dd></dl> </td> </tr></table><a class="anchor" name="a12" doxytag="cons.hpp::get_symbol"></a><p><table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top">string get_symbol </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top"><a class="el" href="classCell.html">Cell</a> *const </td> <td class="mdname1" valign="top" nowrap> <em>c</em> </td> <td class="md" valign="top"> ) </td> <td class="md" nowrap><code> [inline]</code></td> </tr> </table> </td> </tr></table><table cellspacing="5" cellpadding="0" border="0"> <tr> <td> </td> <td><p>Retrieve the symbol name as a string (error if c is not a symbol cell). <p><dl compact><dt><b>Returns:</b></dt><dd>The symbol name in the symbol cell pointed to by c. </dd></dl> </td> </tr></table><a class="anchor" name="a7" doxytag="cons.hpp::intp"></a><p><table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0">
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -