-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAForm.hpp
More file actions
66 lines (54 loc) · 2.04 KB
/
AForm.hpp
File metadata and controls
66 lines (54 loc) · 2.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* AForm.hpp :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: zelhajou <zelhajou@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/12/25 18:22:04 by zelhajou #+# #+# */
/* Updated: 2024/12/30 16:37:59 by zelhajou ### ########.fr */
/* */
/* ************************************************************************** */
#ifndef AFORM_HPP
#define AFORM_HPP
#include <string>
#include <iostream>
class Bureaucrat;
class AForm
{
private:
const std::string _name;
bool _isSigned;
const int _gradeToSign;
const int _gradeToExecute;
public:
AForm();
AForm(const std::string &name, int gradeToSign, int gradeToExecute);
AForm(const AForm &src);
virtual ~AForm();
AForm &operator=(const AForm &src);
const std::string &getName() const;
bool getIsSigned() const;
int getGradeToSign() const;
int getGradeToExecute() const;
void beSigned(const Bureaucrat &bureaucrat);
virtual void execute(Bureaucrat const &executor) const = 0;
void checkExecution(Bureaucrat const &executor) const;
class GradeTooHighException : public std::exception
{
public:
virtual const char *what() const throw();
};
class GradeTooLowException : public std::exception
{
public:
virtual const char *what() const throw();
};
class FormNotSignedException : public std::exception
{
public:
virtual const char *what() const throw();
};
};
std::ostream &operator<<(std::ostream &os, const AForm &form);
#endif