You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

58 lines
1.8 KiB

3 years ago
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* Bureaucrat.cpp :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: narnaud <narnaud@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/06/24 13:06:55 by narnaud #+# #+# */
/* Updated: 2022/06/24 17:42:27 by narnaud ### ########.fr */
/* */
/* ************************************************************************** */
#include "Bureaucrat.hpp"
Bureaucrat::Bureaucrat (void) {
cout << "Bureaucrat default constructor called " << endl;
}
Bureaucrat::Bureaucrat (string name, size_t grade) throw (char*): _name(name){
if (grade > 150)
throw Bureaucrat::GradeTooHighException("");
_grade = grade;
cout << "Bureaucrat parameter constructor called" << endl;
}
Bureaucrat::Bureaucrat (Bureaucrat const & src) {
(void)src;
cout << "Bureaucrat copy constructor called" << endl;
}
Bureaucrat & Bureaucrat::operator= (Bureaucrat const & src) {
(void)src;
cout << "Bureaucrat assignment operator called" << endl;
return (*this);
}
Bureaucrat::~Bureaucrat (void) {
cout << "Bureaucrat default destructor called" << endl;
}
string Bureaucrat::getName(void) {
return (_name);
}
size_t Bureaucrat::getGrade(void) {
return (_grade);
}
GTHE::GTHE(void) {
}
std::ostream &operator<< (std::ostream &out, Bureaucrat const &b) {
out << b._name << ", bureaucrat grade " << b._grade << endl;
}