Main Page   Namespace List   Class Hierarchy   Compound List   Namespace Members   Compound Members  

SmartPtr Class Template Reference

#include <SmartPtr.h>

List of all members.

Public Methods

 SmartPtr ()
 SmartPtr (T *instance)
template<typename T1, class LT1, class OP1>  SmartPtr (const SmartPtr< T1, LT1, OP1 > &p)
 SmartPtr (const SmartPtr &p)
 ~SmartPtr ()
template<typename T1, class LT1, class OP1> SmartPtr & operator= (const SmartPtr< T1, LT1, OP1 > &p)
SmartPtr & operator= (const SmartPtr &p)
bool operator! () const
T * operator-> ()
T & operator * ()
bool operator== (const SmartPtr &p)
bool operator!= (const SmartPtr &p)
template<typename T1, class LT1, class OP1> bool operator== (const SmartPtr< T1, LT1, OP1 > &p) const
template<typename T1, class LT1, class OP1> bool operator!= (const SmartPtr< T1, LT1, OP1 > &p) const
template<typename T1, class LT1, class OP1> bool operator< (const SmartPtr< T1, LT1, OP1 > &q)

Friends

bool operator== (const SmartPtr &p, const T *q)
bool operator!= (const SmartPtr &p, const T *q)
bool operator== (const T *p, const SmartPtr &q)
bool operator!= (const T *p, const SmartPtr &q)


Detailed Description

template<typename T, class LockType, typename OwnershipPolicy = CountedRef>
class ZThread::SmartPtr< T, LockType, OwnershipPolicy >

Author:
Eric Crahen <crahen@cse.buffalo.edu>
Date:
<2002-05-30T20:07:09-0400>
Version:
2.2.0
Policy based smart pointer implementation; based, in part, on Andrei Alexandrescu's implementation in "Modern C++ Design". This is a configurable smart pointer with policy parameters to control ownership

This smart pointer doesn't support pointers to arrays. This smart pointer doesn't support locked pointer reference - to be added in a later policy

This class is used to keep track of Queues for Executors.


Constructor & Destructor Documentation

SmartPtr   [inline]
 

Create a new SmartPtr, instantiating an instance of T using its default constructor.

SmartPtr T *    instance [inline]
 

Create a new SmartPtr, using the given instance of T.

Parameters:
instance  T*

SmartPtr const SmartPtr< T1, LT1, OP1 > &    p [inline]
 

Create a new SmartPtr, using the given SmartPtrs pointee.

Parameters:
const  SmartPtr<T1, LT1>&

SmartPtr const SmartPtr< T, LockType, OwnershipPolicy > &    p [inline]
 

Create a new SmartPtr, using the given SmartPtrs pointee.

Parameters:
const  SmartPtr&

~SmartPtr   [inline]
 

Destroy the smart pointer, deleting the instance of T if the ownership policy indicates it is time to do so.


Member Function Documentation

T& operator *   [inline]
 

Dereference operator.

Returns:
T*

bool operator!   const [inline]
 

Compare the pointee to 0.

Returns:
bool

bool operator!= const SmartPtr< T1, LT1, OP1 > &    p const [inline]
 

Compare this SmartPtr to another, for inequality. This function eliminates ambiguity errors.

Parameters:
p  const SmartPtr<T1,LT1,OP1>&
Returns:
bool

bool operator!= const SmartPtr< T, LockType, OwnershipPolicy > &    p [inline]
 

Compare a SmartPtr to another pointer, for inequality, by comparing the 'pointee's of the SmartPtrs.

Parameters:
p  const SmartPtr&
Returns:
bool

T* operator->   [inline]
 

Dereference operator.

Returns:
T*

bool operator< const SmartPtr< T1, LT1, OP1 > &    q [inline]
 

Compare a SmartPt to another, for ordering, by comparing the 'pointee's of the SmartPtrs. This function eliminates ambiguity errors.

Parameters:
p  const SmartPtr<T1,LT1,OP1>&
Returns:
bool

SmartPtr& operator= const SmartPtr< T, LockType, OwnershipPolicy > &    p [inline]
 

Assign this SmartPtr to the pointee of another.

Parameters:
p  SmartPtr&
Returns:
SmartPtr&

SmartPtr& operator= const SmartPtr< T1, LT1, OP1 > &    p [inline]
 

Assign this SmartPtr to the pointee of another.

Parameters:
p  SmartPtr<T1, LT1, OP1>&
Returns:
SmartPtr&

bool operator== const SmartPtr< T1, LT1, OP1 > &    p const [inline]
 

Compare this SmartPtr to another, for equality. This function eliminates ambiguity errors.

Parameters:
p  const SmartPtr<T1,LT1>&
Returns:
bool

bool operator== const SmartPtr< T, LockType, OwnershipPolicy > &    p [inline]
 

Compare a SmartPtr to another pointer, for equality, by comparing the 'pointee's of the SmartPtrs.

Parameters:
p  const SmartPtr&
Returns:
bool


Friends And Related Function Documentation

bool operator!= const T *    p,
const SmartPtr< T, LockType, OwnershipPolicy > &    q
[friend]
 

Compare a raw pointer to a SmartPtr, for inequality, by comparing the 'pointee' of the SmartPtr to the raw pointer.

Parameters:
p  const T*
q  const SmartPtr&
Returns:
bool

bool operator!= const SmartPtr< T, LockType, OwnershipPolicy > &    p,
const T *    q
[friend]
 

Compare a SmartPtr to a raw pointer, for inequality, by comparing the 'pointee' of the SmartPtr to the raw pointer.

Parameters:
p  const SmartPtr&
q  const T*
Returns:
bool

bool operator== const T *    p,
const SmartPtr< T, LockType, OwnershipPolicy > &    q
[friend]
 

Compare a raw pointer to a SmartPtr, for equality, by comparing the 'pointee' of the SmartPtr to the raw pointer.

Parameters:
p  const T*
q  const SmartPtr&
Returns:
bool

bool operator== const SmartPtr< T, LockType, OwnershipPolicy > &    p,
const T *    q
[friend]
 

Compare a SmartPtr to a raw pointer, for equality, by comparing the 'pointee' of the SmartPtr to the raw pointer. This function is responsible for all == comparisions.

Parameters:
p  const SmartPtr&
q  const T*
Returns:
bool


The documentation for this class was generated from the following file:
Generated on Thu May 30 21:10:40 2002 for ZThread by doxygen1.2.15