NAME

OTC_PairModifier - Interface to a cursor over a key/item pair.

SYNOPSIS


#include <OTC/collctn/prmodifr.hh>

template<class T1, class T2>
class OTC_PairModifier : public OTC_PairIterator<T1,T2>
{
  public:
    static os_typespec* get_os_typespec();
    inline OTC_PairModifier();
    inline OTC_PairModifier(OTC_PairCursor<T1,T2>* theIter);
    inline OTC_PairModifier(OTC_PairModifier<T1,T2> const& theIter);
    inline OTC_PairModifier<T1,T2>& operator=(
      OTC_PairCursor<T1,T2>* theIter
    );
    inline OTC_PairModifier<T1,T2>& operator=(
      OTC_PairModifier<T1,T2> const& theIter
    );
    inline T2& item() const;
    inline OTC_PairModifier<T1,T2> clone() const;
    inline void apply(OTC_PairVisitor<T1,T2>& theApplicator);
    inline void apply(OTC_PairWorker<T1,T2>& theApplicator);
};

CLASS TYPE

Concrete

DESCRIPTION

This class exists so that the user of an iterator for collections holding key/item pairs, does not have to worry about deleting the iterator when finished with it, nor need to know how to create an iterator for a specific type of collection. 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. The difference between this class and OTC_PairModifier is that it is possible to modify the items through this class.

INITIALISATION

inline OTC_PairModifier();
inline OTC_PairModifier(OTC_PairCursor<T1,T2>* theIter);
inline OTC_PairModifier(OTC_PairModifier<T1,T2> const& theIter);
inline OTC_PairModifier<T1,T2>& operator=(
  OTC_PairCursor<T1,T2>* theIter
);
inline OTC_PairModifier<T1,T2>& operator=(
  OTC_PairModifier<T1,T2> const& theIter
);

RETRIEVAL

inline T2& item() const;

CLONING

inline OTC_PairModifier<T1,T2> clone() const;

APPLICATOR

inline void apply(OTC_PairVisitor<T1,T2>& theApplicator);
inline void apply(OTC_PairWorker<T1,T2>& theApplicator);

LIBRARY

OTC

AUTHOR(S)

Graham Dumpleton

COPYRIGHT

Copyright 1993 TELSTRA CORPORATION LIMITED
Copyright 1994 DUMPLETON SOFTWARE CONSULTING PTY LIMITED