/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* Form.hpp :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: narnaud +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2022/06/26 15:47:12 by narnaud #+# #+# */ /* Updated: 2022/06/27 01:05:27 by narnaud ### ########.fr */ /* */ /* ************************************************************************** */ #pragma once #include "Bureaucrat.hpp" #include #include #include using std::cout; using std::endl; using std::string; class Form { const string _name; const int _signGrade; const int _exeGrade; bool _isSigned; 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 (); } Form(void); Form(const string name, const int signGrade,const int exeGrade) throw (GradeTooHighException, GradeTooLowException); Form & operator=(Form const &f); Form(Form const &f); ~Form(); const string getName(void) const; const int getSignGrade(void) const; const int getExeGrade(void) const; beSigned(Bureaucrat); } std::ostream &operator<< (std::ostream &out, const Form &f) { out << "Form: " << f.getName() << " - Required grade to sign: " << f.getSignGrade() << " - Required grade to execute: " << f.getExeGrade(); return (out); }