Design Patterns
floppy_disk.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_FLOPPY_DISK_H_
7 #define STRUCTURAL_COMPOSITE_FLOPPY_DISK_H_
8 
9 #include "equipment_interface.h"
10 
11 #include <string>
12 
13 namespace structural
14 {
15 namespace composite
16 {
18 {
19  public:
20  FloppyDisk();
21  explicit FloppyDisk(const std::string&);
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: floppy_disk.cc:41
Currency price() const override
Definition: floppy_disk.cc:21
Currency DiscountPrice() override
Definition: floppy_disk.cc:46
std::string name() const override
Definition: floppy_disk.cc:16
Definition: floppy_disk.h:17
FloppyDisk()
Definition: floppy_disk.cc:14
Watt power() const override
Definition: floppy_disk.cc:31
Definition: equipment_interface.h:18
Definition: watt.h:13