61 lines
1.8 KiB
C++
61 lines
1.8 KiB
C++
/* ************************************************************************** */
|
|
/* */
|
|
/* ::: :::::::: */
|
|
/* AForm.hpp :+: :+: :+: */
|
|
/* +:+ +:+ +:+ */
|
|
/* By: aortigos <aortigos@student.42malaga.com +#+ +:+ +#+ */
|
|
/* +#+#+#+#+#+ +#+ */
|
|
/* Created: 2026/02/21 12:12:20 by aortigos #+# #+# */
|
|
/* Updated: 2026/02/21 12:12:22 by aortigos ### ########.fr */
|
|
/* */
|
|
/* ************************************************************************** */
|
|
|
|
#ifndef AForm_HPP
|
|
|
|
# define AForm_HPP
|
|
|
|
# include <iostream>
|
|
# include <string>
|
|
|
|
class Bureaucrat;
|
|
|
|
class AForm
|
|
{
|
|
private:
|
|
const std::string name;
|
|
bool isSigned;
|
|
const int gradeToSign;
|
|
const int gradeToExecute;
|
|
|
|
public:
|
|
AForm();
|
|
AForm(const AForm &other);
|
|
AForm& operator=(const AForm &other);
|
|
virtual ~AForm();
|
|
|
|
AForm(std::string name, int gradeToSign, int gradeToExecute);
|
|
|
|
std::string getName() const;
|
|
bool getIsSigned() const;
|
|
int getGradeToSign() const;
|
|
int getGradeToExecute() const;
|
|
|
|
void beSigned(const Bureaucrat &br);
|
|
|
|
virtual void execute(Bureaucrat const &executor) const = 0;
|
|
|
|
class GradeTooLowException : public std::exception {
|
|
public:
|
|
virtual const char *what() const throw();
|
|
};
|
|
|
|
class GradeTooHighException : public std::exception {
|
|
public:
|
|
virtual const char *what() const throw();
|
|
};
|
|
};
|
|
|
|
std::ostream& operator<<(std::ostream &os, const AForm &AForm);
|
|
|
|
#endif
|