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 class WvLink
00020 {
00021 public:
00022 void *data;
00023 WvLink *next;
00024 char *id;
00025 unsigned auto_free : 1;
00026
00027 WvLink(void *_data, bool _auto_free, char *_id = NULL)
00028 { data = _data; next = NULL; auto_free = (unsigned)_auto_free;
00029 id = _id; }
00030
00031 WvLink(void *_data, WvLink *prev, WvLink *&tail, bool _auto_free,
00032 char *_id = NULL);
00033
00034 void unlink(WvLink *prev)
00035 {
00036 prev->next = next;
00037 delete this;
00038 }
00039 };
00040
00041 #define WvIterStuff(_type_) \
00042 operator _type_& () const \
00043 { return *ptr(); } \
00044 _type_ &operator () () const \
00045 { return *ptr(); } \
00046 _type_ *operator -> () const \
00047 { return ptr(); } \
00048 _type_ &operator* () const \
00049 { return *ptr(); }
00050
00051 #endif // __WVLINK_H