AnimatLab  2
Test
DoubleList.h
Go to the documentation of this file.
1 
7 #pragma once
8 
9 namespace IntegrateFireSim
10 {
11 
17  namespace Utilities
18  {
25  class DoubleList
26  {
27  public:
28 
35  DoubleList(void) {cursor=head=tail=0;}
36 
43  ~DoubleList(void) {Release();}
44 
45  int AddHead(double d); // add to head of list
46  int AddTail(double d); // add to tail of list
47  int Del(void);
48  void Release(void);
49  double *Iterate(void);
50 
59  double *First(void) {if (head==0) return 0; else return &head->data;}
60 
69  bool IsEmpty() {return head==0;}
70 
79  double GetHead() {return head->data;} // list must not be empty
80 
81  double RemoveHead(); // list must not be empty
82 
83  private:
84  struct listelem {
85  double data;
86  listelem* next;
87  };
89  listelem* head; // pointer to head of list
91  listelem* tail;
93  listelem* cursor;
94  };
95 
96  } //Utilities
97 } //IntegrateFireSim
int Del(void)
Deletes this object.
Definition: DoubleList.cpp:73
double * Iterate(void)
Gets the iterate.
Definition: DoubleList.cpp:108
double * First(void)
Gets the first in the list.
Definition: DoubleList.h:59
DoubleList(void)
Default constructor.
Definition: DoubleList.h:35
int AddTail(double d)
Adds a tail.
Definition: DoubleList.cpp:48
bool IsEmpty()
Query if this object is empty.
Definition: DoubleList.h:69
double RemoveHead()
Removes the head.
Definition: DoubleList.cpp:128
int AddHead(double d)
Adds a head.
Definition: DoubleList.cpp:23
void Release(void)
Releases this object.
Definition: DoubleList.cpp:90
double GetHead()
Gets the head object from this queue.
Definition: DoubleList.h:79
Contains all of the classes to implement a basic integrate and fire neural model. ...