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
);
45 List can be seen as all items written down on paper,
48 class Cursor is used to extend List
50 items are always stored as copies in List, but:
51 #List<String># : copies of #String# stored
52 #List<String*># : copies of #String*# stored!
53 (do not use, use \Ref{PointerList}#<String*># instead.)
56 retrieving "invalid" cursors, i.e.
57 #top()/bottom()# from empty list, #find()# without success,
58 results in a nonvalid Cursor ( #!ok()# )
65 /// Use for list of pointers, e.g. PointerList<AbstractType*>.
67 class PointerList
: public List
<T
>
71 PointerList( const T
& thing
);
74 virtual ~PointerList();
76 This function deletes deletes the allocated pointers of all links.
77 #\Ref{~List}# is used to delete the links themselves.
81 virtual void remove( Cursor
<T
> me
);
87 // instantiate a template: explicit instantiation.
88 #define L_instantiate(a) template class List<a>; template class Cursor<a>; \
89 template class Link<a>
90 #define PL_instantiate(a) L_instantiate(a *); template class PointerList<a*>
92 #endif // __LIST_HH //