/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* Bureaucrat.hpp :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: narnaud +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2022/06/24 13:06:55 by narnaud #+# #+# */ /* Updated: 2022/06/26 16:00:43 by narnaud ### ########.fr */ /* */ /* ************************************************************************** */ #pragma once #include #include #include using std::cout; using std::endl; using std::string; class Bureaucrat { const string _name; int _grade; public: class GradeTooHighException : virtual public std::exception { public: const char *what(void) const throw(); }; class GradeTooLowException : virtual public std::exception { public: const char *what(void) const throw(); }; Bureaucrat(void); Bureaucrat(const string name, int grade) throw(GradeTooHighException, GradeTooLowException); Bureaucrat(Bureaucrat const &src); ~Bureaucrat(void); Bureaucrat &operator=(Bureaucrat const &src); const string getName(void) const; int getGrade(void) const; void incrGrade(int diff = 1) throw(GradeTooHighException); void decrGrade(int diff = 1) throw(GradeTooLowException); }; std::ostream &operator<<(std::ostream &out, Bureaucrat const &b);