NAME

OTC_CtrPtr - Smart pointer to help manage resources.

SYNOPSIS


#include <OTC/refcnt/ctrptr.hh>

template<class T>
class OTC_CtrPtr : public OTC_CCtrPtr<T>
{
  public:
    inline OTC_CtrPtr();
    inline OTC_CtrPtr(T* theItem);
    inline OTC_CtrPtr(OTC_CtrPtr<T> const& theCtrPtr);
    inline T* item() const;
    inline T* operator->() const;
    inline operator T*() const;
    inline T& operator*() const;
    inline OTC_CtrPtr<T>& operator=(OTC_CtrPtr<T> const& theCtrPtr);
    inline OTC_CtrPtr<T>& operator=(T* theItem);
};

CLASS TYPE

Concrete

DESCRIPTION

Designed to manage classes which do not contain the ability to keep a reference count.

CONSTRUCTION

inline OTC_CtrPtr();
inline OTC_CtrPtr(T* theItem);
inline OTC_CtrPtr(OTC_CtrPtr<T> const& theCtrPtr);

ACCESS

inline T* item() const;
inline T* operator->() const;
inline operator T*() const;
inline T& operator*() const;

ASSIGNMENT

With all the following, the count on the currently held object will be decremented, and if it is no longer required, it will be deleted.
inline OTC_CtrPtr<T>& operator=(OTC_CtrPtr<T> const& theCtrPtr);
inline OTC_CtrPtr<T>& operator=(T* theItem);

LIBRARY

OTC

AUTHOR(S)

Graham Dumpleton

COPYRIGHT

Copyright 1991 OTC LIMITED
Copyright 1994 DUMPLETON SOFTWARE CONSULTING PTY LIMITED