2 list.hh -- part of flowerlib
4 (c) 1996 Han-Wen Nienhuys & Jan Nieuwenhuizen
12 /// Use for list of pointers, e.g. PointerList<AbstractType*>.
14 class PointerList : public List<T>
17 PointerList(PointerList&) { set_empty(); }
18 PointerList( const T& thing ) : List<T>( thing ) { }
21 virtual ~PointerList();
23 This function deletes deletes the allocated pointers of all links.
24 #\Ref{~List}# is used to delete the links themselves.
28 virtual void remove( Cursor<T> me );
32 The copy constructor doesn't do what you'd want:
33 Since T might have a virtual ctor, we don't try to do a
37 You have to copy this yourself, or use the macro PointerList__copy
40 #define PointerList__copy(T, to, from, op) \
41 for (PCursor<T> _pc_(from); _pc_.ok(); _pc_++)\
42 to.bottom().add(_pc_->op)\
47 void PL_copy(PointerList<T*> &dst,PointerList<T*> const&src);
49 #define PL_instantiate(a) L_instantiate(a *); template class PointerList<a*>