/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* AAnimal.cpp :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: bchanot +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2025/12/18 16:26:41 by bchanot #+# #+# */ /* Updated: 2025/12/18 18:47:20 by bchanot ### ########.fr */ /* */ /* ************************************************************************** */ #include "AAnimal.hpp" /* ** ------------------------------- CONSTRUCTOR -------------------------------- */ AAnimal::AAnimal() : type("Default") { std::cout << "An animal type Default is born." << std::endl; } AAnimal::AAnimal( std::string const & type ) : type(type) { std::cout << "An animal type " << this->type << " Is born." << std::endl; } AAnimal::AAnimal( const AAnimal & src ) : type(src.type) { std::cout << "An animal type " << this->type << " Is born." << std::endl; } /* ** -------------------------------- DESTRUCTOR -------------------------------- */ AAnimal::~AAnimal() { std::cout << "An animal type " << this->type << " has died..." << std::endl; } /* ** --------------------------------- OVERLOAD --------------------------------- */ AAnimal & AAnimal::operator=( AAnimal const & rhs ) { if ( this != &rhs ) { this->type = rhs.type; } return *this; } std::ostream & operator<<( std::ostream & o, AAnimal const & i ) { (void)i; //o << "Value = " << i.getValue(); return o; } /* ** --------------------------------- METHODS ---------------------------------- */ /* ** --------------------------------- ACCESSOR --------------------------------- */ /* ************************************************************************** */