diff options
Diffstat (limited to 'ACE/contrib/utility/Documentation/ReferenceCounting/StrictPtr.hpp.html')
-rw-r--r-- | ACE/contrib/utility/Documentation/ReferenceCounting/StrictPtr.hpp.html | 107 |
1 files changed, 107 insertions, 0 deletions
diff --git a/ACE/contrib/utility/Documentation/ReferenceCounting/StrictPtr.hpp.html b/ACE/contrib/utility/Documentation/ReferenceCounting/StrictPtr.hpp.html new file mode 100644 index 00000000000..13211b6e3c7 --- /dev/null +++ b/ACE/contrib/utility/Documentation/ReferenceCounting/StrictPtr.hpp.html @@ -0,0 +1,107 @@ +<html> +<head> +<!-- Generated by the Spirit (http://spirit.sf.net) C++ to HTML Converter --> +<title> +StrictPtr.hpp</title> +<link rel="stylesheet" href="../../Documentation/Style/CXX.css" type="text/css"></head> +<body> +<pre> +<span class=comment>// file : Utility/ReferenceCounting/StrictPtr.hpp +// author : Boris Kolpackov <boris@kolpackov.net> +// copyright : Copyright (c) 2002-2003 Boris Kolpackov +// license : http://kolpackov.net/license.html + +</span><span class=keyword>namespace </span><span class=identifier>Utility +</span><span class=special>{ + </span><span class=keyword>namespace </span><span class=identifier>ReferenceCounting + </span><span class=special>{ + </span><span class=keyword>template </span><span class=special><</span><span class=keyword>typename </span><span class=identifier>T</span><span class=special>> + </span><span class=keyword>class </span><span class=identifier>StrictPtr + </span><span class=special>{ + </span><span class=keyword>public</span><span class=special>: + </span><span class=keyword>typedef + </span><span class=identifier>T + </span><span class=identifier>Type</span><span class=special>; + + </span><span class=keyword>class </span><span class=identifier>NotInitialized_ </span><span class=special>{}; + </span><span class=keyword>typedef + </span><span class=identifier>ExH</span><span class=special>::</span><span class=identifier>Compound</span><span class=special><</span><span class=identifier>NotInitialized_</span><span class=special>, </span><span class=identifier>ExH</span><span class=special>::</span><span class=identifier>Logic</span><span class=special>::</span><span class=identifier>DescriptiveException</span><span class=special>> + </span><span class=identifier>NotInitialized</span><span class=special>; + + </span><span class=keyword>public</span><span class=special>: + </span><span class=comment>// c-tor's + + </span><span class=identifier>StrictPtr </span><span class=special>() </span><span class=keyword>throw </span><span class=special>(); + + </span><span class=keyword>explicit + </span><span class=identifier>StrictPtr </span><span class=special>(</span><span class=identifier>Type</span><span class=special>* </span><span class=identifier>ptr</span><span class=special>) </span><span class=keyword>throw </span><span class=special>(); + + </span><span class=identifier>StrictPtr </span><span class=special>(</span><span class=identifier>StrictPtr</span><span class=special><</span><span class=identifier>Type</span><span class=special>> </span><span class=keyword>const</span><span class=special>& </span><span class=identifier>s_ptr</span><span class=special>) + </span><span class=keyword>throw </span><span class=special>(</span><span class=identifier>Interface</span><span class=special>::</span><span class=identifier>Exception</span><span class=special>, </span><span class=identifier>Interface</span><span class=special>::</span><span class=identifier>SystemException</span><span class=special>); + + </span><span class=keyword>template </span><span class=special><</span><span class=keyword>typename </span><span class=identifier>Other</span><span class=special>> + </span><span class=identifier>StrictPtr </span><span class=special>(</span><span class=identifier>StrictPtr</span><span class=special><</span><span class=identifier>Other</span><span class=special>> </span><span class=keyword>const</span><span class=special>& </span><span class=identifier>s_ptr</span><span class=special>) + </span><span class=keyword>throw </span><span class=special>(</span><span class=identifier>Interface</span><span class=special>::</span><span class=identifier>Exception</span><span class=special>, </span><span class=identifier>Interface</span><span class=special>::</span><span class=identifier>SystemException</span><span class=special>); + </span><span class=comment>// d-tor + + </span><span class=special>~</span><span class=identifier>StrictPtr </span><span class=special>() </span><span class=keyword>throw </span><span class=special>(); + + </span><span class=comment>// assignment & copy-assignment operators + + </span><span class=identifier>StrictPtr</span><span class=special><</span><span class=identifier>Type</span><span class=special>>& + </span><span class=keyword>operator</span><span class=special>= </span><span class=special>(</span><span class=identifier>Type</span><span class=special>* </span><span class=identifier>ptr</span><span class=special>) </span><span class=keyword>throw </span><span class=special>(); + + </span><span class=identifier>StrictPtr</span><span class=special><</span><span class=identifier>Type</span><span class=special>>& + </span><span class=keyword>operator</span><span class=special>= </span><span class=special>(</span><span class=identifier>StrictPtr</span><span class=special><</span><span class=identifier>Type</span><span class=special>> </span><span class=keyword>const</span><span class=special>& </span><span class=identifier>s_ptr</span><span class=special>) + </span><span class=keyword>throw </span><span class=special>(</span><span class=identifier>Interface</span><span class=special>::</span><span class=identifier>Exception</span><span class=special>, </span><span class=identifier>Interface</span><span class=special>::</span><span class=identifier>SystemException</span><span class=special>); + + </span><span class=keyword>template </span><span class=special><</span><span class=keyword>typename </span><span class=identifier>Other</span><span class=special>> + </span><span class=identifier>StrictPtr</span><span class=special><</span><span class=identifier>Type</span><span class=special>>& + </span><span class=keyword>operator</span><span class=special>= </span><span class=special>(</span><span class=identifier>StrictPtr</span><span class=special><</span><span class=identifier>Other</span><span class=special>> </span><span class=keyword>const</span><span class=special>& </span><span class=identifier>s_ptr</span><span class=special>) + </span><span class=keyword>throw </span><span class=special>(</span><span class=identifier>Interface</span><span class=special>::</span><span class=identifier>Exception</span><span class=special>, </span><span class=identifier>Interface</span><span class=special>::</span><span class=identifier>SystemException</span><span class=special>); + + </span><span class=comment>// conversions + + // Note: implicit conversion (operator Type* ()) is not supported. + + // comparison + + </span><span class=keyword>bool + </span><span class=keyword>operator</span><span class=special>== </span><span class=special>(</span><span class=identifier>Type</span><span class=special>* </span><span class=identifier>other</span><span class=special>) </span><span class=keyword>const </span><span class=keyword>throw </span><span class=special>(); + + </span><span class=keyword>bool + </span><span class=keyword>operator</span><span class=special>!= </span><span class=special>(</span><span class=identifier>Type</span><span class=special>* </span><span class=identifier>other</span><span class=special>) </span><span class=keyword>const </span><span class=keyword>throw </span><span class=special>(); + + </span><span class=comment>// accessors + + </span><span class=identifier>Type</span><span class=special>* + </span><span class=keyword>operator</span><span class=special>-> </span><span class=special>() </span><span class=keyword>const </span><span class=keyword>throw </span><span class=special>(</span><span class=identifier>NotInitialized</span><span class=special>); + + </span><span class=identifier>Type</span><span class=special>* + </span><span class=identifier>in </span><span class=special>() </span><span class=keyword>const </span><span class=keyword>throw </span><span class=special>(); + + </span><span class=identifier>Type</span><span class=special>* + </span><span class=identifier>retn</span><span class=special>() </span><span class=keyword>throw </span><span class=special>(); + + </span><span class=keyword>private</span><span class=special>: + </span><span class=identifier>Type</span><span class=special>* </span><span class=identifier>ptr_</span><span class=special>; + </span><span class=special>}; + + </span><span class=comment>// Specialization of add_ref function for StrictPtr<T> + </span><span class=keyword>template </span><span class=special><</span><span class=keyword>typename </span><span class=identifier>T</span><span class=special>> + </span><span class=identifier>T</span><span class=special>* + </span><span class=identifier>add_ref </span><span class=special>(</span><span class=identifier>StrictPtr</span><span class=special><</span><span class=identifier>T</span><span class=special>> </span><span class=keyword>const</span><span class=special>& </span><span class=identifier>ptr</span><span class=special>) + </span><span class=keyword>throw </span><span class=special>(</span><span class=identifier>Interface</span><span class=special>::</span><span class=identifier>Exception</span><span class=special>, </span><span class=identifier>Interface</span><span class=special>::</span><span class=identifier>SystemException</span><span class=special>); + + </span><span class=comment>// Dynamic type conversion function for StrictPtr's + </span><span class=keyword>template </span><span class=special><</span><span class=keyword>typename </span><span class=identifier>D</span><span class=special>, </span><span class=keyword>typename </span><span class=identifier>S</span><span class=special>> + </span><span class=identifier>StrictPtr</span><span class=special><</span><span class=identifier>D</span><span class=special>> + </span><span class=identifier>strict_cast </span><span class=special>(</span><span class=identifier>StrictPtr</span><span class=special><</span><span class=identifier>S</span><span class=special>> </span><span class=keyword>const</span><span class=special>& </span><span class=identifier>s</span><span class=special>) + </span><span class=keyword>throw </span><span class=special>(</span><span class=identifier>Interface</span><span class=special>::</span><span class=identifier>Exception</span><span class=special>, </span><span class=identifier>Interface</span><span class=special>::</span><span class=identifier>SystemException</span><span class=special>); + </span><span class=special>} +</span><span class=special>} + +</span></pre> +</body> +</html> +<!-- $Id$ --> |