#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);
};
new
.
void inc(OTC_List<int>& aList)
{
OTC_Modifier<int> anIter = 0;
anIter = aList.items();
for (anIter.reset(); anIter.isValid(); anIter.next())
anIter.item()++;
}
inline OTC_Modifier();
inline OTC_Modifier(OTC_Cursor<T>* anIter);
anIter
is 0
a
null iterator is constructed.
inline OTC_Modifier(OTC_Modifier<T> const& anIter);
inline OTC_Modifier<T>& operator=(OTC_Cursor<T>* anIter);
anIter
.
If anIter
is 0
, the iterator
is turned into a null iterator and
all associations with the previous
collection are lost.
inline OTC_Modifier<T>& operator=(OTC_Modifier<T> const& anIter);
anIter
.
inline T& item() const;
inline OTC_Modifier<T> clone() const;
inline void apply(OTC_Visitor<T>& theApplicator);
theApplicator
to each item
accessible by this iterator.
inline void apply(OTC_Worker<T>& theApplicator);
theApplicator
to each item
accessible by this iterator.
OTC_Iterator