DCC-EX Simple Throttle
Simple throttle for a DCC-EX CommandStation
Loading...
Searching...
No Matches
/home/runner/work/DCCEXSimpleThrottle/DCCEXSimpleThrottle/BaseMenuItem.h
Go to the documentation of this file.
1
/*
2
* © 2024 Peter Cole
3
* © 2023 Peter Cole
4
*
5
* This is free software: you can redistribute it and/or modify
6
* it under the terms of the GNU General Public License as published by
7
* the Free Software Foundation, either version 3 of the License, or
8
* (at your option) any later version.
9
*
10
* It is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
* GNU General Public License for more details.
14
*
15
* You should have received a copy of the GNU General Public License
16
* along with this code. If not, see <https://www.gnu.org/licenses/>.
17
*/
18
19
#ifndef BASEMENUITEM_H
20
#define BASEMENUITEM_H
21
22
#include <Arduino.h>
23
28
class
BaseMenuItem
{
29
public
:
32
BaseMenuItem
(
const
char
*name);
33
36
const
char
*
getName
();
37
40
void
setNext
(
BaseMenuItem
*item);
41
44
BaseMenuItem
*
getNext
();
45
48
void
setIndex
(uint8_t index);
49
52
uint8_t
getIndex
();
53
54
private
:
55
const
char
*
_name
;
// pointer to the char array containing the name
56
uint8_t
_index
;
// index of this menu item
57
BaseMenuItem
*
_next
;
// pointer to the next menu item
58
};
59
60
#endif
// MENU_H
BaseMenuItem
Base class for all menu item types, and all menu item types must inherit from this....
Definition
BaseMenuItem.h:28
BaseMenuItem::setNext
void setNext(BaseMenuItem *item)
Set the next menu item.
Definition
BaseMenuItem.cpp:31
BaseMenuItem::_next
BaseMenuItem * _next
Definition
BaseMenuItem.h:57
BaseMenuItem::_name
const char * _name
Definition
BaseMenuItem.h:55
BaseMenuItem::getIndex
uint8_t getIndex()
Get the index of this item.
Definition
BaseMenuItem.cpp:37
BaseMenuItem::getNext
BaseMenuItem * getNext()
Get the next menu item.
Definition
BaseMenuItem.cpp:33
BaseMenuItem::setIndex
void setIndex(uint8_t index)
Set the index of this menu item.
Definition
BaseMenuItem.cpp:35
BaseMenuItem::_index
uint8_t _index
Definition
BaseMenuItem.h:56
BaseMenuItem::getName
const char * getName()
Get menu item name.
Definition
BaseMenuItem.cpp:29
Generated by
1.9.8