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