]> rtime.felk.cvut.cz Git - l4.git/blob - kernel/fiasco/src/lib/libk/dlist.cpp
Inital import
[l4.git] / kernel / fiasco / src / lib / libk / dlist.cpp
1 INTERFACE:
2
3 class D_list_item
4 {
5 public:
6   D_list_item() : _n(this), _p(this) {}
7
8 private:
9   D_list_item *_n;
10   D_list_item *_p;
11 };
12
13
14 IMPLEMENTATION:
15
16 PUBLIC inline
17 void
18 D_list_item::enqueue_next(D_list_item *i)
19 {
20   i->_p = this;
21   i->_n = _n;
22   _n->_p = i;
23   _n = i;
24 }
25
26 PUBLIC inline
27 void
28 D_list_item::enqueue(D_list_item *i)
29 {
30   i->_n = this;
31   i->_p = _p;
32   _p->_n = i;
33   _p = i;
34 }
35
36 PUBLIC inline
37 void
38 D_list_item::dequeue()
39 {
40   _p->_n = _n;
41   _n->_p = _p;
42   _n = _p = this;
43 }
44
45 PUBLIC inline
46 D_list_item *
47 D_list_item::prev() const
48 { return _p; }
49
50 PUBLIC inline
51 D_list_item *
52 D_list_item::next() const
53 { return _n; }