d04 ex00 gestion virtual destructor et ajout messages constructors et destructors

This commit is contained in:
Hugo LAMY
2022-02-24 17:59:05 +01:00
parent ba3b88f0bf
commit 3cdc4ec436
29 changed files with 570 additions and 0 deletions

46
d04/ex00/Dog.cpp Normal file
View File

@@ -0,0 +1,46 @@
#include "Dog.hpp"
#define COPLIEN_COLOR B_CYAN
/*********************************************
* CONSTRUCTORS
*********************************************/
Dog::Dog() {
std::cout << COPLIEN_COLOR "Dog constructor" RESET "\n";
type = "dog";
return;
}
Dog::Dog( Dog const & src ) {
std::cout << COPLIEN_COLOR "Dog copy constructor" RESET "\n";
*this = src;
return;
}
/*********************************************
* DESTRUCTORS
*********************************************/
Dog::~Dog() {
std::cout << COPLIEN_COLOR "Dog destructor" RESET "\n";
return;
}
/*********************************************
* OPERATORS
*********************************************/
Dog & Dog::operator=( Dog const & rhs ) {
Animal::operator=(rhs);
return *this;
}
/*********************************************
* PUBLIC MEMBER FUNCTIONS
*********************************************/
void Dog::makeSound() const {
std::cout << "*woof*\n";
}