/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* AForm.hpp :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: bchanot +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2025/12/29 16:42:01 by bchanot #+# #+# */ /* Updated: 2025/12/31 16:04:33 by bchanot ### ########.fr */ /* */ /* ************************************************************************** */ #ifndef AFORM_HPP # define AFORM_HPP # include # include # include class Bureaucrat; class AForm { public: AForm(); AForm( AForm const & src ); AForm( std::string const name, uint8_t const signGrade, uint8_t const executeGradea, std::string target ); virtual ~AForm(); AForm & operator=( AForm const & rhs ); virtual void print(std::ostream & o) const; class GradeTooHighException : public std::exception { public: virtual const char *what() const throw() { return ("The grade specified is too high !"); } }; class GradeTooLowException : public std::exception { public: virtual const char *what() const throw() { return ("The grade specified is too low !"); } }; std::string const getName(void) const; std::string const getTarget(void) const; uint8_t getSignGrade(void) const; uint8_t getExecutionGrade(void) const; bool getSigned(void) const; void beSigned(const Bureaucrat &sch); void execute(Bureaucrat const & executor) const; protected: virtual void action(void) const = 0; std::string _target; private: std::string const _name; uint8_t const _signGrade; uint8_t const _executeGrade; bool _signed; }; std::ostream & operator<<( std::ostream & o, AForm const & i ); #endif /* ************************************************************ AFORM_H */