-
Notifications
You must be signed in to change notification settings - Fork 131
Expand file tree
/
Copy pathSingleLinkList.h
More file actions
62 lines (50 loc) · 1.42 KB
/
SingleLinkList.h
File metadata and controls
62 lines (50 loc) · 1.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#ifndef singlelinklist_h
#define singlelinklist_h
/*
* NIST STEP Core Class Library
* clstepcore/SingleLinkList.h
* April 1997
* David Sauder
* KC Morris
* Development of this software was funded by the United States Government,
* and is not subject to copyright.
*/
#include <sc_export.h>
/** Base class for a singly-linked list.
* \sa SingleLinkNode
*
* node which represents the value is contained in the subclass
* since it may have different types for different lists
*/
class SC_CORE_EXPORT SingleLinkList {
protected:
class SingleLinkNode * head;
SingleLinkNode * tail;
public:
virtual SingleLinkNode * NewNode();
virtual void AppendNode( SingleLinkNode * );
virtual void DeleteNode( SingleLinkNode * );
virtual void Empty();
virtual void DeleteFollowingNodes( SingleLinkNode * );
virtual SingleLinkNode * GetHead() const;
int EntryCount() const;
SingleLinkList();
virtual ~SingleLinkList();
};
/** Base class for nodes of a single-linked list.
* \sa SingleLinkList
*/
class SC_CORE_EXPORT SingleLinkNode {
friend class SingleLinkList;
public:
SingleLinkList * owner;
SingleLinkNode * next;
virtual SingleLinkNode * NextNode() const {
return next;
}
SingleLinkNode() : owner( 0 ), next( 0 ) {
}
virtual ~SingleLinkNode() {
}
};
#endif