1
0
Files
CPP_Module_05/ex03/main.cpp
2025-04-03 16:07:05 +02:00

63 lines
1.6 KiB
C++

/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* main.cpp :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/12/23 14:01:11 by adjoly #+# #+# */
/* Updated: 2025/04/03 15:51:43 by adjoly ### ########.fr */
/* */
/* ************************************************************************** */
#include "Bureaucrat.hpp"
#include "AForm.hpp"
#include "Intern.hpp"
#include "ShrubberyCreationForm.hpp"
#include <iostream>
int main(void) {
Bureaucrat knl("Kanel", 10);
knl--;
std::cout << knl << std::endl;
knl++;
std::cout << knl << std::endl;
try {
knl++;
knl++;
knl++;
knl++;
knl++;
knl++;
knl++;
knl++;
knl++;
knl++;
knl++;
knl++;
knl++;
knl++;
knl++;
knl++;
knl++;
} catch (const std::exception &e) {
std::cerr << "Error : " << e.what() << std::endl;
}
Intern intern;
AForm *s;
s = intern.makeForm("robotomy request", "Kanel");
try {
s->beSigned(knl);
knl.executeForm(*s);
} catch (std::exception &e) {
std::cerr << "Error : " << e.what() << std::endl;
}
std::cout << knl << std::endl;
}