73 | | <h1>bdm::shared_ptr< T > Class Template Reference</h1><!-- doxytag: class="bdm::shared_ptr" --> |
74 | | <p>A naive implementation of roughly a subset of the std::tr1::shared_ptr spec. |
75 | | <a href="#_details">More...</a></p> |
76 | | <hr/><a name="_details"></a><h2>Detailed Description</h2> |
77 | | <h3>template<typename T><br/> |
| 70 | <h1>bdm::shared_ptr< T > Class Template Reference</h1><!-- doxytag: class="bdm::shared_ptr" -->A naive implementation of roughly a subset of the std::tr1::shared_ptr spec. |
| 71 | <a href="#_details">More...</a> |
| 72 | <p> |
| 73 | <code>#include <<a class="el" href="shared__ptr_8h_source.html">shared_ptr.h</a>></code> |
| 74 | <p> |
| 75 | |
| 76 | <p> |
| 77 | <a href="classbdm_1_1shared__ptr-members.html">List of all members.</a><table border="0" cellpadding="0" cellspacing="0"> |
| 78 | <tr><td></td></tr> |
| 79 | <tr><td colspan="2"><br><h2>Public Member Functions</h2></td></tr> |
| 80 | <tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classbdm_1_1shared__ptr.html#66a4d41031e37618f1a9bb3c81814c11">shared_ptr</a> ()</td></tr> |
| 81 | |
| 82 | <tr><td class="mdescLeft"> </td><td class="mdescRight">Default constructor. <a href="#66a4d41031e37618f1a9bb3c81814c11"></a><br></td></tr> |
| 83 | <tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classbdm_1_1shared__ptr.html#c8b7f0a813173581530c80d7ac4fc7c2">shared_ptr</a> (T *p)</td></tr> |
| 84 | |
| 85 | <tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classbdm_1_1shared__ptr.html#357702d12bfd608a08b46e4a194aa4b5">shared_ptr</a> (const <a class="el" href="classbdm_1_1shared__ptr.html">shared_ptr</a>< T > &other)</td></tr> |
| 86 | |
| 87 | <tr><td class="mdescLeft"> </td><td class="mdescRight">Copy constructor. <a href="#357702d12bfd608a08b46e4a194aa4b5"></a><br></td></tr> |
| 88 | <tr><td class="memTemplParams" nowrap colspan="2">template<typename U > </td></tr> |
| 89 | <tr><td class="memTemplItemLeft" nowrap align="right" valign="top"> </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classbdm_1_1shared__ptr.html#affa5b17385493f4102c52cf75d3b509">shared_ptr</a> (const <a class="el" href="classbdm_1_1shared__ptr.html">shared_ptr</a>< U > &other)</td></tr> |
| 90 | |
| 91 | <tr><td class="mdescLeft"> </td><td class="mdescRight">Generalized copy. <a href="#affa5b17385493f4102c52cf75d3b509"></a><br></td></tr> |
| 92 | <tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classbdm_1_1shared__ptr.html#79374842e417d2f64e449e374be4cfc1">~shared_ptr</a> ()</td></tr> |
| 93 | |
| 94 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="55263b1c8efbd3f8fddf703e2c457f6c"></a><!-- doxytag: member="bdm::shared_ptr::operator=" ref="55263b1c8efbd3f8fddf703e2c457f6c" args="(const shared_ptr< T > &other)" --> |
| 95 | <a class="el" href="classbdm_1_1shared__ptr.html">shared_ptr</a>< T > & </td><td class="memItemRight" valign="bottom"><a class="el" href="classbdm_1_1shared__ptr.html#55263b1c8efbd3f8fddf703e2c457f6c">operator=</a> (const <a class="el" href="classbdm_1_1shared__ptr.html">shared_ptr</a>< T > &other)</td></tr> |
| 96 | |
| 97 | <tr><td class="mdescLeft"> </td><td class="mdescRight">Assignment operator. <br></td></tr> |
| 98 | <tr><td class="memItemLeft" nowrap align="right" valign="top">T * </td><td class="memItemRight" valign="bottom"><a class="el" href="classbdm_1_1shared__ptr.html#37ebcfb6750dd7b5630f1d2354c07a96">get</a> ()</td></tr> |
| 99 | |
| 100 | <tr><td class="memItemLeft" nowrap align="right" valign="top">T * </td><td class="memItemRight" valign="bottom"><a class="el" href="classbdm_1_1shared__ptr.html#bcaae812868eacbad050beda465d2327">operator-></a> ()</td></tr> |
| 101 | |
| 102 | <tr><td class="memItemLeft" nowrap align="right" valign="top">T & </td><td class="memItemRight" valign="bottom"><a class="el" href="classbdm_1_1shared__ptr.html#de38de837267becf5eed2839fea42c45">operator*</a> ()</td></tr> |
| 103 | |
| 104 | <tr><td class="memItemLeft" nowrap align="right" valign="top">const T * </td><td class="memItemRight" valign="bottom"><a class="el" href="classbdm_1_1shared__ptr.html#fff45e4841b2921cd42ce0691f8c1196">get</a> () const </td></tr> |
| 105 | |
| 106 | <tr><td class="memItemLeft" nowrap align="right" valign="top">const T * </td><td class="memItemRight" valign="bottom"><a class="el" href="classbdm_1_1shared__ptr.html#d89ec7ceb318241d833c7d278444396d">operator-></a> () const </td></tr> |
| 107 | |
| 108 | <tr><td class="memItemLeft" nowrap align="right" valign="top">const T & </td><td class="memItemRight" valign="bottom"><a class="el" href="classbdm_1_1shared__ptr.html#de000a72fe73804aa26962432f264800">operator*</a> () const </td></tr> |
| 109 | |
| 110 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="338dbc6aa9fd95175abdc2df3ae2c284"></a><!-- doxytag: member="bdm::shared_ptr::unique" ref="338dbc6aa9fd95175abdc2df3ae2c284" args="() const " --> |
| 111 | bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classbdm_1_1shared__ptr.html#338dbc6aa9fd95175abdc2df3ae2c284">unique</a> () const </td></tr> |
| 112 | |
| 113 | <tr><td class="mdescLeft"> </td><td class="mdescRight">Returns <a class="el" href="classbdm_1_1shared__ptr.html#8e52b8887a4408c52b5263a5717343f2">use_count()</a> == 1. <br></td></tr> |
| 114 | <tr><td class="memItemLeft" nowrap align="right" valign="top">long </td><td class="memItemRight" valign="bottom"><a class="el" href="classbdm_1_1shared__ptr.html#8e52b8887a4408c52b5263a5717343f2">use_count</a> () const </td></tr> |
| 115 | |
| 116 | <tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classbdm_1_1shared__ptr.html#6cac71bb600f9f7c6fbed9335fd22d37">operator bool</a> () const </td></tr> |
| 117 | |
| 118 | <tr><td class="mdescLeft"> </td><td class="mdescRight">Boolean cast. <a href="#6cac71bb600f9f7c6fbed9335fd22d37"></a><br></td></tr> |
| 119 | <tr><td class="memTemplParams" nowrap colspan="2">template<typename U > </td></tr> |
| 120 | <tr><td class="memTemplItemLeft" nowrap align="right" valign="top"> </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classbdm_1_1shared__ptr.html#b3cd369b00369ab92456aa0645e8d560">operator shared_ptr< const U ></a> () const </td></tr> |
| 121 | |
| 122 | <tr><td class="mdescLeft"> </td><td class="mdescRight">const cast <a href="#b3cd369b00369ab92456aa0645e8d560"></a><br></td></tr> |
| 123 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="fca7fd588f8de50e7590357305b00984"></a><!-- doxytag: member="bdm::shared_ptr::swap" ref="fca7fd588f8de50e7590357305b00984" args="(shared_ptr &other)" --> |
| 124 | void </td><td class="memItemRight" valign="bottom"><a class="el" href="classbdm_1_1shared__ptr.html#fca7fd588f8de50e7590357305b00984">swap</a> (<a class="el" href="classbdm_1_1shared__ptr.html">shared_ptr</a> &other)</td></tr> |
| 125 | |
| 126 | <tr><td class="mdescLeft"> </td><td class="mdescRight">Efficient swap for <a class="el" href="classbdm_1_1shared__ptr.html" title="A naive implementation of roughly a subset of the std::tr1::shared_ptr spec.">shared_ptr</a>. <br></td></tr> |
| 127 | <tr><td colspan="2"><br><h2>Friends</h2></td></tr> |
| 128 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="9a4da829475f0cf1809fc6ef555ffe06"></a><!-- doxytag: member="bdm::shared_ptr::shared_ptr" ref="9a4da829475f0cf1809fc6ef555ffe06" args="" --> |
| 129 | class </td><td class="memItemRight" valign="bottom"><b>shared_ptr</b></td></tr> |
| 130 | |
| 131 | </table> |
| 132 | <hr><a name="_details"></a><h2>Detailed Description</h2> |
| 133 | <h3>template<typename T><br> |
80 | | <p>A naive implementation of roughly a subset of the std::tr1::shared_ptr spec. </p> |
81 | | <p>Really just roughly - it ignores memory exceptions, for example; also note I didn't read the spec.</p> |
82 | | <p>The standard template would naturally be preferable, <b>if</b> it was included in the standard libraries of all supported compilers - but as of 2009, that's still a problem... </p> |
83 | | |
84 | | <p><code>#include <<a class="el" href="shared__ptr_8h_source.html">shared_ptr.h</a>></code></p> |
85 | | |
86 | | <p><a href="classbdm_1_1shared__ptr-members.html">List of all members.</a></p> |
87 | | <table border="0" cellpadding="0" cellspacing="0"> |
88 | | <tr><td colspan="2"><h2>Public Member Functions</h2></td></tr> |
89 | | <tr><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classbdm_1_1shared__ptr.html#a66a4d41031e37618f1a9bb3c81814c11">shared_ptr</a> ()</td></tr> |
90 | | <tr><td class="mdescLeft"> </td><td class="mdescRight">Default constructor. <a href="#a66a4d41031e37618f1a9bb3c81814c11"></a><br/></td></tr> |
91 | | <tr><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classbdm_1_1shared__ptr.html#ac8b7f0a813173581530c80d7ac4fc7c2">shared_ptr</a> (T *p)</td></tr> |
92 | | <tr><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classbdm_1_1shared__ptr.html#a357702d12bfd608a08b46e4a194aa4b5">shared_ptr</a> (const <a class="el" href="classbdm_1_1shared__ptr.html">shared_ptr</a>< T > &other)</td></tr> |
93 | | <tr><td class="mdescLeft"> </td><td class="mdescRight">Copy constructor. <a href="#a357702d12bfd608a08b46e4a194aa4b5"></a><br/></td></tr> |
94 | | <tr><td class="memTemplParams" colspan="2">template<typename U > </td></tr> |
95 | | <tr><td class="memTemplItemLeft" align="right" valign="top"> </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classbdm_1_1shared__ptr.html#aaffa5b17385493f4102c52cf75d3b509">shared_ptr</a> (const <a class="el" href="classbdm_1_1shared__ptr.html">shared_ptr</a>< U > &other)</td></tr> |
96 | | <tr><td class="mdescLeft"> </td><td class="mdescRight">Generalized copy. <a href="#aaffa5b17385493f4102c52cf75d3b509"></a><br/></td></tr> |
97 | | <tr><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classbdm_1_1shared__ptr.html#a79374842e417d2f64e449e374be4cfc1">~shared_ptr</a> ()</td></tr> |
98 | | <tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a55263b1c8efbd3f8fddf703e2c457f6c"></a><!-- doxytag: member="bdm::shared_ptr::operator=" ref="a55263b1c8efbd3f8fddf703e2c457f6c" args="(const shared_ptr< T > &other)" --> |
99 | | <a class="el" href="classbdm_1_1shared__ptr.html">shared_ptr</a>< T > & </td><td class="memItemRight" valign="bottom"><a class="el" href="classbdm_1_1shared__ptr.html#a55263b1c8efbd3f8fddf703e2c457f6c">operator=</a> (const <a class="el" href="classbdm_1_1shared__ptr.html">shared_ptr</a>< T > &other)</td></tr> |
100 | | <tr><td class="mdescLeft"> </td><td class="mdescRight">Assignment operator. <br/></td></tr> |
101 | | <tr><td class="memItemLeft" align="right" valign="top">T * </td><td class="memItemRight" valign="bottom"><a class="el" href="classbdm_1_1shared__ptr.html#a37ebcfb6750dd7b5630f1d2354c07a96">get</a> ()</td></tr> |
102 | | <tr><td class="memItemLeft" align="right" valign="top">T * </td><td class="memItemRight" valign="bottom"><a class="el" href="classbdm_1_1shared__ptr.html#abcaae812868eacbad050beda465d2327">operator-></a> ()</td></tr> |
103 | | <tr><td class="memItemLeft" align="right" valign="top">T & </td><td class="memItemRight" valign="bottom"><a class="el" href="classbdm_1_1shared__ptr.html#ade38de837267becf5eed2839fea42c45">operator*</a> ()</td></tr> |
104 | | <tr><td class="memItemLeft" align="right" valign="top">const T * </td><td class="memItemRight" valign="bottom"><a class="el" href="classbdm_1_1shared__ptr.html#afff45e4841b2921cd42ce0691f8c1196">get</a> () const </td></tr> |
105 | | <tr><td class="memItemLeft" align="right" valign="top">const T * </td><td class="memItemRight" valign="bottom"><a class="el" href="classbdm_1_1shared__ptr.html#ad89ec7ceb318241d833c7d278444396d">operator-></a> () const </td></tr> |
106 | | <tr><td class="memItemLeft" align="right" valign="top">const T & </td><td class="memItemRight" valign="bottom"><a class="el" href="classbdm_1_1shared__ptr.html#ade000a72fe73804aa26962432f264800">operator*</a> () const </td></tr> |
107 | | <tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a338dbc6aa9fd95175abdc2df3ae2c284"></a><!-- doxytag: member="bdm::shared_ptr::unique" ref="a338dbc6aa9fd95175abdc2df3ae2c284" args="() const " --> |
108 | | bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classbdm_1_1shared__ptr.html#a338dbc6aa9fd95175abdc2df3ae2c284">unique</a> () const </td></tr> |
109 | | <tr><td class="mdescLeft"> </td><td class="mdescRight">Returns <a class="el" href="classbdm_1_1shared__ptr.html#a8e52b8887a4408c52b5263a5717343f2">use_count()</a> == 1. <br/></td></tr> |
110 | | <tr><td class="memItemLeft" align="right" valign="top">long </td><td class="memItemRight" valign="bottom"><a class="el" href="classbdm_1_1shared__ptr.html#a8e52b8887a4408c52b5263a5717343f2">use_count</a> () const </td></tr> |
111 | | <tr><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classbdm_1_1shared__ptr.html#a6cac71bb600f9f7c6fbed9335fd22d37">operator bool</a> () const </td></tr> |
112 | | <tr><td class="mdescLeft"> </td><td class="mdescRight">Boolean cast. <a href="#a6cac71bb600f9f7c6fbed9335fd22d37"></a><br/></td></tr> |
113 | | <tr><td class="memTemplParams" colspan="2">template<typename U > </td></tr> |
114 | | <tr><td class="memTemplItemLeft" align="right" valign="top"> </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classbdm_1_1shared__ptr.html#ab3cd369b00369ab92456aa0645e8d560">operator shared_ptr< const U ></a> () const </td></tr> |
115 | | <tr><td class="mdescLeft"> </td><td class="mdescRight">const cast <a href="#ab3cd369b00369ab92456aa0645e8d560"></a><br/></td></tr> |
116 | | <tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="afca7fd588f8de50e7590357305b00984"></a><!-- doxytag: member="bdm::shared_ptr::swap" ref="afca7fd588f8de50e7590357305b00984" args="(shared_ptr &other)" --> |
117 | | void </td><td class="memItemRight" valign="bottom"><a class="el" href="classbdm_1_1shared__ptr.html#afca7fd588f8de50e7590357305b00984">swap</a> (<a class="el" href="classbdm_1_1shared__ptr.html">shared_ptr</a> &other)</td></tr> |
118 | | <tr><td class="mdescLeft"> </td><td class="mdescRight">Efficient swap for <a class="el" href="classbdm_1_1shared__ptr.html" title="A naive implementation of roughly a subset of the std::tr1::shared_ptr spec.">shared_ptr</a>. <br/></td></tr> |
119 | | <tr><td colspan="2"><h2>Friends</h2></td></tr> |
120 | | <tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a9a4da829475f0cf1809fc6ef555ffe06"></a><!-- doxytag: member="bdm::shared_ptr::shared_ptr" ref="a9a4da829475f0cf1809fc6ef555ffe06" args="" --> |
121 | | class </td><td class="memItemRight" valign="bottom"><b>shared_ptr</b></td></tr> |
122 | | </table> |
123 | | <hr/><h2>Constructor & Destructor Documentation</h2> |
124 | | <a class="anchor" id="a66a4d41031e37618f1a9bb3c81814c11"></a><!-- doxytag: member="bdm::shared_ptr::shared_ptr" ref="a66a4d41031e37618f1a9bb3c81814c11" args="()" --> |
125 | | <div class="memitem"> |
126 | | <div class="memproto"> |
127 | | <div class="memtemplate"> |
128 | | template<typename T> </div> |
129 | | <table class="memname"> |
130 | | <tr> |
131 | | <td class="memname"><a class="el" href="classbdm_1_1shared__ptr.html">bdm::shared_ptr</a>< T >::<a class="el" href="classbdm_1_1shared__ptr.html">shared_ptr</a> </td> |
132 | | <td>(</td> |
133 | | <td class="paramname"></td> |
134 | | <td> ) </td> |
135 | | <td><code> [inline]</code></td> |
136 | | </tr> |
137 | | </table> |
138 | | </div> |
139 | | <div class="memdoc"> |
140 | | |
141 | | <p>Default constructor. </p> |
142 | | <p>Creates an empty <a class="el" href="classbdm_1_1shared__ptr.html" title="A naive implementation of roughly a subset of the std::tr1::shared_ptr spec.">shared_ptr</a> - one that doesn't point anywhere. </p> |
143 | | |
144 | | </div> |
145 | | </div> |
146 | | <a class="anchor" id="ac8b7f0a813173581530c80d7ac4fc7c2"></a><!-- doxytag: member="bdm::shared_ptr::shared_ptr" ref="ac8b7f0a813173581530c80d7ac4fc7c2" args="(T *p)" --> |
147 | | <div class="memitem"> |
148 | | <div class="memproto"> |
149 | | <div class="memtemplate"> |
150 | | template<typename T> </div> |
151 | | <table class="memname"> |
152 | | <tr> |
153 | | <td class="memname"><a class="el" href="classbdm_1_1shared__ptr.html">bdm::shared_ptr</a>< T >::<a class="el" href="classbdm_1_1shared__ptr.html">shared_ptr</a> </td> |
| 136 | A naive implementation of roughly a subset of the std::tr1::shared_ptr spec. |
| 137 | <p> |
| 138 | Really just roughly - it ignores memory exceptions, for example; also note I didn't read the spec.<p> |
| 139 | The standard template would naturally be preferable, <b>if</b> it was included in the standard libraries of all supported compilers - but as of 2009, that's still a problem... <hr><h2>Constructor & Destructor Documentation</h2> |
| 140 | <a class="anchor" name="66a4d41031e37618f1a9bb3c81814c11"></a><!-- doxytag: member="bdm::shared_ptr::shared_ptr" ref="66a4d41031e37618f1a9bb3c81814c11" args="()" --> |
| 141 | <div class="memitem"> |
| 142 | <div class="memproto"> |
| 143 | <div class="memtemplate"> |
| 144 | template<typename T> </div> |
| 145 | <table class="memname"> |
| 146 | <tr> |
| 147 | <td class="memname"><a class="el" href="classbdm_1_1shared__ptr.html">bdm::shared_ptr</a>< T >::<a class="el" href="classbdm_1_1shared__ptr.html">shared_ptr</a> </td> |
| 148 | <td>(</td> |
| 149 | <td class="paramname"> </td> |
| 150 | <td> ) </td> |
| 151 | <td><code> [inline]</code></td> |
| 152 | </tr> |
| 153 | </table> |
| 154 | </div> |
| 155 | <div class="memdoc"> |
| 156 | |
| 157 | <p> |
| 158 | Default constructor. |
| 159 | <p> |
| 160 | Creates an empty <a class="el" href="classbdm_1_1shared__ptr.html" title="A naive implementation of roughly a subset of the std::tr1::shared_ptr spec.">shared_ptr</a> - one that doesn't point anywhere. |
| 161 | </div> |
| 162 | </div><p> |
| 163 | <a class="anchor" name="c8b7f0a813173581530c80d7ac4fc7c2"></a><!-- doxytag: member="bdm::shared_ptr::shared_ptr" ref="c8b7f0a813173581530c80d7ac4fc7c2" args="(T *p)" --> |
| 164 | <div class="memitem"> |
| 165 | <div class="memproto"> |
| 166 | <div class="memtemplate"> |
| 167 | template<typename T> </div> |
| 168 | <table class="memname"> |
| 169 | <tr> |
| 170 | <td class="memname"><a class="el" href="classbdm_1_1shared__ptr.html">bdm::shared_ptr</a>< T >::<a class="el" href="classbdm_1_1shared__ptr.html">shared_ptr</a> </td> |
202 | | <td class="paramname"> <em>other</em></td> |
203 | | <td> ) </td> |
204 | | <td><code> [inline]</code></td> |
205 | | </tr> |
206 | | </table> |
207 | | </div> |
208 | | <div class="memdoc"> |
209 | | |
210 | | <p>Generalized copy. </p> |
211 | | <p>Allows initialization of shared pointer of a base type from raw pointer to a derived type.</p> |
212 | | <p>If other is empty, constructs an empty <a class="el" href="classbdm_1_1shared__ptr.html" title="A naive implementation of roughly a subset of the std::tr1::shared_ptr spec.">shared_ptr</a>; otherwise, constructs a <a class="el" href="classbdm_1_1shared__ptr.html" title="A naive implementation of roughly a subset of the std::tr1::shared_ptr spec.">shared_ptr</a> that shares ownership with other. </p> |
213 | | |
214 | | </div> |
215 | | </div> |
216 | | <a class="anchor" id="a79374842e417d2f64e449e374be4cfc1"></a><!-- doxytag: member="bdm::shared_ptr::~shared_ptr" ref="a79374842e417d2f64e449e374be4cfc1" args="()" --> |
217 | | <div class="memitem"> |
218 | | <div class="memproto"> |
219 | | <div class="memtemplate"> |
220 | | template<typename T> </div> |
221 | | <table class="memname"> |
222 | | <tr> |
223 | | <td class="memname"><a class="el" href="classbdm_1_1shared__ptr.html">bdm::shared_ptr</a>< T >::~<a class="el" href="classbdm_1_1shared__ptr.html">shared_ptr</a> </td> |
224 | | <td>(</td> |
225 | | <td class="paramname"></td> |
226 | | <td> ) </td> |
227 | | <td><code> [inline]</code></td> |
228 | | </tr> |
229 | | </table> |
230 | | </div> |
231 | | <div class="memdoc"> |
232 | | <p>Destructor. </p> |
233 | | |
234 | | </div> |
235 | | </div> |
236 | | <hr/><h2>Member Function Documentation</h2> |
237 | | <a class="anchor" id="afff45e4841b2921cd42ce0691f8c1196"></a><!-- doxytag: member="bdm::shared_ptr::get" ref="afff45e4841b2921cd42ce0691f8c1196" args="() const " --> |
238 | | <div class="memitem"> |
239 | | <div class="memproto"> |
240 | | <div class="memtemplate"> |
241 | | template<typename T> </div> |
242 | | <table class="memname"> |
243 | | <tr> |
244 | | <td class="memname">const T* <a class="el" href="classbdm_1_1shared__ptr.html">bdm::shared_ptr</a>< T >::get </td> |
245 | | <td>(</td> |
246 | | <td class="paramname"></td> |
247 | | <td> ) </td> |
248 | | <td> const<code> [inline]</code></td> |
249 | | </tr> |
250 | | </table> |
251 | | </div> |
252 | | <div class="memdoc"> |
253 | | <p>Returns the stored pointer (which remains owned by this instance). For empty instances, this method returns NULL. </p> |
254 | | |
255 | | </div> |
256 | | </div> |
257 | | <a class="anchor" id="a37ebcfb6750dd7b5630f1d2354c07a96"></a><!-- doxytag: member="bdm::shared_ptr::get" ref="a37ebcfb6750dd7b5630f1d2354c07a96" args="()" --> |
258 | | <div class="memitem"> |
259 | | <div class="memproto"> |
260 | | <div class="memtemplate"> |
261 | | template<typename T> </div> |
262 | | <table class="memname"> |
263 | | <tr> |
264 | | <td class="memname">T* <a class="el" href="classbdm_1_1shared__ptr.html">bdm::shared_ptr</a>< T >::get </td> |
265 | | <td>(</td> |
266 | | <td class="paramname"></td> |
267 | | <td> ) </td> |
268 | | <td><code> [inline]</code></td> |
269 | | </tr> |
270 | | </table> |
271 | | </div> |
272 | | <div class="memdoc"> |
273 | | <p>Returns the stored pointer (which remains owned by this instance). For empty instances, this method returns NULL. </p> |
274 | | |
| 221 | <td class="paramname"> <em>other</em> </td> |
| 222 | <td> ) </td> |
| 223 | <td><code> [inline]</code></td> |
| 224 | </tr> |
| 225 | </table> |
| 226 | </div> |
| 227 | <div class="memdoc"> |
| 228 | |
| 229 | <p> |
| 230 | Generalized copy. |
| 231 | <p> |
| 232 | Allows initialization of shared pointer of a base type from raw pointer to a derived type.<p> |
| 233 | If other is empty, constructs an empty <a class="el" href="classbdm_1_1shared__ptr.html" title="A naive implementation of roughly a subset of the std::tr1::shared_ptr spec.">shared_ptr</a>; otherwise, constructs a <a class="el" href="classbdm_1_1shared__ptr.html" title="A naive implementation of roughly a subset of the std::tr1::shared_ptr spec.">shared_ptr</a> that shares ownership with other. |
| 234 | </div> |
| 235 | </div><p> |
| 236 | <a class="anchor" name="79374842e417d2f64e449e374be4cfc1"></a><!-- doxytag: member="bdm::shared_ptr::~shared_ptr" ref="79374842e417d2f64e449e374be4cfc1" args="()" --> |
| 237 | <div class="memitem"> |
| 238 | <div class="memproto"> |
| 239 | <div class="memtemplate"> |
| 240 | template<typename T> </div> |
| 241 | <table class="memname"> |
| 242 | <tr> |
| 243 | <td class="memname"><a class="el" href="classbdm_1_1shared__ptr.html">bdm::shared_ptr</a>< T >::~<a class="el" href="classbdm_1_1shared__ptr.html">shared_ptr</a> </td> |
| 244 | <td>(</td> |
| 245 | <td class="paramname"> </td> |
| 246 | <td> ) </td> |
| 247 | <td><code> [inline]</code></td> |
| 248 | </tr> |
| 249 | </table> |
| 250 | </div> |
| 251 | <div class="memdoc"> |
| 252 | |
| 253 | <p> |
| 254 | Destructor. |
| 255 | </div> |
| 256 | </div><p> |
| 257 | <hr><h2>Member Function Documentation</h2> |
| 258 | <a class="anchor" name="fff45e4841b2921cd42ce0691f8c1196"></a><!-- doxytag: member="bdm::shared_ptr::get" ref="fff45e4841b2921cd42ce0691f8c1196" args="() const " --> |
| 259 | <div class="memitem"> |
| 260 | <div class="memproto"> |
| 261 | <div class="memtemplate"> |
| 262 | template<typename T> </div> |
| 263 | <table class="memname"> |
| 264 | <tr> |
| 265 | <td class="memname">const T* <a class="el" href="classbdm_1_1shared__ptr.html">bdm::shared_ptr</a>< T >::get </td> |
| 266 | <td>(</td> |
| 267 | <td class="paramname"> </td> |
| 268 | <td> ) </td> |
| 269 | <td> const<code> [inline]</code></td> |
| 270 | </tr> |
| 271 | </table> |
| 272 | </div> |
| 273 | <div class="memdoc"> |
| 274 | |
| 275 | <p> |
| 276 | Returns the stored pointer (which remains owned by this instance). For empty instances, this method returns NULL. |
| 277 | </div> |
| 278 | </div><p> |
| 279 | <a class="anchor" name="37ebcfb6750dd7b5630f1d2354c07a96"></a><!-- doxytag: member="bdm::shared_ptr::get" ref="37ebcfb6750dd7b5630f1d2354c07a96" args="()" --> |
| 280 | <div class="memitem"> |
| 281 | <div class="memproto"> |
| 282 | <div class="memtemplate"> |
| 283 | template<typename T> </div> |
| 284 | <table class="memname"> |
| 285 | <tr> |
| 286 | <td class="memname">T* <a class="el" href="classbdm_1_1shared__ptr.html">bdm::shared_ptr</a>< T >::get </td> |
| 287 | <td>(</td> |
| 288 | <td class="paramname"> </td> |
| 289 | <td> ) </td> |
| 290 | <td><code> [inline]</code></td> |
| 291 | </tr> |
| 292 | </table> |
| 293 | </div> |
| 294 | <div class="memdoc"> |
| 295 | |
| 296 | <p> |
| 297 | Returns the stored pointer (which remains owned by this instance). For empty instances, this method returns NULL. |
310 | | <td class="memname"><a class="el" href="classbdm_1_1shared__ptr.html">bdm::shared_ptr</a>< T >::operator <a class="el" href="classbdm_1_1shared__ptr.html">shared_ptr</a>< const U > </td> |
311 | | <td>(</td> |
312 | | <td class="paramname"></td> |
313 | | <td> ) </td> |
314 | | <td> const<code> [inline]</code></td> |
315 | | </tr> |
316 | | </table> |
317 | | </div> |
318 | | <div class="memdoc"> |
319 | | |
320 | | <p>const cast </p> |
321 | | <p>Shared pointer to T can be converted to shared pointer to const T, just like T * can be converted to T const *. </p> |
322 | | |
323 | | </div> |
324 | | </div> |
325 | | <a class="anchor" id="ade000a72fe73804aa26962432f264800"></a><!-- doxytag: member="bdm::shared_ptr::operator*" ref="ade000a72fe73804aa26962432f264800" args="() const " --> |
326 | | <div class="memitem"> |
327 | | <div class="memproto"> |
328 | | <div class="memtemplate"> |
329 | | template<typename T> </div> |
330 | | <table class="memname"> |
331 | | <tr> |
332 | | <td class="memname">const T& <a class="el" href="classbdm_1_1shared__ptr.html">bdm::shared_ptr</a>< T >::operator* </td> |
333 | | <td>(</td> |
334 | | <td class="paramname"></td> |
335 | | <td> ) </td> |
336 | | <td> const<code> [inline]</code></td> |
337 | | </tr> |
338 | | </table> |
339 | | </div> |
340 | | <div class="memdoc"> |
341 | | <p>Returns a reference to the object pointed to by the stored pointer. This method may only be called when the stored pointer isn't NULL. </p> |
342 | | |
343 | | </div> |
344 | | </div> |
345 | | <a class="anchor" id="ade38de837267becf5eed2839fea42c45"></a><!-- doxytag: member="bdm::shared_ptr::operator*" ref="ade38de837267becf5eed2839fea42c45" args="()" --> |
346 | | <div class="memitem"> |
347 | | <div class="memproto"> |
348 | | <div class="memtemplate"> |
349 | | template<typename T> </div> |
350 | | <table class="memname"> |
351 | | <tr> |
352 | | <td class="memname">T& <a class="el" href="classbdm_1_1shared__ptr.html">bdm::shared_ptr</a>< T >::operator* </td> |
353 | | <td>(</td> |
354 | | <td class="paramname"></td> |
355 | | <td> ) </td> |
356 | | <td><code> [inline]</code></td> |
357 | | </tr> |
358 | | </table> |
359 | | </div> |
360 | | <div class="memdoc"> |
361 | | <p>Returns a reference to the object pointed to by the stored pointer. This method may only be called when the stored pointer isn't NULL. </p> |
362 | | |
363 | | </div> |
364 | | </div> |
365 | | <a class="anchor" id="ad89ec7ceb318241d833c7d278444396d"></a><!-- doxytag: member="bdm::shared_ptr::operator->" ref="ad89ec7ceb318241d833c7d278444396d" args="() const " --> |
366 | | <div class="memitem"> |
367 | | <div class="memproto"> |
368 | | <div class="memtemplate"> |
369 | | template<typename T> </div> |
370 | | <table class="memname"> |
371 | | <tr> |
372 | | <td class="memname">const T* <a class="el" href="classbdm_1_1shared__ptr.html">bdm::shared_ptr</a>< T >::operator-> </td> |
373 | | <td>(</td> |
374 | | <td class="paramname"></td> |
375 | | <td> ) </td> |
376 | | <td> const<code> [inline]</code></td> |
377 | | </tr> |
378 | | </table> |
379 | | </div> |
380 | | <div class="memdoc"> |
381 | | <p>Returns the stored pointer (which remains owned by this instance). This method may only be called when the stored pointer isn't NULL. </p> |
382 | | |
383 | | </div> |
384 | | </div> |
385 | | <a class="anchor" id="abcaae812868eacbad050beda465d2327"></a><!-- doxytag: member="bdm::shared_ptr::operator->" ref="abcaae812868eacbad050beda465d2327" args="()" --> |
386 | | <div class="memitem"> |
387 | | <div class="memproto"> |
388 | | <div class="memtemplate"> |
389 | | template<typename T> </div> |
390 | | <table class="memname"> |
391 | | <tr> |
392 | | <td class="memname">T* <a class="el" href="classbdm_1_1shared__ptr.html">bdm::shared_ptr</a>< T >::operator-> </td> |
393 | | <td>(</td> |
394 | | <td class="paramname"></td> |
395 | | <td> ) </td> |
396 | | <td><code> [inline]</code></td> |
397 | | </tr> |
398 | | </table> |
399 | | </div> |
400 | | <div class="memdoc"> |
401 | | <p>Dereferences the stored pointer (which remains owned by this instance). This method may only be called when the stored pointer isn't NULL. </p> |
402 | | |
403 | | </div> |
404 | | </div> |
405 | | <a class="anchor" id="a8e52b8887a4408c52b5263a5717343f2"></a><!-- doxytag: member="bdm::shared_ptr::use_count" ref="a8e52b8887a4408c52b5263a5717343f2" args="() const " --> |
406 | | <div class="memitem"> |
407 | | <div class="memproto"> |
408 | | <div class="memtemplate"> |
409 | | template<typename T> </div> |
410 | | <table class="memname"> |
411 | | <tr> |
412 | | <td class="memname">long <a class="el" href="classbdm_1_1shared__ptr.html">bdm::shared_ptr</a>< T >::use_count </td> |
413 | | <td>(</td> |
414 | | <td class="paramname"></td> |
415 | | <td> ) </td> |
416 | | <td> const<code> [inline]</code></td> |
417 | | </tr> |
418 | | </table> |
419 | | </div> |
420 | | <div class="memdoc"> |
421 | | <p>Returns the number of <a class="el" href="classbdm_1_1shared__ptr.html" title="A naive implementation of roughly a subset of the std::tr1::shared_ptr spec.">shared_ptr</a> instances (including this instance) that share ownership with this instance. For empty instances, this method returns 0. </p> |
422 | | |
423 | | </div> |
424 | | </div> |
425 | | <hr/>The documentation for this class was generated from the following file:<ul> |
426 | | <li><a class="el" href="shared__ptr_8h_source.html">shared_ptr.h</a></li> |
427 | | </ul> |
428 | | </div> |
429 | | <hr size="1"/><address style="text-align: right;"><small>Generated on Sun Sep 27 00:49:06 2009 for mixpp by |
| 334 | <td class="memname"><a class="el" href="classbdm_1_1shared__ptr.html">bdm::shared_ptr</a>< T >::operator <a class="el" href="classbdm_1_1shared__ptr.html">shared_ptr</a>< const U > </td> |
| 335 | <td>(</td> |
| 336 | <td class="paramname"> </td> |
| 337 | <td> ) </td> |
| 338 | <td> const<code> [inline]</code></td> |
| 339 | </tr> |
| 340 | </table> |
| 341 | </div> |
| 342 | <div class="memdoc"> |
| 343 | |
| 344 | <p> |
| 345 | const cast |
| 346 | <p> |
| 347 | Shared pointer to T can be converted to shared pointer to const T, just like T * can be converted to T const *. |
| 348 | </div> |
| 349 | </div><p> |
| 350 | <a class="anchor" name="de000a72fe73804aa26962432f264800"></a><!-- doxytag: member="bdm::shared_ptr::operator*" ref="de000a72fe73804aa26962432f264800" args="() const " --> |
| 351 | <div class="memitem"> |
| 352 | <div class="memproto"> |
| 353 | <div class="memtemplate"> |
| 354 | template<typename T> </div> |
| 355 | <table class="memname"> |
| 356 | <tr> |
| 357 | <td class="memname">const T& <a class="el" href="classbdm_1_1shared__ptr.html">bdm::shared_ptr</a>< T >::operator* </td> |
| 358 | <td>(</td> |
| 359 | <td class="paramname"> </td> |
| 360 | <td> ) </td> |
| 361 | <td> const<code> [inline]</code></td> |
| 362 | </tr> |
| 363 | </table> |
| 364 | </div> |
| 365 | <div class="memdoc"> |
| 366 | |
| 367 | <p> |
| 368 | Returns a reference to the object pointed to by the stored pointer. This method may only be called when the stored pointer isn't NULL. |
| 369 | </div> |
| 370 | </div><p> |
| 371 | <a class="anchor" name="de38de837267becf5eed2839fea42c45"></a><!-- doxytag: member="bdm::shared_ptr::operator*" ref="de38de837267becf5eed2839fea42c45" args="()" --> |
| 372 | <div class="memitem"> |
| 373 | <div class="memproto"> |
| 374 | <div class="memtemplate"> |
| 375 | template<typename T> </div> |
| 376 | <table class="memname"> |
| 377 | <tr> |
| 378 | <td class="memname">T& <a class="el" href="classbdm_1_1shared__ptr.html">bdm::shared_ptr</a>< T >::operator* </td> |
| 379 | <td>(</td> |
| 380 | <td class="paramname"> </td> |
| 381 | <td> ) </td> |
| 382 | <td><code> [inline]</code></td> |
| 383 | </tr> |
| 384 | </table> |
| 385 | </div> |
| 386 | <div class="memdoc"> |
| 387 | |
| 388 | <p> |
| 389 | Returns a reference to the object pointed to by the stored pointer. This method may only be called when the stored pointer isn't NULL. |
| 390 | </div> |
| 391 | </div><p> |
| 392 | <a class="anchor" name="d89ec7ceb318241d833c7d278444396d"></a><!-- doxytag: member="bdm::shared_ptr::operator->" ref="d89ec7ceb318241d833c7d278444396d" args="() const " --> |
| 393 | <div class="memitem"> |
| 394 | <div class="memproto"> |
| 395 | <div class="memtemplate"> |
| 396 | template<typename T> </div> |
| 397 | <table class="memname"> |
| 398 | <tr> |
| 399 | <td class="memname">const T* <a class="el" href="classbdm_1_1shared__ptr.html">bdm::shared_ptr</a>< T >::operator-> </td> |
| 400 | <td>(</td> |
| 401 | <td class="paramname"> </td> |
| 402 | <td> ) </td> |
| 403 | <td> const<code> [inline]</code></td> |
| 404 | </tr> |
| 405 | </table> |
| 406 | </div> |
| 407 | <div class="memdoc"> |
| 408 | |
| 409 | <p> |
| 410 | Returns the stored pointer (which remains owned by this instance). This method may only be called when the stored pointer isn't NULL. |
| 411 | </div> |
| 412 | </div><p> |
| 413 | <a class="anchor" name="bcaae812868eacbad050beda465d2327"></a><!-- doxytag: member="bdm::shared_ptr::operator->" ref="bcaae812868eacbad050beda465d2327" args="()" --> |
| 414 | <div class="memitem"> |
| 415 | <div class="memproto"> |
| 416 | <div class="memtemplate"> |
| 417 | template<typename T> </div> |
| 418 | <table class="memname"> |
| 419 | <tr> |
| 420 | <td class="memname">T* <a class="el" href="classbdm_1_1shared__ptr.html">bdm::shared_ptr</a>< T >::operator-> </td> |
| 421 | <td>(</td> |
| 422 | <td class="paramname"> </td> |
| 423 | <td> ) </td> |
| 424 | <td><code> [inline]</code></td> |
| 425 | </tr> |
| 426 | </table> |
| 427 | </div> |
| 428 | <div class="memdoc"> |
| 429 | |
| 430 | <p> |
| 431 | Dereferences the stored pointer (which remains owned by this instance). This method may only be called when the stored pointer isn't NULL. |
| 432 | </div> |
| 433 | </div><p> |
| 434 | <a class="anchor" name="8e52b8887a4408c52b5263a5717343f2"></a><!-- doxytag: member="bdm::shared_ptr::use_count" ref="8e52b8887a4408c52b5263a5717343f2" args="() const " --> |
| 435 | <div class="memitem"> |
| 436 | <div class="memproto"> |
| 437 | <div class="memtemplate"> |
| 438 | template<typename T> </div> |
| 439 | <table class="memname"> |
| 440 | <tr> |
| 441 | <td class="memname">long <a class="el" href="classbdm_1_1shared__ptr.html">bdm::shared_ptr</a>< T >::use_count </td> |
| 442 | <td>(</td> |
| 443 | <td class="paramname"> </td> |
| 444 | <td> ) </td> |
| 445 | <td> const<code> [inline]</code></td> |
| 446 | </tr> |
| 447 | </table> |
| 448 | </div> |
| 449 | <div class="memdoc"> |
| 450 | |
| 451 | <p> |
| 452 | Returns the number of <a class="el" href="classbdm_1_1shared__ptr.html" title="A naive implementation of roughly a subset of the std::tr1::shared_ptr spec.">shared_ptr</a> instances (including this instance) that share ownership with this instance. For empty instances, this method returns 0. |
| 453 | </div> |
| 454 | </div><p> |
| 455 | <hr>The documentation for this class was generated from the following file:<ul> |
| 456 | <li><a class="el" href="shared__ptr_8h_source.html">shared_ptr.h</a></ul> |
| 457 | </div> |
| 458 | <hr size="1"><address style="text-align: right;"><small>Generated on Wed Oct 7 17:34:48 2009 for mixpp by |