lunch-rest/meal.hpp
2020-09-15 00:55:03 +02:00

49 lines
1.0 KiB
C++

#ifndef LUNCH_REST_MEAL_H
#define LUNCH_REST_MEAL_H
#include <string>
#include <ostream>
namespace LunchRest {
class Meal {
public:
Meal() = default;
Meal(bool soup, const std::string &name, const std::string &desc, int price) :
_isSoup(soup), _name(name), _desc(desc), _price(price) {}
bool isSoup() const {
return _isSoup;
}
const std::string &getName() const {
return _name;
}
const std::string &getDesc() const {
return _desc;
}
int getPrice() const {
return _price;
}
void setName(const std::string &name) {
_name = name;
}
void setPrice(int price) {
_price = price;
}
void setSoup(bool soup = true) {
_isSoup = soup;
}
void setDesc(const std::string &desc) {
_desc = desc;
}
private:
bool _isSoup = false;
std::string _name;
std::string _desc;
int _price;
};
} // end of namespace LunchRest
std::ostream &operator<<(std::ostream &os, const LunchRest::Meal &meal);
#endif