1 | <html> |
---|
2 | <head> |
---|
3 | <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> |
---|
4 | <title> |
---|
5 | BoostBook element class</title> |
---|
6 | <link rel="stylesheet" href="../../boostbook.css" type="text/css"> |
---|
7 | <meta name="generator" content="DocBook XSL Stylesheets V1.68.1"> |
---|
8 | <link rel="start" href="../../index.html" title="The Boost C++ Libraries BoostBook Documentation Subset"> |
---|
9 | <link rel="up" href="../../reference.html" title="Reference"> |
---|
10 | <link rel="prev" href="overloaded-function.html" title=" |
---|
11 | BoostBook element overloaded-function"> |
---|
12 | <link rel="next" href="librarycategorydef.html" title=" |
---|
13 | BoostBook element librarycategorydef"> |
---|
14 | </head> |
---|
15 | <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"> |
---|
16 | <table cellpadding="2" width="100%"> |
---|
17 | <td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../boost.png"></td> |
---|
18 | <td align="center"><a href="../../../../index.htm">Home</a></td> |
---|
19 | <td align="center"><a href="../../../../libs/libraries.htm">Libraries</a></td> |
---|
20 | <td align="center"><a href="../../../../people/people.htm">People</a></td> |
---|
21 | <td align="center"><a href="../../../../more/faq.htm">FAQ</a></td> |
---|
22 | <td align="center"><a href="../../../../more/index.htm">More</a></td> |
---|
23 | </table> |
---|
24 | <hr> |
---|
25 | <div class="spirit-nav"> |
---|
26 | <a accesskey="p" href="overloaded-function.html"><img src="../../images/prev.png" alt="Prev"></a><a accesskey="u" href="../../reference.html"><img src="../../images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../images/home.png" alt="Home"></a><a accesskey="n" href="librarycategorydef.html"><img src="../../images/next.png" alt="Next"></a> |
---|
27 | </div> |
---|
28 | <div class="refentry" lang="en"> |
---|
29 | <a name="boostbook.dtd.class"></a><div class="titlepage"></div> |
---|
30 | <div class="refnamediv"> |
---|
31 | <h2><span class="refentrytitle"> |
---|
32 | BoostBook element <code class="sgmltag-element">class</code></span></h2> |
---|
33 | <p>class — Declares a class or class template</p> |
---|
34 | </div> |
---|
35 | <h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2> |
---|
36 | <div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv">class ::= |
---|
37 | (<a href="template.html" title=" |
---|
38 | BoostBook element template">template</a>?, <a href="inherit.html" title=" |
---|
39 | BoostBook element inherit">inherit</a>*, <a href="purpose.html" title=" |
---|
40 | BoostBook element purpose">purpose</a>?, <a href="description.html" title=" |
---|
41 | BoostBook element description">description</a>?, (<a href="static-constant.html" title=" |
---|
42 | BoostBook element static-constant">static-constant</a>| <a href="typedef.html" title=" |
---|
43 | BoostBook element typedef">typedef</a>| <a href="enum.html" title=" |
---|
44 | BoostBook element enum">enum</a>| <a href="copy-assignment.html" title=" |
---|
45 | BoostBook element copy-assignment">copy-assignment</a>| <a href="constructor.html" title=" |
---|
46 | BoostBook element constructor">constructor</a>| <a href="destructor.html" title=" |
---|
47 | BoostBook element destructor">destructor</a>| <a href="method-group.html" title=" |
---|
48 | BoostBook element method-group">method-group</a>| <a href="free-function-group.html" title=" |
---|
49 | BoostBook element free-function-group">free-function-group</a>| <a href="function.html" title=" |
---|
50 | BoostBook element function">function</a>| <a href="method.html" title=" |
---|
51 | BoostBook element method">method</a>| <a href="overloaded-function.html" title=" |
---|
52 | BoostBook element overloaded-function">overloaded-function</a>| <a href="overloaded-method.html" title=" |
---|
53 | BoostBook element overloaded-method">overloaded-method</a>| <a href="data-member.html" title=" |
---|
54 | BoostBook element data-member">data-member</a>| <a href="class.html" title=" |
---|
55 | BoostBook element class">class</a>| <a href="class-specialization.html" title=" |
---|
56 | BoostBook element class-specialization">class-specialization</a>| <a href="struct.html" title=" |
---|
57 | BoostBook element struct">struct</a>| <a href="struct-specialization.html" title=" |
---|
58 | BoostBook element struct-specialization">struct-specialization</a>| <a href="union.html" title=" |
---|
59 | BoostBook element union">union</a>| <a href="union-specialization.html" title=" |
---|
60 | BoostBook element union-specialization">union-specialization</a>)*) |
---|
61 | </div> |
---|
62 | <div class="refsection" lang="en"> |
---|
63 | <a name="id2082874"></a><h2>Description</h2> |
---|
64 | <p>C++ classes and class templates are described via the |
---|
65 | <class> element. Each class has a name (e.g., "any") given by |
---|
66 | the <code class="computeroutput">name</code> attribute, a purpose given by the |
---|
67 | <purpose> element, documentation, and a set of types, |
---|
68 | functions, base classes, and data members. Here is a minimal |
---|
69 | definition of the <code class="computeroutput"><a href="../../boost/any.html" title="Class any">boost::any</a></code> class:</p> |
---|
70 | |
---|
71 | <pre class="programlisting"><namespace name="boost"> |
---|
72 | <class name="any"> |
---|
73 | <purpose> |
---|
74 | A class whose instances can hold instances of any type that satisfies |
---|
75 | ValueType requirements. |
---|
76 | </purpose> |
---|
77 | </class> |
---|
78 | </namespace></pre> |
---|
79 | |
---|
80 | <p>Additional class documentation can be contained in a |
---|
81 | <code class="sgmltag-element">description</code> element following the <purpose> |
---|
82 | element. This documentation will be typeset prior to documentation |
---|
83 | for specific elements in the class (e.g., constructors or |
---|
84 | methods).</p> |
---|
85 | |
---|
86 | <p>Class inheritance is described via the <inherit> |
---|
87 | element. The <inherit> element requires an <code class="computeroutput">access</code> |
---|
88 | attribute which must be one of <span class="emphasis"><em>public</em></span>, |
---|
89 | <span class="emphasis"><em>protected</em></span>, or <span class="emphasis"><em>private</em></span>. The |
---|
90 | content of the <inherited> element in C++ code that names the |
---|
91 | class inherited, and may contain markup to link to the class. The |
---|
92 | following description of the class |
---|
93 | <code class="computeroutput"><a href="../../boost/bad_any_cast.html" title="Class bad_any_cast">boost::bad_any_cast</a></code> describes public |
---|
94 | inheritance from the class <code class="computeroutput">std::bad_cast</code>. It |
---|
95 | also defines the <purpose> element, which contains a short |
---|
96 | description of the use of the class.</p> |
---|
97 | |
---|
98 | <pre class="programlisting"><class name="bad_any_cast"> |
---|
99 | <inherit access="public"><classname>std::bad_cast</classname></inherit> |
---|
100 | <purpose><para>The exception thrown in the event of a failed |
---|
101 | <functionname>any_cast</functionname> of an |
---|
102 | <classname>any</classname> value.</para></purpose> |
---|
103 | </class></pre> |
---|
104 | |
---|
105 | <p>Class templates are defined by <class> elements with a |
---|
106 | <template> child element at the beginning.</p> |
---|
107 | </div> |
---|
108 | <div class="refsection" lang="en"> |
---|
109 | <a name="id2083010"></a> |
---|
110 | <h2>Attributes</h2> |
---|
111 | <div class="informaltable"><table class="table"> |
---|
112 | <colgroup> |
---|
113 | <col> |
---|
114 | <col> |
---|
115 | <col> |
---|
116 | <col> |
---|
117 | </colgroup> |
---|
118 | <thead><tr> |
---|
119 | <th>Name</th> |
---|
120 | <th>Type</th> |
---|
121 | <th>Value</th> |
---|
122 | <th>Purpose</th> |
---|
123 | </tr></thead> |
---|
124 | <tbody> |
---|
125 | <tr> |
---|
126 | <td>last-revision</td> |
---|
127 | <td>#IMPLIED</td> |
---|
128 | <td>CDATA</td> |
---|
129 | <td>Set to $Date: 2006/11/03 19:39:44 $ to keep "last revised" information in sync with CVS changes</td> |
---|
130 | </tr> |
---|
131 | <tr> |
---|
132 | <td>name</td> |
---|
133 | <td>#REQUIRED</td> |
---|
134 | <td>CDATA</td> |
---|
135 | <td>The name of the element being declared to referenced</td> |
---|
136 | </tr> |
---|
137 | <tr> |
---|
138 | <td>id</td> |
---|
139 | <td>#IMPLIED</td> |
---|
140 | <td>CDATA</td> |
---|
141 | <td>A global identifier for this element</td> |
---|
142 | </tr> |
---|
143 | <tr> |
---|
144 | <td>xml:base</td> |
---|
145 | <td>#IMPLIED</td> |
---|
146 | <td>CDATA</td> |
---|
147 | <td>Implementation detail used by XIncludes</td> |
---|
148 | </tr> |
---|
149 | </tbody> |
---|
150 | </table></div> |
---|
151 | </div> |
---|
152 | </div> |
---|
153 | <table width="100%"><tr> |
---|
154 | <td align="left"></td> |
---|
155 | <td align="right"><small>Copyright © 2003-2005 Douglas Gregor</small></td> |
---|
156 | </tr></table> |
---|
157 | <hr> |
---|
158 | <div class="spirit-nav"> |
---|
159 | <a accesskey="p" href="overloaded-function.html"><img src="../../images/prev.png" alt="Prev"></a><a accesskey="u" href="../../reference.html"><img src="../../images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../images/home.png" alt="Home"></a><a accesskey="n" href="librarycategorydef.html"><img src="../../images/next.png" alt="Next"></a> |
---|
160 | </div> |
---|
161 | </body> |
---|
162 | </html> |
---|