1
0
This repository has been archived on 2025-01-26. You can view files and clone it, but cannot push or open issues or pull requests.
CPP_Module_04/ex02/AAnimal.cpp

43 lines
1.5 KiB
C++
Raw Permalink Normal View History

2024-12-06 16:24:15 +01:00
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* AAnimal.cpp :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/12/01 19:14:27 by adjoly #+# #+# */
/* Updated: 2024/12/06 16:23:53 by adjoly ### ########.fr */
/* */
/* ************************************************************************** */
#include "AAnimal.hpp"
AAnimal::AAnimal(void) {
log("", "AAnimal", "", "construtor called");
}
AAnimal::~AAnimal() {
log("", "AAnimal", _type, "destructor called");
}
AAnimal::AAnimal(std::string type) : _type(type) {
log("", "AAnimal", type, "construtor called");
}
AAnimal::AAnimal(const AAnimal &cpy) {
log("", "AAnimal", _type, "copy construtor called");
*this = cpy;
}
AAnimal &AAnimal::operator=(const AAnimal &cpy) {
log("🟰", "AAnimal", _type, "copy assignment construtor called");
if (this != &cpy) {
_type = cpy._type;
}
return (*this);
}
std::string AAnimal::getType(void) const {
return (_type);
}