Design Patterns
card.h
Go to the documentation of this file.
1 // Based on "Design Patterns: Elements of Reusable Object-Oriented Software"
2 // book by Erich Gamma, John Vlissides, Ralph Johnson, and Richard Helm
3 //
4 // Created by Bartosz Rachwal. The National Institute of Advanced Industrial Science and Technology, Japan.
5 
6 #ifndef STRUCTURAL_COMPOSITE_CARD_H_
7 #define STRUCTURAL_COMPOSITE_CARD_H_
8 
9 #include "equipment_interface.h"
10 
11 #include <string>
12 
13 namespace structural
14 {
15 namespace composite
16 {
17 class Card : public EquipmentInterface
18 {
19  public:
20  Card();
21  explicit Card(const std::string& name);
22 
23  std::string name() const override;
24  Currency price() const override;
25  void price(const Currency&) override;
26  Watt power() const override;
27  void power(const Watt&) override;
28  Currency NetPrice() override;
29  Currency DiscountPrice() override;
30 
31  private:
32  std::string name_;
33  Watt power_;
34  Currency price_;
35 };
36 }
37 }
38 
39 #endif
40 
Definition: shape_interface.h:11
Definition: currency.h:13
Currency NetPrice() override
Definition: card.cc:41
std::string name() const override
Definition: card.cc:16
Watt power() const override
Definition: card.cc:31
Currency price() const override
Definition: card.cc:21
Currency DiscountPrice() override
Definition: card.cc:46
Definition: equipment_interface.h:18
Card()
Definition: card.cc:14
Definition: card.h:17
Definition: watt.h:13