NAME

OTC_CCtrVecPtr - Smart pointer to help manage resources.

SYNOPSIS


#include <OTC/refcnt/cctrvptr.hh>

template<class T>
class OTC_CCtrVecPtr
{
  public:
    OTC_CCtrVecPtr();
    OTC_CCtrVecPtr(T const* theItem);
    OTC_CCtrVecPtr(OTC_CCtrVecPtr<T> const& theCtrPtr);
    ~OTC_CCtrVecPtr();
    inline T const* item() const;
    inline T const& operator[](u_int theIndex) const;
    inline operator T const*() const;
    inline T const& operator*() const;
    inline OTC_Boolean operator!() const;
    inline OTC_Boolean operator==(int theItem) const;
    inline OTC_Boolean operator!=(int theItem) const;
    inline OTC_Boolean operator==(T const* theItem) const;
    inline OTC_Boolean operator!=(T const* theItem) const;
    void setItem(OTC_CCtrVecPtr<T> const& theCtrPtr);
    void setItem(T const* theItem);
    OTC_CCtrVecPtr<T>& operator=(OTC_CCtrVecPtr<T> const& theCtrPtr);
    OTC_CCtrVecPtr<T>& operator=(T const* theItem);
    u_int numRefs() const;
  protected:
    inline T* _item() const;
    T* _itemNoNull() const;
};

CLASS TYPE

Concrete

DESCRIPTION

Designed to manage vectors of classes.

CONSTRUCTION

OTC_CCtrVecPtr();
OTC_CCtrVecPtr(T const* theItem);
OTC_CCtrVecPtr(OTC_CCtrVecPtr<T> const& theCtrPtr);

DESTRUCTION

~OTC_CCtrVecPtr();

ACCESS

inline T const* item() const;
inline T const& operator[](u_int theIndex) const;
inline operator T const*() const;
inline T const& operator*() const;
inline OTC_Boolean operator!() const;
inline OTC_Boolean operator==(int theItem) const;
inline OTC_Boolean operator!=(int theItem) const;
inline OTC_Boolean operator==(T const* theItem) const;
inline OTC_Boolean operator!=(T const* theItem) 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.
void setItem(OTC_CCtrVecPtr<T> const& theCtrPtr);
void setItem(T const* theItem);
OTC_CCtrVecPtr<T>& operator=(OTC_CCtrVecPtr<T> const& theCtrPtr);
OTC_CCtrVecPtr<T>& operator=(T const* theItem);

QUERY

u_int numRefs() const;

LIBRARY

OTC

AUTHOR(S)

Graham Dumpleton

COPYRIGHT

Copyright 1991 OTC LIMITED
Copyright 1994 DUMPLETON SOFTWARE CONSULTING PTY LIMITED