Dog.cpp 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. /* ************************************************************************** */
  2. /* */
  3. /* ::: :::::::: */
  4. /* Dog.cpp :+: :+: :+: */
  5. /* +:+ +:+ +:+ */
  6. /* By: bchanot <bchanot@42.fr> +#+ +:+ +#+ */
  7. /* +#+#+#+#+#+ +#+ */
  8. /* Created: 2025/12/18 16:27:49 by bchanot #+# #+# */
  9. /* Updated: 2025/12/18 16:49:00 by bchanot ### ########.fr */
  10. /* */
  11. /* ************************************************************************** */
  12. #include "Dog.hpp"
  13. /*
  14. ** ------------------------------- CONSTRUCTOR --------------------------------
  15. */
  16. Dog::Dog() : Animal("Dog")
  17. {
  18. std::cout << "A Dog is born !" << std::endl;
  19. }
  20. Dog::Dog( const Dog & src ) : Animal(src)
  21. {
  22. std::cout << "A " << this->type << " is born !" << std::endl;
  23. }
  24. /*
  25. ** -------------------------------- DESTRUCTOR --------------------------------
  26. */
  27. Dog::~Dog()
  28. {
  29. std::cout << "A " << this->type << "has died ..." << std::endl;
  30. }
  31. /*
  32. ** --------------------------------- OVERLOAD ---------------------------------
  33. */
  34. Dog & Dog::operator=( Dog const & rhs )
  35. {
  36. (void)rhs;
  37. //if ( this != &rhs )
  38. //{
  39. //this->_value = rhs.getValue();
  40. //}
  41. return *this;
  42. }
  43. std::ostream & operator<<( std::ostream & o, Dog const & i )
  44. {
  45. (void)i;
  46. //o << "Value = " << i.getValue();
  47. return o;
  48. }
  49. /*
  50. ** --------------------------------- METHODS ----------------------------------
  51. */
  52. void Dog::makeSound(void) const {
  53. std::cout << "*Waf Waf*" << std::endl;
  54. }
  55. /*
  56. ** --------------------------------- ACCESSOR ---------------------------------
  57. */
  58. /* ************************************************************************** */