00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef LSG_LIST_H
00024 #define LSG_LIST_H
00025
00026
00027
00028
00029
00030
00031 #include <lescegra/util/object.h>
00032
00033 typedef struct LsgListElement_s LsgListElement;
00034 struct LsgListElement_s {
00035 LsgListElement* next;
00036 void* value;
00037 };
00038
00039
00040
00041
00042
00043
00044
00045 typedef struct {
00046 LsgObject super;
00047 LsgListElement* first;
00048 } LsgList;
00049
00050
00051
00052
00053
00054
00055 typedef struct {
00056 LsgObject super;
00057 LsgListElement* element;
00058 int index;
00059 } LsgIterator;
00060
00061
00062
00063
00064 LsgList* LsgList_create(void);
00065 void LsgList_init(LsgList* self);
00066 unsigned int LsgList_count(const LsgList* self);
00067 void LsgList_append(LsgList* self, void* data);
00068 void LsgList_insert(LsgList* list, unsigned int index, void* data);
00069 void LsgList_remove(LsgList* list, unsigned int index);
00070 void LsgList_removeObject(LsgList* list, void* data);
00071 void LsgList_empty(LsgList* list);
00072 void* LsgList_set(LsgList* list, unsigned int index, void* data);
00073 void* LsgList_get(const LsgList* list, unsigned int index);
00074 void LsgList_destroy(LsgList* self);
00075
00076 LsgIterator* LsgIterator_create(const LsgList* list);
00077 void LsgIterator_init(LsgIterator* self, const LsgList* list);
00078 int LsgIterator_hasNext(const LsgIterator* self);
00079 void* LsgIterator_next(LsgIterator* self);
00080 int LsgIterator_index(const LsgIterator* self);
00081
00082 #endif
00083