Cat.cpp 2.0 KB

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