7 template<class T> class List;
14 Cursor( const List<T>& list, Link<T>* pointer = 0 );
15 /** this isn't true, actually, #list# surely isn't const, but I get
16 tired of the warning messages. */
18 Cursor( const Cursor<T>& cursor );
22 T& operator *() { return thing(); }
23 operator T() { return thing(); }
24 Cursor<T> operator =( const Cursor<T>& c );
26 /// make cursor with #no# items back
27 Cursor<T> operator -( int no) const;
29 /// make cursor with #no# items further
30 Cursor<T> operator +( int no) const;
31 int operator -(Cursor<T> op) const;
32 Cursor<T> operator -=(int);
33 Cursor<T> operator +=(int);
35 /// return current and move one down
36 Cursor<T> operator ++( int );
38 /// return current and move one up
39 Cursor<T> operator --( int );
50 /// put (copy) after me in List
51 void add( const T& thing );
53 analogously to editor. ok() interpreted as at end
56 PRE: !ok, POST: added to bottom()
58 PRE: ok, POST: added after me
60 cursor points to same object, cursor.next() is newly added
64 /// put (copy) before me in List
65 void insert( const T& thing );
67 analogously to editor. ok() interpreted as at begin of
70 PRE: !ok, POST: add to top()
72 PRE: ok, POST: add before me
74 cursor points to same object, cursor.previous()
75 is newly inserted object.
84 /// access the list this came from
85 const List<T>& list() const ;
93 add and insert extend the list
94 items are always stored as copies in List, but:
95 List<String> : copies of String stored
96 List<String*> : copies of String* stored!
98 the operations add and insert actually delegate the work to List class.
105 #include "compare.hh"
108 inline int cursor_compare(Cursor<T> a,Cursor<T>b)
113 template_instantiate_compare(Cursor<T>, cursor_compare, template<class T>);
115 #include "pcursor.hh"
117 #include "cursor.inl"