00001
00002
00003
00004
00005
00006
00007
00008 #ifndef __WVLINK_H
00009 #define __WVLINK_H
00010
00011 #include <stdlib.h>
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 class WvLink
00024 {
00025 public:
00026 void *data;
00027 WvLink *next;
00028 char *id;
00029 unsigned auto_free : 1;
00030
00031 WvLink(void *_data, bool _auto_free, char *_id = NULL)
00032 { data = _data; next = NULL; auto_free = (unsigned)_auto_free;
00033 id = _id; }
00034
00035 WvLink(void *_data, WvLink *prev, WvLink *&tail, bool _auto_free,
00036 char *_id = NULL);
00037
00038 void unlink(WvLink *prev)
00039 {
00040 prev->next = next;
00041 delete this;
00042 }
00043 };
00044
00045 #define WvIterStuff(_type_) \
00046 \
00047 _type_ &operator () () const \
00048 { return *ptr(); } \
00049 \
00050 _type_ *operator -> () const \
00051 { return ptr(); } \
00052 \
00053 _type_ &operator* () const \
00054 { return *ptr(); }
00055
00056 #endif // __WVLINK_H