10 #include "wvtypetraits.h"
63 {
return head.next == NULL; }
84 { list = &l; link = NULL; }
91 { prev = NULL; link = &((
WvListBase *)list)->head; }
104 { prev = link;
return link = link->next; }
119 {
return link->data; }
228 void zap(
bool destroy =
true)
242 {
return (T*)head.next->data; }
252 {
return (T*)tail->data; }
264 const char *
id = NULL )
266 (void)
new WvLink((
void *)data, after, tail, autofree, id);
276 void append(T *data,
bool autofree,
const char *
id = NULL)
283 void add(T *data,
bool autofree,
const char *
id = NULL)
284 {
append(data, autofree,
id); }
293 void prepend(T *data,
bool autofree,
const char *
id = NULL)
294 {
add_after(&head, data, autofree,
id); }
304 { Iter i(*
this);
while (i.find(data)) i.unlink(); }
314 if(head.next != NULL)
315 { Iter i(*
this); i.rewind(); i.next(); i.unlink(); }
327 WvLink *next = after->next;
330 T *obj = (destroy && next->get_autofree()) ?
331 static_cast<T*>(next->data) : NULL;
332 if (next == tail) tail = after;
365 {
return (T *)link->data; }
374 return link->get_autofree();
382 link->set_autofree(autofree);
392 if (prev) ((
WvList *)list)->unlink_after(prev, destroy);
411 if (prev) ((
WvList *)list)->unlink_after(prev, destroy);
420 #define DeclareWvList2(_classname_, _type_) \
421 typedef class WvList<_type_> _classname_
423 #define DeclareWvList(_type_) DeclareWvList2(_type_##List, _type_)
426 #endif // __WVLINKLIST_H