CUBRID Engine
latest
Main Page
Namespaces
Classes
Files
File List
File Members
freesllist.h
Go to the documentation of this file.
1
// -*- C++ -*-
2
3
#ifndef HL_FREESLLIST_H_
4
#define HL_FREESLLIST_H_
5
6
#include <assert.h>
7
17
class
FreeSLList
{
18
public
:
19
20
inline
void
clear
(
void
) {
21
head
.
next
=
NULL
;
22
}
23
24
class
Entry
;
25
27
inline
Entry
*
get
(void) {
28
const
Entry
* e =
head
.
next
;
29
if
(e ==
NULL
) {
30
return
NULL
;
31
}
32
head
.
next
= e->
next
;
33
return
const_cast<
Entry
*
>
(e);
34
}
35
36
inline
Entry
*
remove
(void) {
37
const
Entry
* e =
head
.
next
;
38
if
(e ==
NULL
) {
39
return
NULL
;
40
}
41
head
.
next
= e->
next
;
42
return
const_cast<
Entry
*
>
(e);
43
}
44
45
inline
void
insert
(
void
* e) {
46
Entry
* entry =
reinterpret_cast<
Entry
*
>
(e);
47
entry->
next
=
head
.
next
;
48
head
.
next
= entry;
49
}
50
51
class
Entry
{
52
public
:
53
Entry
(
void
)
54
:
next
(
NULL
)
55
{}
56
Entry
*
next
;
57
private
:
58
Entry
(
const
Entry
&);
59
Entry
&
operator=
(
const
Entry
&);
60
};
61
62
private
:
63
Entry
head
;
64
};
65
66
67
#endif
68
69
70
71
FreeSLList::Entry::next
Entry * next
Definition:
freesllist.h:56
FreeSLList::insert
void insert(void *e)
Definition:
freesllist.h:45
FreeSLList::head
Entry head
Definition:
freesllist.h:63
FreeSLList::Entry
Definition:
freesllist.h:51
FreeSLList::Entry::operator=
Entry & operator=(const Entry &)
NULL
#define NULL
Definition:
freelistheap.h:34
FreeSLList::Entry::Entry
Entry(void)
Definition:
freesllist.h:53
FreeSLList::clear
void clear(void)
Definition:
freesllist.h:20
FreeSLList
A "memory neutral" singly-linked list,.
Definition:
freesllist.h:17
src
heaplayers
utility
freesllist.h
Generated by
1.8.11