1
0

🔨」 fix: fixed Form class from ex01

This commit is contained in:
2025-04-01 11:09:10 +02:00
parent d56e8011de
commit 9e85ca79d9
16 changed files with 204 additions and 74 deletions

View File

@ -1,12 +1,12 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* Form.hpp :+: :+: :+: */
/* AForm.hpp :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/03/08 20:10:59 by adjoly #+# #+# */
/* Updated: 2025/03/30 15:11:58 by adjoly ### ########.fr */
/* Updated: 2025/04/01 11:03:13 by adjoly ### ########.fr */
/* */
/* ************************************************************************** */
@ -20,13 +20,15 @@ void _log(std::string emoji, std::string what, std::string who,
typedef unsigned char uint8_t;
#include "Bureaucrat.hpp"
//class Bureaucrat;
class Form {
class AForm {
public:
Form(void);
Form(std::string name, uint8_t minForSign, uint8_t minForExec);
~Form(void);
AForm(void);
AForm(std::string name, uint8_t minForSign, uint8_t minForExec);
AForm(const AForm &);
virtual ~AForm(void);
AForm &operator=(const AForm &);
class GradeTooHighException : public std::exception {
public:
@ -36,6 +38,10 @@ class Form {
public:
virtual const char *what() const throw();
};
class NotSigned : public std::exception {
public:
virtual const char *what() const throw();
};
std::string getName(void) const;
bool getSigned(void) const;
@ -43,12 +49,16 @@ class Form {
uint8_t getMinForExec(void) const;
void beSigned(Bureaucrat);
void execute(const Bureaucrat &) const;
private:
const std::string _name;
bool _signed;
const uint8_t _minForSign;
const uint8_t _minForExec;
std::string _name;
bool _signed;
const uint8_t _minForSign;
const uint8_t _minForExec;
virtual void _exec(const Bureaucrat &) const = 0;
void _gradeCheck(void) const;
};
std::ostream &operator<<(std::ostream &, Form &);