NAME

OTC_Ptr - Pointer which creates object only when required.

SYNOPSIS


#include <OTC/memory/ptr.hh>

template<class T>
class OTC_Ptr
{
  public:
    inline OTC_Ptr();
    inline ~OTC_Ptr();
    inline T* item();
    inline T const* item() const;
    inline T* operator->();
    inline T const* operator->() const;
    inline operator T*();
    inline operator T const*() const;
    inline T& operator*();
    inline T const& operator*() const;
    inline OTC_Boolean isUndefined() const;
};

CLASS TYPE

Concrete

DESCRIPTION

Designed such that the object being managed is only created when required. Also deletes the object when pointer class is destroyed.

CONSTRUCTION

inline OTC_Ptr();

DESTRUCTION

inline ~OTC_Ptr();

ACCESS

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

QUERY

inline OTC_Boolean isUndefined() const;

NOTES

Argument T must be a class object. A builtin type or pointer cannot be used for T.

LIBRARY

OTC

AUTHOR(S)

Graham Dumpleton

COPYRIGHT

Copyright 1994 DUMPLETON SOFTWARE CONSULTING PTY LIMITED