FMI Table
| Kamen Mladenov | FMI Computer Science Year 1 Group 6 | Project 2 | Project Topic 7 |
src
Generic
ConsoleInterface
Menu.h
Go to the documentation of this file.
1
#ifndef HEADER_CONSOLEINTERFACE_MENU
2
#define HEADER_CONSOLEINTERFACE_MENU
3
8
#include "
Command.h
"
9
#include "../List/List.hpp"
10
17
class
Menu
{
18
List<Command>
menuOptions;
19
20
public
:
22
Menu
();
24
Menu
(
const
Command
* commands,
unsigned
commandCount);
25
27
void
addCommand
(
const
Command
& command);
28
30
void
navigate
()
const
;
31
};
32
33
#endif
Command.h
Stores the declaration of class Command.
Command
Stores a 256 character name and a function pointer to be executed when calling run()
Definition:
Command.h:12
List< Command >
Menu
Handles navigation between multiple commands.
Definition:
Menu.h:17
Menu::navigate
void navigate() const
Lists commands and after user input executes an appropriate command run() function.
Definition:
Menu.cpp:30
Menu::addCommand
void addCommand(const Command &command)
Adds a command to the internal Command list.
Definition:
Menu.cpp:14
Menu::Menu
Menu(const Command *commands, unsigned commandCount)
Copies commands.
Menu::Menu
Menu()
Sets name as "Menu", leaves all flags to false and creates an empty Command list.
Definition:
Menu.cpp:5
Generated by
1.9.3