.TH "sc::Ref< T >" 3 "Sun Oct 4 2020" "Version 2.3.1" "MPQC" \" -*- nroff -*- .ad l .nh .SH NAME sc::Ref< T > \- A template class that maintains references counts\&. .SH SYNOPSIS .br .PP .PP \fC#include \fP .PP Inherits \fBsc::RefBase\fP\&. .SS "Public Member Functions" .in +1c .ti -1c .RI "\fBRef\fP ()" .br .RI "Create a reference to a null object\&. " .ti -1c .RI "\fBRef\fP (T *a)" .br .RI "Create a reference to the object a\&. " .ti -1c .RI "\fBRef\fP (const \fBRef\fP< T > &a)" .br .RI "Create a reference to the object referred to by a\&. " .ti -1c .RI "template \fBRef\fP (const \fBRef\fP< A > &a)" .br .RI "Create a reference to the object referred to by a\&. " .ti -1c .RI "\fB~Ref\fP ()" .br .RI "Delete this reference to the object\&. " .ti -1c .RI "T * \fBoperator\->\fP () const" .br .RI "Returns the reference counted object\&. " .ti -1c .RI "T * \fBpointer\fP () const" .br .RI "Returns a pointer the reference counted object\&. " .ti -1c .RI "\fBRefCount\fP * \fBparentpointer\fP () const" .br .RI "Implements the parentpointer pure virtual in the base class\&. " .ti -1c .RI "\fBoperator T*\fP () const" .br .ti -1c .RI "T & \fBoperator*\fP () const" .br .RI "Returns a C++ reference to the reference counted object\&. " .ti -1c .RI "int \fBnull\fP () const" .br .RI "Return 1 if this is a reference to a null object\&. " .ti -1c .RI "int \fBnonnull\fP () const" .br .RI "Return !null()\&. " .ti -1c .RI "template int \fBoperator==\fP (const \fBRef\fP< A > &a) const" .br .RI "A variety of ordering and equivalence operators are provided using the \fBIdentity\fP class\&. " .ti -1c .RI "template int \fBoperator>=\fP (const \fBRef\fP< A > &a) const" .br .ti -1c .RI "template int \fBoperator<=\fP (const \fBRef\fP< A > &a) const" .br .ti -1c .RI "template int \fBoperator>\fP (const \fBRef\fP< A > &a) const" .br .ti -1c .RI "template int \fBoperator<\fP (const \fBRef\fP< A > &a) const" .br .ti -1c .RI "template int \fBoperator!=\fP (const \fBRef\fP< A > &a) const" .br .ti -1c .RI "int \fBcompare\fP (const \fBRef\fP< T > &a) const" .br .RI "Compare two objects returning -1, 0, or 1\&. " .ti -1c .RI "void \fBclear\fP ()" .br .RI "Refer to the null object\&. " .ti -1c .RI "\fBRef\fP< T > & \fBoperator=\fP (const \fBRef\fP< T > &c)" .br .RI "Assignment to c\&. " .ti -1c .RI "template \fBRef\fP< T > & \fBoperator=\fP (const \fBRef\fP< A > &c)" .br .RI "Assignment to c\&. " .ti -1c .RI "\fBRef\fP< T > & \fBoperator<<\fP (const \fBRefBase\fP &a)" .br .RI "Assignment to the object that a references using dynamic_cast\&. " .ti -1c .RI "\fBRef\fP< T > & \fBoperator<<\fP (\fBRefCount\fP *a)" .br .RI "Assigns to the given base class pointer using dynamic_cast\&. " .ti -1c .RI "\fBRef\fP< T > & \fBoperator=\fP (T *cr)" .br .RI "Assignment to cr\&. " .ti -1c .RI "void \fBassign_pointer\fP (T *cr)" .br .RI "Assignment to cr\&. " .ti -1c .RI "void \fBcheck_pointer\fP () const" .br .RI "Check the validity of the pointer\&. " .ti -1c .RI "void \fBref_info\fP (std::ostream &os) const" .br .RI "Print information about the reference to os\&. " .ti -1c .RI "void \fBwarn\fP (const char *s) const" .br .RI "Print a warning concerning the reference\&. " .in -1c .SS "Additional Inherited Members" .SH "Detailed Description" .PP .SS "template .br class sc::Ref< T >" A template class that maintains references counts\&. 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\&. .PP There also may be a to convert to T*, where T is the type of the object which \fBRef\fP references\&. Some compilers have bugs that prevent the use of operator T*()\&. The \fBpointer()\fP member should be used instead\&. .SH "Constructor & Destructor Documentation" .PP .SS "template \fBsc::Ref\fP< T >::~\fBRef\fP ()\fC [inline]\fP" .PP Delete this reference to the object\&. Decrement the object's reference count and delete the object if the count is zero\&. .SH "Member Function Documentation" .PP .SS "template int \fBsc::Ref\fP< T >::compare (const \fBRef\fP< T > & a) const\fC [inline]\fP" .PP Compare two objects returning -1, 0, or 1\&. Similar to the C library routine strcmp\&. .SS "template int \fBsc::Ref\fP< T >::null () const\fC [inline]\fP" .PP Return 1 if this is a reference to a null object\&. Otherwise return 0\&. .SS "template T& \fBsc::Ref\fP< T >::operator* () const\fC [inline]\fP" .PP Returns a C++ reference to the reference counted object\&. The behaviour is undefined if the object is null\&. .SS "template T* \fBsc::Ref\fP< T >::operator\-> () const\fC [inline]\fP" .PP Returns the reference counted object\&. The behaviour is undefined if the object is null\&. .SS "template \fBRef\fP& \fBsc::Ref\fP< T >::operator<< (\fBRefCount\fP * a)\fC [inline]\fP" .PP Assigns to the given base class pointer using dynamic_cast\&. If the dynamic_cast fails and the argument is nonnull and has a reference count of zero, then it is deleted\&. .SH "Author" .PP Generated automatically by Doxygen for MPQC from the source code\&.