cup.cpp 574 B

123456789101112131415161718192021
  1. #include "cup.hpp"
  2. Cup::Cup(const std::string &name = "Пустая чашка", int content = 0): Container(500, content), m_contentName(name)
  3. {
  4. }
  5. const std::string& Cup::getName() const
  6. {
  7. return m_contentName;
  8. }
  9. void Cup::printCup()
  10. {
  11. std::cout<<*this<<std::endl;
  12. }
  13. std::ostream& operator<<(std::ostream &out, const Cup &cup)
  14. {
  15. out<<"Название напитка"<<"\t"<<cup.m_contentName<<std::endl;
  16. out<<"Размер стакана"<<"\t"<<cup.m_capacity<<std::endl;
  17. out<<"Колличестов напитка"<<"\t"<<cup.m_content<<std::endl;
  18. return out;
  19. }