Deluge Firmware
1.3.0
Build date: 2026.08.16
Toggle main menu visibility
Loading...
Searching...
No Matches
bidirectional_linked_list.h
1
/*
2
* Copyright © 2017-2023 Synthstrom Audible Limited
3
*
4
* This file is part of The Synthstrom Audible Deluge Firmware.
5
*
6
* The Synthstrom Audible Deluge Firmware is free software: you can redistribute it and/or modify it under the
7
* terms of the GNU General Public License as published by the Free Software Foundation,
8
* either version 3 of the License, or (at your option) any later version.
9
*
10
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
11
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
12
* See the GNU General Public License for more details.
13
*
14
* You should have received a copy of the GNU General Public License along with this program.
15
* If not, see <https://www.gnu.org/licenses/>.
16
*/
17
18
#pragma once
19
20
#include <cstdint>
21
22
class
BidirectionalLinkedList
;
23
24
class
BidirectionalLinkedListNode {
25
public
:
26
BidirectionalLinkedListNode();
27
virtual
~BidirectionalLinkedListNode();
28
29
void
remove();
30
void
insertOtherNodeBefore(BidirectionalLinkedListNode* otherNode);
31
bool
isLast();
32
33
BidirectionalLinkedListNode* next;
// Only valid if list is not NULL, contains jibberish otherwise.
34
BidirectionalLinkedListNode** prevPointer;
// Only valid if list is not NULL, contains jibberish otherwise.
35
BidirectionalLinkedList
* list;
36
};
37
38
class
BidirectionalLinkedList {
39
public
:
40
BidirectionalLinkedList();
41
void
addToEnd(
BidirectionalLinkedListNode
* node);
42
BidirectionalLinkedListNode
* getFirst();
43
BidirectionalLinkedListNode
* getNext(
BidirectionalLinkedListNode
* node);
44
void
test();
45
int32_t getNum();
46
47
BidirectionalLinkedListNode
endNode;
48
BidirectionalLinkedListNode
* first;
49
void
addToStart(
BidirectionalLinkedListNode
* node);
50
};
BidirectionalLinkedListNode
Definition
bidirectional_linked_list.h:24
BidirectionalLinkedList
Definition
bidirectional_linked_list.h:38