<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html><head><meta name="robots" content="noindex"> <meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> <title> Templatesc::Ref class Reference</title> <link href="doxygen.css" rel="stylesheet" type="text/css"> </head><body bgcolor="#ffffff"> <!-- Generated by Doxygen 1.2.5 on Mon Oct 14 14:17:32 2002 --> <center> <a class="qindex" href="index.html">Main Page</a> <a class="qindex" href="hierarchy.html">Class Hierarchy</a> <a class="qindex" href="annotated.html">Compound List</a> <a class="qindex" href="files.html">File List</a> <a class="qindex" href="functions.html">Compound Members</a> <a class="qindex" href="pages.html">Related Pages</a> </center> <hr><h1>sc::Ref Class Template Reference</h1>A template class that maintains references counts. <a href="#_details">More...</a> <p> <code>#include <<a class="el" href="ref_h-source.html">ref.h</a>></code> <p> Inheritance diagram for sc::Ref<p><center><img src="class_sc__Ref_inherit_graph.gif" border="0" usemap="#sc::Ref_inherit_map" alt="Inheritance graph"></center> <map name="sc::Ref_inherit_map"> <area href="class_sc__RefDiagSCMatrix.html" shape="rect" coords="14,147,142,165"> <area href="class_sc__RefSCDimension.html" shape="rect" coords="166,147,291,165"> <area href="class_sc__RefSCMatrix.html" shape="rect" coords="315,147,419,165"> <area href="class_sc__RefSCVector.html" shape="rect" coords="443,147,547,165"> <area href="class_sc__RefSymmSCMatrix.html" shape="rect" coords="571,147,710,165"> <area href="class_sc__RefBase.html" shape="rect" coords="329,13,406,32"> </map> <center><font size="2">[<a href="graph_legend.html">legend</a>]</font></center>Collaboration diagram for sc::Ref:<p><center><img src="class_sc__Ref_coll_graph.gif" border="0" usemap="#sc::Ref_coll_map" alt="Collaboration graph"></center> <map name="sc::Ref_coll_map"> <area href="class_sc__RefBase.html" shape="rect" coords="14,14,91,33"> </map> <center><font size="2">[<a href="graph_legend.html">legend</a>]</font></center><a href="class_sc__Ref-members.html">List of all members.</a><table border=0 cellpadding=0 cellspacing=0> <tr><td colspan=2><br><h2>Public Methods</h2></td></tr> <tr><td nowrap align=right valign=top><a name="a0" doxytag="sc::Ref::Ref"></a> </td><td valign=bottom><a class="el" href="class_sc__Ref.html#a0">Ref</a> ()</td></tr> <tr><td> </td><td><font size=-1><em>Create a reference to a null object.</em></font><br><br></td></tr> <tr><td nowrap align=right valign=top><a name="a1" doxytag="sc::Ref::Ref"></a> </td><td valign=bottom><a class="el" href="class_sc__Ref.html#a1">Ref</a> (T *a)</td></tr> <tr><td> </td><td><font size=-1><em>Create a reference to the object a.</em></font><br><br></td></tr> <tr><td nowrap align=right valign=top><a name="a2" doxytag="sc::Ref::Ref"></a> </td><td valign=bottom><a class="el" href="class_sc__Ref.html#a2">Ref</a> (const Ref< T > &a)</td></tr> <tr><td> </td><td><font size=-1><em>Create a reference to the object referred to by a.</em></font><br><br></td></tr> <tr><td nowrap align=right valign=top><a name="a3" doxytag="sc::Ref::Ref"></a> template<class A> </td><td valign=bottom><a class="el" href="class_sc__Ref.html#a3">Ref</a> (const Ref< A > &a)</td></tr> <tr><td> </td><td><font size=-1><em>Create a reference to the object referred to by a.</em></font><br><br></td></tr> <tr><td nowrap align=right valign=top> </td><td valign=bottom><a class="el" href="class_sc__Ref.html#a4">~Ref</a> ()</td></tr> <tr><td> </td><td><font size=-1><em>Delete this reference to the object.</em> <a href="#a4">More...</a><em></em></font><br><br></td></tr> <tr><td nowrap align=right valign=top>T* </td><td valign=bottom><a class="el" href="class_sc__Ref.html#a5">operator-></a> () const</td></tr> <tr><td> </td><td><font size=-1><em>Returns the reference counted object.</em> <a href="#a5">More...</a><em></em></font><br><br></td></tr> <tr><td nowrap align=right valign=top><a name="a6" doxytag="sc::Ref::pointer"></a> T* </td><td valign=bottom><a class="el" href="class_sc__Ref.html#a6">pointer</a> () const</td></tr> <tr><td> </td><td><font size=-1><em>Returns a pointer the reference counted object.</em></font><br><br></td></tr> <tr><td nowrap align=right valign=top><a name="a7" doxytag="sc::Ref::parentpointer"></a> <a class="el" href="class_sc__RefCount.html">RefCount</a>* </td><td valign=bottom><a class="el" href="class_sc__Ref.html#a7">parentpointer</a> () const</td></tr> <tr><td> </td><td><font size=-1><em>Implements the parentpointer pure virtual in the base class.</em></font><br><br></td></tr> <tr><td nowrap align=right valign=top><a name="a8" doxytag="sc::Ref::operator T *"></a> </td><td valign=bottom><b>operator T *</b> () const</td></tr> <tr><td nowrap align=right valign=top>T& </td><td valign=bottom><a class="el" href="class_sc__Ref.html#a9">operator *</a> () const</td></tr> <tr><td> </td><td><font size=-1><em>Returns a C++ reference to the reference counted object.</em> <a href="#a9">More...</a><em></em></font><br><br></td></tr> <tr><td nowrap align=right valign=top>int </td><td valign=bottom><a class="el" href="class_sc__Ref.html#a10">null</a> () const</td></tr> <tr><td> </td><td><font size=-1><em>Return 1 if this is a reference to a null object.</em> <a href="#a10">More...</a><em></em></font><br><br></td></tr> <tr><td nowrap align=right valign=top><a name="a11" doxytag="sc::Ref::nonnull"></a> int </td><td valign=bottom><a class="el" href="class_sc__Ref.html#a11">nonnull</a> () const</td></tr> <tr><td> </td><td><font size=-1><em>Return !<a class="el" href="class_sc__Ref.html#a10">null</a>().</em></font><br><br></td></tr> <tr><td nowrap align=right valign=top><a name="a12" doxytag="sc::Ref::operator=="></a> template<class A> int </td><td valign=bottom><a class="el" href="class_sc__Ref.html#a12">operator==</a> (const Ref< A > &a) const</td></tr> <tr><td> </td><td><font size=-1><em>A variety of ordering and equivalence operators are provided using the <a class="el" href="class_sc__Identity.html">Identity</a> class.</em></font><br><br></td></tr> <tr><td nowrap align=right valign=top><a name="a13" doxytag="sc::Ref::operator>="></a> template<class A> int </td><td valign=bottom><b>operator>=</b> (const Ref< A > &a) const</td></tr> <tr><td nowrap align=right valign=top><a name="a14" doxytag="sc::Ref::operator<="></a> int </td><td valign=bottom><b>operator<=</b> (const Ref< A > &a) const</td></tr> <tr><td nowrap align=right valign=top><a name="a15" doxytag="sc::Ref::operator>"></a> template<class A> int </td><td valign=bottom><b>operator></b> (const Ref< A > &a) const</td></tr> <tr><td nowrap align=right valign=top><a name="a16" doxytag="sc::Ref::operator<"></a> int </td><td valign=bottom><b>operator<</b> (const Ref< A > &a) const</td></tr> <tr><td nowrap align=right valign=top><a name="a17" doxytag="sc::Ref::operator!="></a> template<class A> int </td><td valign=bottom><b>operator!=</b> (const Ref< A > &a) const</td></tr> <tr><td nowrap align=right valign=top>int </td><td valign=bottom><a class="el" href="class_sc__Ref.html#a18">compare</a> (const Ref< T > &a) const</td></tr> <tr><td> </td><td><font size=-1><em>Compare two objects returning -1, 0, or 1.</em> <a href="#a18">More...</a><em></em></font><br><br></td></tr> <tr><td nowrap align=right valign=top><a name="a19" doxytag="sc::Ref::clear"></a> void </td><td valign=bottom><a class="el" href="class_sc__Ref.html#a19">clear</a> ()</td></tr> <tr><td> </td><td><font size=-1><em>Refer to the null object.</em></font><br><br></td></tr> <tr><td nowrap align=right valign=top><a name="a20" doxytag="sc::Ref::operator="></a> Ref<T>& </td><td valign=bottom><a class="el" href="class_sc__Ref.html#a20">operator=</a> (const Ref< T > &c)</td></tr> <tr><td> </td><td><font size=-1><em>Assignment to c.</em></font><br><br></td></tr> <tr><td nowrap align=right valign=top><a name="a21" doxytag="sc::Ref::operator="></a> template<class A> Ref<T>& </td><td valign=bottom><a class="el" href="class_sc__Ref.html#a21">operator=</a> (const Ref< A > &c)</td></tr> <tr><td> </td><td><font size=-1><em>Assignment to c.</em></font><br><br></td></tr> <tr><td nowrap align=right valign=top><a name="a22" doxytag="sc::Ref::operator<<"></a> Ref<T>& </td><td valign=bottom><a class="el" href="class_sc__Ref.html#a22">operator<<</a> (const <a class="el" href="class_sc__RefBase.html">RefBase</a> &a)</td></tr> <tr><td> </td><td><font size=-1><em>Assignment to the object that a references using dynamic_cast.</em></font><br><br></td></tr> <tr><td nowrap align=right valign=top>Ref<T>& </td><td valign=bottom><a class="el" href="class_sc__Ref.html#a23">operator<<</a> (<a class="el" href="class_sc__RefCount.html">RefCount</a> *a)</td></tr> <tr><td> </td><td><font size=-1><em>Assigns to the given base class pointer using dynamic_cast.</em> <a href="#a23">More...</a><em></em></font><br><br></td></tr> <tr><td nowrap align=right valign=top><a name="a24" doxytag="sc::Ref::operator="></a> Ref<T>& </td><td valign=bottom><a class="el" href="class_sc__Ref.html#a24">operator=</a> (T *cr)</td></tr> <tr><td> </td><td><font size=-1><em>Assignment to cr.</em></font><br><br></td></tr> <tr><td nowrap align=right valign=top><a name="a25" doxytag="sc::Ref::assign_pointer"></a> void </td><td valign=bottom><a class="el" href="class_sc__Ref.html#a25">assign_pointer</a> (T *cr)</td></tr> <tr><td> </td><td><font size=-1><em>Assignment to cr.</em></font><br><br></td></tr> <tr><td nowrap align=right valign=top><a name="a26" doxytag="sc::Ref::check_pointer"></a> void </td><td valign=bottom><a class="el" href="class_sc__Ref.html#a26">check_pointer</a> () const</td></tr> <tr><td> </td><td><font size=-1><em>Check the validity of the pointer.</em></font><br><br></td></tr> <tr><td nowrap align=right valign=top><a name="a27" doxytag="sc::Ref::ref_info"></a> void </td><td valign=bottom><a class="el" href="class_sc__Ref.html#a27">ref_info</a> (std::ostream &os) const</td></tr> <tr><td> </td><td><font size=-1><em>Print information about the reference to os.</em></font><br><br></td></tr> <tr><td nowrap align=right valign=top><a name="a28" doxytag="sc::Ref::warn"></a> void </td><td valign=bottom><a class="el" href="class_sc__Ref.html#a28">warn</a> (const char *s) const</td></tr> <tr><td> </td><td><font size=-1><em>Print a warning concerning the reference.</em></font><br><br></td></tr> </table> <hr><a name="_details"></a><h2>Detailed Description</h2> <h3>template<class T> class sc::Ref</h3> A template class that maintains references counts. <p> Several of these operations can cause a reference to an object to be replaced by a reference to a different object. If a reference to a nonnull object is eliminated, the object's reference count is decremented and the object is deleted if the reference count becomes zero. <p> There also may be a to convert to T*, where T is the type of the object which <a class="el" href="class_sc__Ref.html">Ref</a> references. Some compilers have bugs that prevent the use of operator T *(). The <a class="el" href="class_sc__Ref.html#a6">pointer</a>() member should be used instead. <p> <hr><h2>Constructor & Destructor Documentation</h2> <a name="a4" doxytag="sc::Ref::~Ref"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td colspan="2"><b> template<class T> </b></td> </tr> <tr> <td nowrap valign="top"><b> sc::Ref<T>::~Ref<T> ( </b></td> <td valign="bottom"><b> )<code> [inline]</code> </b></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> Delete this reference to the object. <p> Decrement the object's reference count and delete the object if the count is zero. </td> </tr> </table> <hr><h2>Member Function Documentation</h2> <a name="a18" doxytag="sc::Ref::compare"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td colspan="2"><b> template<class T> </b></td> </tr> <tr> <td nowrap valign="top"><b> int sc::Ref<T>::compare ( </b></td> <td valign="bottom"><b> const Ref< T > & <em>a</em> ) const<code> [inline]</code> </b></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> Compare two objects returning -1, 0, or 1. <p> Similar to the C library routine strcmp. </td> </tr> </table> <a name="a10" doxytag="sc::Ref::null"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td colspan="2"><b> template<class T> </b></td> </tr> <tr> <td nowrap valign="top"><b> int sc::Ref<T>::null ( </b></td> <td valign="bottom"><b> ) const<code> [inline]</code> </b></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> Return 1 if this is a reference to a null object. <p> Otherwise return 0. </td> </tr> </table> <a name="a9" doxytag="sc::Ref::operator *"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td colspan="2"><b> template<class T> </b></td> </tr> <tr> <td nowrap valign="top"><b> T & sc::Ref<T>::operator * ( </b></td> <td valign="bottom"><b> ) const<code> [inline]</code> </b></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> Returns a C++ reference to the reference counted object. <p> The behaviour is undefined if the object is null. </td> </tr> </table> <a name="a5" doxytag="sc::Ref::operator->"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td colspan="2"><b> template<class T> </b></td> </tr> <tr> <td nowrap valign="top"><b> T * sc::Ref<T>::operator-> ( </b></td> <td valign="bottom"><b> ) const<code> [inline]</code> </b></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> Returns the reference counted object. <p> The behaviour is undefined if the object is null. </td> </tr> </table> <a name="a23" doxytag="sc::Ref::operator<<"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td colspan="2"><b> template<class T> </b></td> </tr> <tr> <td nowrap valign="top"><b> Ref< T > & sc::Ref<T>::operator<< ( </b></td> <td valign="bottom"><b> <a class="el" href="class_sc__RefCount.html">RefCount</a> * <em>a</em> )<code> [inline]</code> </b></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> Assigns to the given base class pointer using dynamic_cast. <p> If the dynamic_cast fails and the argument is nonnull and has a reference count of zero, then it is deleted. <p> Reimplemented in <a class="el" href="class_sc__RefSCDimension.html#a5">sc::RefSCDimension</a>. </td> </tr> </table> <hr>The documentation for this class was generated from the following file:<ul> <li><a class="el" href="ref_h-source.html">ref.h</a></ul> <hr> <address> <small> Generated at Mon Oct 14 14:17:33 2002 for <a href="http://aros.ca.sandia.gov/~cljanss/mpqc">MPQC</a> 2.1.2 using the documentation package <a href="http://www.stack.nl/~dimitri/doxygen/index.html">Doxygen</a> 1.2.5. </small> </address> </body> </html>