-
Notifications
You must be signed in to change notification settings - Fork 0
/
MenuComponent.h
34 lines (30 loc) · 1.36 KB
/
MenuComponent.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#ifndef MENU_COMPONENT_H
#define MENU_COMPONENT_H
#include <stdexcept>
#include <list>
#include <memory>
template <typename T> class Iterator; // template declaration
class MenuComponent {
public:
using menu_component_iterator = Iterator<MenuComponent>*;
using menu_component_t = MenuComponent *;
virtual ~MenuComponent() = default;
virtual menu_component_iterator createIterator() = 0;
virtual void add([[maybe_unused]]menu_component_t menuComponent) {
throw std::invalid_argument("add(): Unsupported Operation"); }
virtual void remove([[maybe_unused]]menu_component_t menuComponent) {
throw std::invalid_argument("remove(): Unsupported Operation"); }
virtual MenuComponent* getChid([[maybe_unused]]int i) const {
throw std::invalid_argument("getChid(): Unsupported Operation"); }
virtual std::string getName() const {
throw std::invalid_argument("getName(): Unsupported Operation"); }
virtual std::string getDescription() const {
throw std::invalid_argument("getDescription(): Unsupported Operation"); }
virtual double getPrice() const {
throw std::invalid_argument("getPrice(): Unsupported Operation"); }
virtual bool isVegetarian() const {
throw std::invalid_argument("isVegetarian(): Unsupported Operation"); }
virtual void print() const {
throw std::invalid_argument("print(): Unsupported Operation"); }
};
#endif /* MENU_COMPONENT_H */