-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathPancakeHouseMenu.h
64 lines (55 loc) · 1.42 KB
/
PancakeHouseMenu.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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#ifndef PANCAKE_HOUSE_MENU_H
#define PANCAKE_HOUSE_MENU_H
#include "MenuItem.h"
#include "PancakeHouseMenuIterator.h"
#include <list>
#include <ostream>
#include <memory>
#include <string>
class PancakeHouseMenu {
public:
PancakeHouseMenu();
std::string getMenuDescription() const { return menuDesciption; }
void addItem(std::string_view, std::string_view, bool, double);
std::unique_ptr<Iterator<MenuItem>> createIterator() {
return std::make_unique<PancakeHouseMenuIterator>(menuItems); }
private:
std::string menuDesciption = "Objectville Pancake House Menu";
std::list<MenuItem> menuItems = {};
};
inline
PancakeHouseMenu::PancakeHouseMenu()
{
addItem("K&B's Pancake Breakfast",
"Pancakes with scrambled eggs and toast",
true,
2.99);
addItem("Regular Pancake Breakfast",
"Pancakes with fried eggs, sausage",
false,
2.99);
addItem("Blueberry Pancakes",
"Pancakes made with fresh blueberries",
true,
3.49);
addItem("Waffles",
"Waffles with your choice of blueberries or strawberries",
true,
3.59);
}
inline
void
PancakeHouseMenu::addItem(std::string_view name, std::string_view desciption,
bool vegitarian, double price)
{
auto menuItem = MenuItem(name, desciption, vegitarian, price);
menuItems.push_back(menuItem);
}
inline
std::ostream&
operator<<(std::ostream &os, const PancakeHouseMenu &menu)
{
os << menu.getMenuDescription();
return os;
}
#endif /* PANCAKE_HOUSE_MENU_H */