| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475 |
- /* ************************************************************************** */
- /* */
- /* ::: :::::::: */
- /* AAnimal.cpp :+: :+: :+: */
- /* +:+ +:+ +:+ */
- /* By: bchanot <bchanot@42.fr> +#+ +:+ +#+ */
- /* +#+#+#+#+#+ +#+ */
- /* 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 ---------------------------------
- */
- /* ************************************************************************** */
|