NAME

OTC_Modifier - Smart pointer for iterators. Allows modification of items.

SYNOPSIS


#include <OTC/collctn/modifier.hh>

template<class T>
class OTC_Modifier : public OTC_Iterator<T>
{
  public:
    static os_typespec* get_os_typespec();
    inline OTC_Modifier();
    inline OTC_Modifier(OTC_Cursor<T>* anIter);
    inline OTC_Modifier(OTC_Modifier<T> const& anIter);
    inline OTC_Modifier<T>& operator=(OTC_Cursor<T>* anIter);
    inline OTC_Modifier<T>& operator=(OTC_Modifier<T> const& anIter);
    inline T& item() const;
    inline OTC_Modifier<T> clone() const;
    inline void apply(OTC_Visitor<T>& theApplicator);
    inline void apply(OTC_Worker<T>& theApplicator);
};

CLASS TYPE

Concrete

DESCRIPTION

This class exists so that the user of an iterator for a particular type of collection, does not have to worry about deleting the iterator when finished with it. This class will ensure that the iterator is destroyed when this class goes out of scope. In order for this to work correctly, an instance of this class should never be created using new.

EXAMPLE

INITIALISATION

inline OTC_Modifier();
inline OTC_Modifier(OTC_Cursor<T>* anIter);
inline OTC_Modifier(OTC_Modifier<T> const& anIter);
inline OTC_Modifier<T>& operator=(OTC_Cursor<T>* anIter);
inline OTC_Modifier<T>& operator=(OTC_Modifier<T> const& anIter);

RETRIEVAL

inline T& item() const;

CLONING

inline OTC_Modifier<T> clone() const;

APPLICATOR

inline void apply(OTC_Visitor<T>& theApplicator);
inline void apply(OTC_Worker<T>& theApplicator);

SEE ALSO

OTC_Iterator

LIBRARY

OTC

AUTHOR(S)

Graham Dumpleton

COPYRIGHT

Copyright 1991 1992 1993 OTC LIMITED
Copyright 1994 DUMPLETON SOFTWARE CONSULTING PTY LIMITED