Debian Codegraph @

vendor/Heap-Layers/utility/sllist.h

raw symbols SCIP
1 // -*- C++ -*-cxx . . $ `<file>/vendor/Heap-Layers/utility/sllist.h`/
2
3 /*
4
5 Heap Layers: An Extensible Memory Allocation Infrastructure
6
7 Copyright (C) 2000-2020 by Emery Berger
8 http://www.emeryberger.com
9 [email protected]
10
11 Heap Layers is distributed under the terms of the Apache 2.0 license.
12
13 You may obtain a copy of the License at
14 http://www.apache.org/licenses/LICENSE-2.0
15
16 */
17
18 #ifndef HL_SLLIST_H_
19 #define HL_SLLIST_H_cxx . . $ `vendor/Heap-Layers/utility/sllist.h:19:9`!
20
21 #include <assert.h>
22
23 /**
24 * @class SLList
25 * @brief A "memory neutral" (intrusive) singly-linked list.
26 * @author Emery Berger
27 */
28
29 namespace HLcxx . . $ HL/ {
30
31 class SLListcxx . . $ HL/SLList# {
32 public:
33
34 inline SLListcxx . . $ HL/SLList#SLList(49f6e7a06ebc5aa8).() {
35 clearcxx . . $ HL/SLList#clear(49f6e7a06ebc5aa8).();
36 }
37
38 class Entrycxx . . $ HL/SLList#Entry#;
39
40 /// Clear the list.
41 inline void clearcxx . . $ HL/SLList#clear(49f6e7a06ebc5aa8).() {
42 headcxx . . $ HL/SLList#head..nextcxx . . $ HL/SLList#Entry#next. = nullptr;
43 }
44
45 /// Is the list empty?
46 inline bool isEmptycxx . . $ HL/SLList#isEmpty(50ce9a9e25b4a850).() const {
47 return (headcxx . . $ HL/SLList#head..nextcxx . . $ HL/SLList#Entry#next. == nullptr);
48 }
49
50 /// Get the head of the list.
51 inline Entrycxx . . $ HL/SLList#Entry# * getcxx . . $ HL/SLList#get(cd4c928bab782f74).() {
52 const Entrycxx . . $ HL/SLList#Entry# * e = headcxx . . $ HL/SLList#head..nextcxx . . $ HL/SLList#Entry#next.;
53 if (e == nullptr) {
54 return nullptr;
55 }
56 headcxx . . $ HL/SLList#head..nextcxx . . $ HL/SLList#Entry#next. = e->nextcxx . . $ HL/SLList#Entry#next.;
57 return (Entrycxx . . $ HL/SLList#Entry# *) e;
58 }
59
60 private:
61
62 /**
63 * @brief Remove one item from the list.
64 * @warning This method aborts the program if called.
65 */
66 inline void removecxx . . $ HL/SLList#remove(ba8bd03623f7a3e4). (Entrycxx . . $ HL/SLList#Entry# *) {
67 abortcxx . . $ abort(8df32a62017fbbf6).();
68 }
69
70 public:
71
72 /// Inserts an entry into the head of the list.
73 inline void insertcxx . . $ HL/SLList#insert(5d22bdacc48458e8). (void * ePtr) {
74 Entrycxx . . $ HL/SLList#Entry# * e = (Entrycxx . . $ HL/SLList#Entry# *) ePtr;
75 e->nextcxx . . $ HL/SLList#Entry#next. = headcxx . . $ HL/SLList#head..nextcxx . . $ HL/SLList#Entry#next.;
76 headcxx . . $ HL/SLList#head..nextcxx . . $ HL/SLList#Entry#next. = e;
77 }
78
79 /// An entry in the list.
80 class Entrycxx . . $ HL/SLList#Entry# {
81 public:
82 inline Entrycxx . . $ HL/SLList#Entry#Entry(49f6e7a06ebc5aa8).()
83 : nextcxx . . $ HL/SLList#Entry#next. (nullptr)
84 {}
85 // private:
86 // Entry * prev;
87 public:
88 Entrycxx . . $ HL/SLList#Entry# * nextcxx . . $ HL/SLList#Entry#next.;
89 };
90
91 private:
92
93 /// The head of the list.
94 Entrycxx . . $ HL/SLList#Entry# headcxx . . $ HL/SLList#head.;
95
96 };
97
98 }
99
100 #endif