NEURON
htlist.h
Go to the documentation of this file.
1
/*
2
from Unidraw but UList changed to HTList (head tail list)
3
for fast insertion, deletion, iteration
4
*/
5
6
/*
7
* Copyright (c) 1990, 1991 Stanford University
8
*
9
* Permission to use, copy, modify, distribute, and sell this software and its
10
* documentation for any purpose is hereby granted without fee, provided
11
* that the above copyright notice appear in all copies and that both that
12
* copyright notice and this permission notice appear in supporting
13
* documentation, and that the name of Stanford not be used in advertising or
14
* publicity pertaining to distribution of the software without specific,
15
* written prior permission. Stanford makes no representations about
16
* the suitability of this software for any purpose. It is provided "as is"
17
* without express or implied warranty.
18
*
19
* STANFORD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
20
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS.
21
* IN NO EVENT SHALL STANFORD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
22
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
23
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
24
* OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
25
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
26
*/
27
28
/*
29
* UList - list object.
30
*/
31
32
#ifndef htlist_h
33
#define htlist_h
34
35
class
HTList
{
36
public
:
37
HTList
(
void
* =
NULL
);
38
virtual
~HTList
();
39
40
bool
IsEmpty
();
41
void
Append
(
HTList
*);
42
void
Prepend
(
HTList
*);
43
void
Remove
(
HTList
*);
44
void
Remove
();
45
void
RemoveAll
();
46
void
Delete
(
void
*);
47
HTList
*
Find
(
void
*);
48
HTList
*
First
();
49
HTList
*
Last
();
50
HTList
*
End
();
51
HTList
*
Next
();
52
HTList
*
Prev
();
53
54
void
*
vptr
();
55
void
*
operator()
();
56
HTList
*
operator[]
(
int
count);
57
58
protected
:
59
void
*
_object
;
60
HTList
*
_next
;
61
HTList
*
_prev
;
62
};
63
64
inline
bool
HTList::IsEmpty
() {
65
return
_next
==
this
;
66
}
67
inline
HTList
*
HTList::First
() {
68
return
_next
;
69
}
70
inline
HTList
*
HTList::Last
() {
71
return
_prev
;
72
}
73
inline
HTList
*
HTList::End
() {
74
return
this
;
75
}
76
inline
HTList
*
HTList::Next
() {
77
return
_next
;
78
}
79
inline
HTList
*
HTList::Prev
() {
80
return
_prev
;
81
}
82
inline
void
*
HTList::operator()
() {
83
return
_object
;
84
}
85
inline
void
*
HTList::vptr
() {
86
return
_object
;
87
}
88
#endif
HTList
Definition:
htlist.h:35
HTList::Remove
void Remove()
Definition:
htlist.cpp:75
HTList::Find
HTList * Find(void *)
Definition:
htlist.cpp:99
HTList::_object
void * _object
Definition:
htlist.h:59
HTList::Prepend
void Prepend(HTList *)
Definition:
htlist.cpp:62
HTList::Prev
HTList * Prev()
Definition:
htlist.h:79
HTList::IsEmpty
bool IsEmpty()
Definition:
htlist.h:64
HTList::vptr
void * vptr()
Definition:
htlist.h:85
HTList::Last
HTList * Last()
Definition:
htlist.h:70
HTList::First
HTList * First()
Definition:
htlist.h:67
HTList::operator()
void * operator()()
Definition:
htlist.h:82
HTList::~HTList
virtual ~HTList()
Definition:
htlist.cpp:47
HTList::Next
HTList * Next()
Definition:
htlist.h:76
HTList::HTList
HTList(void *=NULL)
Definition:
htlist.cpp:41
HTList::Append
void Append(HTList *)
Definition:
htlist.cpp:55
HTList::_next
HTList * _next
Definition:
htlist.h:60
HTList::_prev
HTList * _prev
Definition:
htlist.h:61
HTList::operator[]
HTList * operator[](int count)
Definition:
htlist.cpp:110
HTList::End
HTList * End()
Definition:
htlist.h:73
HTList::RemoveAll
void RemoveAll()
Definition:
htlist.cpp:84
HTList::Delete
void Delete(void *)
Definition:
htlist.cpp:89
NULL
#define NULL
Definition:
sptree.h:16
src
ivoc
htlist.h