File: classComparable.html

package info (click to toggle)
mysql%2B%2B 3.0.0-1
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 10,328 kB
  • ctags: 9,487
  • sloc: cpp: 33,486; sh: 3,091; perl: 809; makefile: 683
file content (135 lines) | stat: -rw-r--r-- 9,543 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
	<title>MySQL++ Reference Manual</title>
	<meta http-equiv="Content-type" content="text/html;charset=iso-8859-1">
	<link href="doxygen.css" rel="stylesheet" type="text/css">
	<link href="refman.css" rel="stylesheet" type="text/css">
</head>
<body>
<!-- Generated by Doxygen 1.4.7 -->
<div class="tabs">
  <ul>
    <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
    <li id="current"><a href="annotated.html"><span>Classes</span></a></li>
    <li><a href="files.html"><span>Files</span></a></li>
  </ul></div>
<div class="tabs">
  <ul>
    <li><a href="annotated.html"><span>Class&nbsp;List</span></a></li>
    <li><a href="hierarchy.html"><span>Class&nbsp;Hierarchy</span></a></li>
    <li><a href="functions.html"><span>Class&nbsp;Members</span></a></li>
  </ul></div>
<h1>Comparable&lt; T &gt; Class Template Reference</h1><!-- doxytag: class="Comparable" -->Mix-in that gives its subclass a full set of comparison operators.  
<a href="#_details">More...</a>
<p>
<code>#include &lt;<a class="el" href="comparable_8h-source.html">comparable.h</a>&gt;</code>
<p>
Inheritance diagram for Comparable&lt; T &gt;:<p><center><img src="classComparable__inherit__graph.png" border="0" usemap="#Comparable_3_01T_01_4__inherit__map" alt="Inheritance graph"></center>
<map name="Comparable_3_01T_01_4__inherit__map">
<area href="classmysqlpp_1_1Date.html" shape="rect" coords="388,5,631,29" alt="">
<area href="classmysqlpp_1_1DateTime.html" shape="rect" coords="355,53,664,77" alt="">
<area href="classmysqlpp_1_1Time.html" shape="rect" coords="387,101,632,125" alt="">
<area href="classComparable.html" shape="rect" coords="396,149,623,173" alt="">
<area href="classComparable.html" shape="rect" coords="395,197,624,221" alt="">
<area href="classComparable.html" shape="rect" coords="380,245,639,269" alt="">
</map>
<center><font size="2">[<a href="graph_legend.html">legend</a>]</font></center><a href="classComparable-members.html">List of all members.</a><table border="0" cellpadding="0" cellspacing="0">
<tr><td></td></tr>
<tr><td colspan="2"><br><h2>Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="d059b1abac62eb3779ceb2357f390a80"></a><!-- doxytag: member="Comparable::operator==" ref="d059b1abac62eb3779ceb2357f390a80" args="(const T &amp;other) const " -->
bool&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classComparable.html#d059b1abac62eb3779ceb2357f390a80">operator==</a> (const T &amp;other) const </td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns true if "other" is equal to this object. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="81566a47c1b7598b8c13ed990ff9691a"></a><!-- doxytag: member="Comparable::operator!=" ref="81566a47c1b7598b8c13ed990ff9691a" args="(const T &amp;other) const " -->
bool&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classComparable.html#81566a47c1b7598b8c13ed990ff9691a">operator!=</a> (const T &amp;other) const </td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns true if "other" is not equal to this object. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="aab1d756e90dd4b81cc38305d203554d"></a><!-- doxytag: member="Comparable::operator&lt;" ref="aab1d756e90dd4b81cc38305d203554d" args="(const T &amp;other) const " -->
bool&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classComparable.html#aab1d756e90dd4b81cc38305d203554d">operator&lt;</a> (const T &amp;other) const </td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns true if "other" is less than this object. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="e4664a53daa13672d054fae947be45a1"></a><!-- doxytag: member="Comparable::operator&lt;=" ref="e4664a53daa13672d054fae947be45a1" args="(const T &amp;other) const " -->
bool&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classComparable.html#e4664a53daa13672d054fae947be45a1">operator&lt;=</a> (const T &amp;other) const </td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns true if "other" is less than or equal to this object. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="3c9b258e15757cae23dfe19c1f4d0b5c"></a><!-- doxytag: member="Comparable::operator&gt;" ref="3c9b258e15757cae23dfe19c1f4d0b5c" args="(const T &amp;other) const " -->
bool&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classComparable.html#3c9b258e15757cae23dfe19c1f4d0b5c">operator&gt;</a> (const T &amp;other) const </td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns true if "other" is greater than this object. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="17e311cecdd6b187758816fb9eef5325"></a><!-- doxytag: member="Comparable::operator&gt;=" ref="17e311cecdd6b187758816fb9eef5325" args="(const T &amp;other) const " -->
bool&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classComparable.html#17e311cecdd6b187758816fb9eef5325">operator&gt;=</a> (const T &amp;other) const </td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns true if "other" is greater than or equal to this object. <br></td></tr>
<tr><td colspan="2"><br><h2>Protected Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classComparable.html#f69a5ad966d481b12c63c6e207b98d67">~Comparable</a> ()</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Destroy object.  <a href="#f69a5ad966d481b12c63c6e207b98d67"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classComparable.html#1edd25e58fdc64bf9f61f391bc36085a">compare</a> (const T &amp;other) const =0</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Compare this object to another of the same type.  <a href="#1edd25e58fdc64bf9f61f391bc36085a"></a><br></td></tr>
</table>
<hr><a name="_details"></a><h2>Detailed Description</h2>
<h3>template&lt;class T&gt;<br>
 class Comparable&lt; T &gt;</h3>

Mix-in that gives its subclass a full set of comparison operators. 
<p>
Simply by inheriting publically from this and implementing <a class="el" href="classComparable.html#1edd25e58fdc64bf9f61f391bc36085a">compare()</a>, the subclass gains a full set of comparison operators, because all of the operators are implemented in terms of <a class="el" href="classComparable.html#1edd25e58fdc64bf9f61f391bc36085a">compare()</a>. 
<p>
<hr><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" name="f69a5ad966d481b12c63c6e207b98d67"></a><!-- doxytag: member="Comparable::~Comparable" ref="f69a5ad966d481b12c63c6e207b98d67" args="()" -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class T&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">virtual <a class="el" href="classComparable.html">Comparable</a>&lt; T &gt;::~<a class="el" href="classComparable.html">Comparable</a>           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"><code> [inline, protected, virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Destroy object. 
<p>
This class has nothing to destroy, but declaring the dtor virtual placates some compilers set to high warning levels. Protecting it ensures you can't delete subclasses through base class pointers, which makes no sense because this class isn't made for polymorphism. It's just a mixin. 
</div>
</div><p>
<hr><h2>Member Function Documentation</h2>
<a class="anchor" name="1edd25e58fdc64bf9f61f391bc36085a"></a><!-- doxytag: member="Comparable::compare" ref="1edd25e58fdc64bf9f61f391bc36085a" args="(const T &amp;other) const =0" -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class T&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">virtual int <a class="el" href="classComparable.html">Comparable</a>&lt; T &gt;::compare           </td>
          <td>(</td>
          <td class="paramtype">const T &amp;&nbsp;</td>
          <td class="paramname"> <em>other</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"> const<code> [protected, pure virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Compare this object to another of the same type. 
<p>
Returns &lt; 0 if this object is "before" the other, 0 of they are equal, and &gt; 0 if this object is "after" the other. 
</div>
</div><p>
<hr>The documentation for this class was generated from the following file:<ul>
<li><a class="el" href="comparable_8h-source.html">comparable.h</a></ul>
<hr size="1"><address style="align: right;"><small>Generated on Fri Feb 29 16:26:19 2008 for MySQL++ by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
</body>
</html>