/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* Bureaucrat.cpp :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: narnaud +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* 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; }