44 lines
885 B
C++
44 lines
885 B
C++
#pragma once
|
|
|
|
#include "Bureaucrat.hpp"
|
|
|
|
class Bureaucrat;
|
|
|
|
class AForm {
|
|
public:
|
|
class GradeTooHighException : public std::exception {
|
|
public:
|
|
char const* what() const throw();
|
|
};
|
|
|
|
class GradeTooLowException : public std::exception {
|
|
public:
|
|
char const* what() const throw();
|
|
};
|
|
|
|
AForm();
|
|
AForm(std::string name, int grade, int gradeExec);
|
|
virtual ~AForm();
|
|
AForm(const AForm &form);
|
|
AForm &operator=(const AForm &form);
|
|
|
|
std::string getName() const;
|
|
std::string getTarget() const;
|
|
bool isSigned() const;
|
|
int getGrade() const;
|
|
int getGradeExec() const;
|
|
|
|
void beSigned(Bureaucrat &crat);
|
|
void execute(Bureaucrat &crat);
|
|
virtual void executeAction() = 0;
|
|
|
|
private:
|
|
const std::string name;
|
|
std::string target;
|
|
bool sign;
|
|
const int grade;
|
|
const int gradeExec;
|
|
};
|
|
|
|
std::ostream& operator<<(std::ostream& os, AForm const& form);
|