examples/XSpp-Example/src/Dog.cc
raw| 1 | #include "Dog.h" |
| 2 | #include <string> |
| 3 | #include <iostream> |
| 4 | |
| 5 | using namespace std; |
| 6 | |
| 7 | Dog::Dog(const std::string& name) |
| 8 | : Animal(name) |
| 9 | {} |
| 10 | |
| 11 | void |
| 12 | Dog::Bark() |
| 13 | const |
| 14 | { |
| 15 | cout << "Woof" << endl; |
| 16 | } |
| 17 | |
| 18 | void |
| 19 | Dog::MakeSound() |
| 20 | const |
| 21 | { |
| 22 | Bark(); |
| 23 | } |
| 24 | |
| 25 | Dog* |
| 26 | Dog::Clone() |
| 27 | const |
| 28 | { |
| 29 | return new Dog(GetName()); |
| 30 | } |
| 31 | |
| 32 | void |
| 33 | Dog::MakeDogBark(const Dog& d) |
| 34 | { |
| 35 | d.Bark(); |
| 36 | } |
| 37 |