Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/orxonox/trunk/src/list.h @ 2818

Last change on this file since 2818 was 2816, checked in by patrick, 20 years ago

orxonox/trunk/src: new list implemented

File size: 931 bytes
Line 
1
2#ifndef LIST_H
3#define LIST_H
4
5#include "stdincl.h"
6
7//! An enum to list all the modes available when adding an object to a List
8//enum ADDMODE {LIST_ADD_FIRST, LIST_ADD_LAST};
9//! An enum to list the two searching directions available when removing an object from a List
10//enum FINDMODE {LIST_FIND_BW, LIST_FIND_FW};
11
12
13
14class WorldEntity;
15
16class List {
17
18 public:
19  List ();
20  ~List ();
21
22  void add(WorldEntity* entity);
23  void remove(WorldEntity* entity);
24  void clear();
25  WorldEntity* firstElement();
26  bool isEmpty();
27  int getSize();
28  WorldEntity* enumerate();
29  WorldEntity* nextElement();
30  WorldEntity* toArray();
31  void debug();
32
33 private:
34  struct listElement
35  {
36    listElement* prev;
37    WorldEntity* curr;
38    listElement* next;
39  };
40  Uint32 size;
41  listElement* first;
42  listElement* last;
43  listElement* currentEl;
44
45
46};
47
48class Iterator
49{
50
51 public:
52  bool hasNext();
53  WorldEntity* next();
54
55 private:
56
57};
58
59#endif
Note: See TracBrowser for help on using the repository browser.