7 template<class T> class List;
14 Cursor( List<T>& list, Link<T>* pointer = 0 );
15 Cursor( const Cursor<T>& cursor );
19 operator T() { return *(*this); }
20 Cursor<T> operator =( const Cursor<T>& c );
22 /// make cursor with #no# items back
23 Cursor<T> operator -( int no) const;
25 /// make cursor with #no# items further
26 Cursor<T> operator +( int no) const;
27 int operator -(Cursor<T> op) const;
28 Cursor<T> operator -=(int);
29 Cursor<T> operator +=(int);
31 /// return current and move one down
32 Cursor<T> operator ++( int );
34 /// return current and move one up
35 Cursor<T> operator --( int );
46 /// put (copy) after me in List
47 void add( const T& thing );
49 analogously to editor. ok() interpreted as at end
52 PRE: !ok, POST: added to bottom()
54 PRE: ok, POST: added after me
56 cursor points to same object, cursor.next() is newly added
60 /// put (copy) before me in List
61 void insert( const T& thing );
63 analogously to editor. ok() interpreted as at begin of
66 PRE: !ok, POST: add to top()
68 PRE: ok, POST: add before me
70 cursor points to same object, cursor.previous()
71 is newly inserted object.
80 /// access the list this came from
81 const List<T>& list() const ;
89 add and insert extend the list
90 items are always stored as copies in List, but:
91 List<String> : copies of String stored
92 List<String*> : copies of String* stored!
94 the operations add and insert actually delegate the work to List class.
114 #include "compare.hh"
117 inline int cursor_compare(Cursor<T> a,Cursor<T>b)
122 template_instantiate_compare(Cursor<T>, cursor_compare, template<class T>);
124 #include "pcursor.hh"
126 #include "cursor.inl"
128 #endif // __CURSOR_HH //