This commit is contained in:
Alexandre POMMIER 2022-08-03 13:23:09 +02:00
parent 7afa19456d
commit 0b636410b3
7 changed files with 30 additions and 26 deletions

View File

@ -25,7 +25,7 @@ class AForm{
AForm(int signedGrade, int executionGrade, std::string name); AForm(int signedGrade, int executionGrade, std::string name);
AForm(const AForm& copy); AForm(const AForm& copy);
~AForm(); virtual ~AForm() = 0;
AForm &operator=(const AForm& rhs); AForm &operator=(const AForm& rhs);
const std::string getName() const; const std::string getName() const;
@ -33,7 +33,7 @@ class AForm{
int getExecutionGrade() const; int getExecutionGrade() const;
int getIsSigned() const; int getIsSigned() const;
void checkGrade() const = 0; void checkGrade() const;
void beSigned(Bureaucrat &bureaucrat); void beSigned(Bureaucrat &bureaucrat);

View File

@ -6,7 +6,7 @@
/* By: apommier <apommier@student.42.fr> +#+ +:+ +#+ */ /* By: apommier <apommier@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2022/07/18 21:34:42 by apommier #+# #+# */ /* Created: 2022/07/18 21:34:42 by apommier #+# #+# */
/* Updated: 2022/07/22 11:13:32 by apommier ### ########.fr */ /* Updated: 2022/08/02 18:18:19 by apommier ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */
@ -74,7 +74,7 @@ void Bureaucrat::checkGrade() const
throw Bureaucrat::GradeTooHighException(); throw Bureaucrat::GradeTooHighException();
} }
void Bureaucrat::signForm(Form form) void Bureaucrat::signForm(AForm form)
{ {
try try
{ {

View File

@ -6,7 +6,7 @@
/* By: apommier <apommier@student.42.fr> +#+ +:+ +#+ */ /* By: apommier <apommier@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2022/07/18 21:34:43 by apommier #+# #+# */ /* Created: 2022/07/18 21:34:43 by apommier #+# #+# */
/* Updated: 2022/07/19 12:52:52 by apommier ### ########.fr */ /* Updated: 2022/08/02 18:19:30 by apommier ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */
@ -16,9 +16,9 @@
# include <ostream> # include <ostream>
# include <string> # include <string>
# include <iostream> # include <iostream>
# include "Form.hpp" # include "AForm.hpp"
class Form; class AForm;
class Bureaucrat{ class Bureaucrat{
public: public:
@ -34,7 +34,7 @@ class Bureaucrat{
void downGrade(); void downGrade();
void checkGrade() const; void checkGrade() const;
void signForm(Form form); void signForm(AForm form);
class GradeTooLowException : public std::exception class GradeTooLowException : public std::exception
{ {

View File

@ -6,14 +6,18 @@
# By: apommier <apommier@student.42.fr> +#+ +:+ +#+ # # By: apommier <apommier@student.42.fr> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ # # +#+#+#+#+#+ +#+ #
# Created: 2022/07/18 21:34:54 by apommier #+# #+# # # Created: 2022/07/18 21:34:54 by apommier #+# #+# #
# Updated: 2022/07/22 07:48:18 by apommier ### ########.fr # # Updated: 2022/08/02 18:19:14 by apommier ### ########.fr #
# # # #
# **************************************************************************** # # **************************************************************************** #
NAME = a.out NAME = a.out
SRCS = main.cpp\ SRCS = main.cpp\
Bureaucrat.cpp\ Bureaucrat.cpp\
Form.cpp AForm.cpp\
PresidentialPardonForm.cpp\
RobotomyRequestForm.cpp\
ShrubberyCreationForm.cpp
OBJS = ${SRCS:.cpp=.o} OBJS = ${SRCS:.cpp=.o}
CC = c++ CC = c++

View File

@ -6,28 +6,28 @@
/* By: apommier <apommier@student.42.fr> +#+ +:+ +#+ */ /* By: apommier <apommier@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2022/07/23 12:16:26 by apommier #+# #+# */ /* Created: 2022/07/23 12:16:26 by apommier #+# #+# */
/* Updated: 2022/07/23 12:35:33 by apommier ### ########.fr */ /* Updated: 2022/08/02 18:22:30 by apommier ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */
#include "PresidentialPardonForm.cpp" #include "PresidentialPardonForm.hpp"
PresidentialPardonForm() PresidentialPardonForm::PresidentialPardonForm()
{ {
} }
PresidentialPardonForm(const PresidentialPardonForm& copy) PresidentialPardonForm::PresidentialPardonForm(const PresidentialPardonForm& copy)
{ {
} }
~PresidentialPardonForm() PresidentialPardonForm::~PresidentialPardonForm()
{ {
} }
PresidentialPardonForm &operator=(const PresidentialPardonForm& rhs) PresidentialPardonForm &PresidentialPardonForm::operator=(const PresidentialPardonForm& rhs)
{ {
} }

View File

@ -5,8 +5,8 @@
/* +:+ +:+ +:+ */ /* +:+ +:+ +:+ */
/* By: apommier <apommier@student.42.fr> +#+ +:+ +#+ */ /* By: apommier <apommier@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2022/07/23 12:16:28 by apommier #+# #+# */ /* Created: 2022/08/02 18:21:41 by apommier #+# #+# */
/* Updated: 2022/07/23 13:43:32 by apommier ### ########.fr */ /* Updated: 2022/08/02 18:21:44 by apommier ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */
@ -18,10 +18,10 @@
class PresidentialPardonForm : public AForm{ class PresidentialPardonForm : public AForm{
public : public :
PresidentialPardonForm(); PresidentialPardonForm();
PresidentialPardonForm(const PresidentialPardonForm& copy); PresidentialPardonForm(const PresidentialPardonForm& copy);
~PresidentialPardonForm(); ~PresidentialPardonForm();
PresidentialPardonForm &operator=(const PresidentialPardonForm& rhs); PresidentialPardonForm &operator=(const PresidentialPardonForm& rhs);
private : private :
}; };

View File

@ -6,11 +6,11 @@
/* By: apommier <apommier@student.42.fr> +#+ +:+ +#+ */ /* By: apommier <apommier@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2022/07/18 21:34:45 by apommier #+# #+# */ /* Created: 2022/07/18 21:34:45 by apommier #+# #+# */
/* Updated: 2022/07/19 12:42:13 by apommier ### ########.fr */ /* Updated: 2022/08/02 18:04:36 by apommier ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */
#include "Form.hpp" #include "AForm.hpp"
#include "Bureaucrat.hpp" #include "Bureaucrat.hpp"
int main() int main()