57 lines
1.7 KiB
C++
57 lines
1.7 KiB
C++
/* ************************************************************************** */
|
|
/* */
|
|
/* ::: :::::::: */
|
|
/* Form.hpp :+: :+: :+: */
|
|
/* +:+ +:+ +:+ */
|
|
/* By: aortigos <aortigos@student.42malaga.com +#+ +:+ +#+ */
|
|
/* +#+#+#+#+#+ +#+ */
|
|
/* Created: 2026/02/21 12:11:23 by aortigos #+# #+# */
|
|
/* Updated: 2026/02/21 12:11:30 by aortigos ### ########.fr */
|
|
/* */
|
|
/* ************************************************************************** */
|
|
|
|
#ifndef FORM_HPP
|
|
|
|
# define FORM_HPP
|
|
|
|
# include <iostream>
|
|
# include "../Bureaucrat/Bureaucrat.hpp"
|
|
|
|
class Form
|
|
{
|
|
private:
|
|
const std::string name;
|
|
bool isSigned;
|
|
const int gradeToSign;
|
|
const int gradeToExecute;
|
|
|
|
public:
|
|
Form();
|
|
Form(const Form &other);
|
|
Form& operator=(const Form &other);
|
|
~Form();
|
|
|
|
Form(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);
|
|
|
|
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 Form &form);
|
|
|
|
#endif
|