-
/*
pcursor.hh -- part of flowerlib
#ifndef PCURSOR_HH
#define PCURSOR_HH
+#include "plist.hh"
+#include "cursor.hh"
-/// cursor to go with PointerList
+/** cursor to go with PointerList.
+ don't create PointerList<void*>'s.
+ This cursor is just an interface class for Cursor. It takes care of the
+ appropriate type casts
+ */
template<class T>
-struct PCursor : private Cursor<void *> {
+class PCursor : private Cursor<void *> {
friend class IPointerList<T>;
/// delete contents
Cursor<void*>::ok;
Cursor<void*>::del;
Cursor<void*>::backspace;
- T get() {
+ T get_p() {
T p = ptr();
Cursor<void*>::del();
return p;
}
T get_prev() {
(*this)--;
- return get();
+ return get_p();
}
PointerList<T> &list() { return (PointerList<T>&)Cursor<void*>::list(); }
PCursor<T> operator +( int no) const {return Cursor<void*>::operator+(no);} PCursor(const PointerList<T> & l) : Cursor<void*> (l) {}
PCursor( const Cursor<void*>& cursor ) : Cursor<void*>(cursor) { }
- void* vptr() const { return * ((Cursor<void*> &) *this); }
+ void* vptr() const { return *((Cursor<void*> &) *this); }
// should return T& ?
T ptr() const { return (T) vptr(); }
return Cursor<void*>::compare(a,b);
}
};
-/**
- don't create PointerList<void*>'s.
- This cursor is just an interface class for Cursor. It takes care of the
- appropriate type casts
- */