7 template<class T> class Cursor;
8 template<class T> class Link;
15 /// construct empty list
18 /// construct list from first item.
19 List( const T& thing );
29 friend class Cursor<T>;
32 /// add after after_me
33 void add( const T& thing, Cursor<T> after_me );
35 /// put thing before #before_me#
36 void insert( const T& thing, Cursor<T> before_me );
37 virtual void remove( Cursor<T> me );
39 Remove link pointed to by me.
42 none; WARNING: do not use #me#.
50 List can be seen as all items written down on paper,
53 class Cursor is used to extend List
55 items are always stored as copies in List, but:
56 #List<String># : copies of #String# stored
57 #List<String*># : copies of #String*# stored!
58 (do not use, use \Ref{PointerList}#<String*># instead.)
61 retrieving "invalid" cursors, i.e.
62 #top()/bottom()# from empty list, #find()# without success,
63 results in a nonvalid Cursor ( #!ok()# )
70 /// Use for list of pointers, e.g. PointerList<AbstractType*>.
72 class PointerList : public List<T>
76 PointerList( const T& thing );
79 virtual ~PointerList();
81 This function deletes deletes the allocated pointers of all links.
82 #\Ref{~List}# is used to delete the links themselves.
86 virtual void remove( Cursor<T> me );
92 // instantiate a template: explicit instantiation.
93 #define L_instantiate(a) template class List<a>; template class Cursor<a>; \
94 template class Link<a>
95 #define PL_instantiate(a) L_instantiate(a *); template class PointerList<a*>
97 #endif // __LIST_HH //