aboutsummaryrefslogtreecommitdiff
path: root/cpp05/ex02/Bureaucrat.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp05/ex02/Bureaucrat.hpp')
-rw-r--r--cpp05/ex02/Bureaucrat.hpp26
1 files changed, 17 insertions, 9 deletions
diff --git a/cpp05/ex02/Bureaucrat.hpp b/cpp05/ex02/Bureaucrat.hpp
index aabf557..8e44af0 100644
--- a/cpp05/ex02/Bureaucrat.hpp
+++ b/cpp05/ex02/Bureaucrat.hpp
@@ -6,7 +6,7 @@
/* By: charles <charles.cabergs@gmail.com> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/04/14 18:04:32 by charles #+# #+# */
-/* Updated: 2020/10/19 13:23:52 by cacharle ### ########.fr */
+/* Updated: 2020/11/17 13:36:56 by cacharle ### ########.fr */
/* */
/* ************************************************************************** */
@@ -15,6 +15,9 @@
# include <iostream>
# include <exception>
+# include "Form.hpp"
+
+class Form;
class Bureaucrat
{
@@ -25,19 +28,29 @@ public:
Bureaucrat(std::string const& name, int grade);
- std::string const& getName() const;
+ std::string const& getName() const;
int getGrade() const;
void incrementGrade();
void decrementGrade();
+
void signForm(Form& form);
+ void executeForm(Form& form);
+
+private:
+ Bureaucrat();
+ void checkGrade();
+
+ std::string m_name;
+ int m_grade;
+
class GradeTooHighException : public std::exception
{
public:
GradeTooHighException();
GradeTooHighException(GradeTooHighException const& other);
GradeTooHighException& operator=(GradeTooHighException const& other);
- ~GradeTooHighException();
+ ~GradeTooHighException() throw();
virtual char const* what() const throw();
};
@@ -47,15 +60,10 @@ public:
GradeTooLowException();
GradeTooLowException(GradeTooLowException const& other);
GradeTooLowException& operator=(GradeTooLowException const& other);
- ~GradeTooLowException();
+ ~GradeTooLowException() throw();
virtual char const* what() const throw();
};
-private:
- Bureaucrat();
-
- std::string const m_name;
- int m_grade;
};
std::ostream& operator<<(std::ostream& out, Bureaucrat const& b);