NAME
OTC_CtrVecPtr -
Smart pointer to help manage resources.
SYNOPSIS
#include <OTC/refcnt/ctrvptr.hh>
template<class T>
class OTC_CtrVecPtr : public OTC_CCtrVecPtr<T>
{
public:
inline OTC_CtrVecPtr();
inline OTC_CtrVecPtr(T* theItem);
inline OTC_CtrVecPtr(OTC_CtrVecPtr<T> const& theCtrPtr);
inline T* item() const;
inline T& operator[](u_int theIndex) const;
inline operator T*() const;
inline T& operator*() const;
inline OTC_CtrVecPtr<T>& operator=(
OTC_CtrVecPtr<T> const& theCtrPtr
);
inline OTC_CtrVecPtr<T>& operator=(T* theItem);
};
CLASS TYPE
Concrete
DESCRIPTION
Designed to manage vectors of classes.
CONSTRUCTION
inline OTC_CtrVecPtr();
Creates a nil pointer class.
inline OTC_CtrVecPtr(T* theItem);
Creates a pointer class for theItem.
inline OTC_CtrVecPtr(OTC_CtrVecPtr<T> const& theCtrPtr);
Creates a pointer class for the
object pointed to by theCtrPtr.
ACCESS
inline T* item() const;
Returns the object being pointed at.
inline T& operator[](u_int theIndex) const;
Returns a reference to the object in the
vector at location theIndex. Note that
no bounds checking is done. Also, if no
item is held, an exception is generated.
inline operator T*() const;
Returns the object being pointed at.
inline T& operator*() const;
Returns a reference to the first object in
the vector being held. If no item is held,
an exception is generated.
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_CtrVecPtr<T>& operator=(OTC_CtrVecPtr<T> const& theCtrPtr);
Sets this class to point at the object
held by theCtrPtr.
inline OTC_CtrVecPtr<T>& operator=(T* theItem);
Sets this class to point at theItem.
LIBRARY
OTC
AUTHOR(S)
Graham Dumpleton
COPYRIGHT
Copyright 1991 OTC LIMITED
Copyright 1994 DUMPLETON SOFTWARE CONSULTING PTY LIMITED