FACT++
1.0
Main Page
Related Pages
Namespaces
Classes
Files
Examples
File List
File Members
dllist.hxx
Go to the documentation of this file.
1
#ifndef __DLLHHDEFS
2
#define __DLLHHDEFS
3
4
class
DllExp
DLLItem
{
5
friend
class
DLList
;
6
DLLItem
*
next
;
7
DLLItem
*
prev
;
8
public
:
9
DLLItem
(){
10
next = 0;
11
prev = 0;
12
};
13
};
14
15
class
DllExp
DLList
{
16
DLLItem
*
head
;
17
DLLItem
*
curr
;
18
public
:
19
DLList
(){
20
DISABLE_AST
21
head =
new
DLLItem
();
22
head->next = head;
23
head->prev = head;
24
curr = head;
25
ENABLE_AST
26
}
27
~DLList
()
28
{
29
DISABLE_AST
30
delete
head;
31
ENABLE_AST
32
}
33
void
add
(
DLLItem
*
item
)
34
{
35
DLLItem
*prevp;
36
DISABLE_AST
37
item->
next
= head;
38
prevp = head->
prev
;
39
item->
prev
= prevp;
40
prevp->
next
= item;
41
head->
prev
= item;
42
ENABLE_AST
43
}
44
DLLItem
*
getHead
()
45
{
46
DISABLE_AST
47
if
(head->
next
== head)
48
{
49
ENABLE_AST
50
return
((
DLLItem
*)0);
51
}
52
curr = head->
next
;
53
ENABLE_AST
54
return
( head->
next
);
55
}
56
DLLItem
*
getLast
()
57
{
58
DISABLE_AST
59
if
(head->
prev
== head)
60
{
61
ENABLE_AST
62
return
((
DLLItem
*)0);
63
}
64
curr = head->
prev
;
65
ENABLE_AST
66
return
( head->
prev
);
67
}
68
DLLItem
*
getNext
()
69
{
70
DISABLE_AST
71
curr = curr->
next
;
72
if
(curr == head)
73
{
74
ENABLE_AST
75
return
((
DLLItem
*)0);
76
}
77
ENABLE_AST
78
return
( curr );
79
}
80
DLLItem
*
removeHead
()
81
{
82
DLLItem
*
item
;
83
DISABLE_AST
84
item = head->
next
;
85
if
(item == head)
86
{
87
ENABLE_AST
88
return
((
DLLItem
*)0);
89
}
90
remove
(item);
91
ENABLE_AST
92
return
(item);
93
}
94
void
remove
(
DLLItem
*
item
)
95
{
96
DLLItem
*prevp, *nextp;
97
DISABLE_AST
98
prevp =
item
->prev;
99
nextp =
item
->
next
;
100
prevp->
next
=
item
->
next
;
101
nextp->
prev
= prevp;
102
ENABLE_AST
103
}
104
};
105
#endif
DLList::getHead
DLLItem * getHead()
Definition:
dllist.hxx:44
item
Definition:
did.h:42
DLList
Definition:
dllist.hxx:15
DLLItem::next
DLLItem * next
Definition:
dllist.hxx:6
DLList::~DLList
~DLList()
Definition:
dllist.hxx:27
DLList::head
DLLItem * head
Definition:
dllist.hxx:16
DllExp
#define DllExp
Definition:
dim_common.h:93
DLList::DLList
DLList()
Definition:
dllist.hxx:19
item::next
struct item * next
Definition:
did.h:43
DLList::getNext
DLLItem * getNext()
Definition:
dllist.hxx:68
DLLItem::prev
DLLItem * prev
Definition:
dllist.hxx:7
DLList::curr
DLLItem * curr
Definition:
dllist.hxx:17
DLList::getLast
DLLItem * getLast()
Definition:
dllist.hxx:56
DLList::removeHead
DLLItem * removeHead()
Definition:
dllist.hxx:80
DLLItem
Definition:
dllist.hxx:4
DLList::add
void add(DLLItem *item)
Definition:
dllist.hxx:33
DLLItem::DLLItem
DLLItem()
Definition:
dllist.hxx:9
dim
dim
dllist.hxx
Generated on Sun Sep 18 2016 20:50:17 for FACT++ by
1.8.11