From 8ad95969ba8056551ebab648124c91b529a2e167 Mon Sep 17 00:00:00 2001 From: Ladebeze66 Date: Wed, 14 Feb 2024 14:43:54 +0100 Subject: [PATCH] fer --- cpp05/.vscode/settings.json | 5 ++- cpp05/ex00/Bureaucrat.cpp | 63 ++++++++++++++++++++++++------- cpp05/ex00/Bureaucrat.hpp | 71 ++++++++++++++++------------------- cpp05/ex00/Bureaucrat.o | Bin 0 -> 16536 bytes cpp05/ex00/main.cpp | 2 +- cpp05/ex01/Bureaucrat.cpp | 70 ++++++++++++++++++++++------------ cpp05/ex01/Bureaucrat.hpp | 73 ++++++++++++++++-------------------- cpp05/ex01/Form.hpp | 16 ++++---- 8 files changed, 175 insertions(+), 125 deletions(-) create mode 100644 cpp05/ex00/Bureaucrat.o diff --git a/cpp05/.vscode/settings.json b/cpp05/.vscode/settings.json index f6aaca9..5b21dcf 100644 --- a/cpp05/.vscode/settings.json +++ b/cpp05/.vscode/settings.json @@ -57,6 +57,7 @@ "C_Cpp_Runner.useLinkTimeOptimization": false, "C_Cpp_Runner.msvcSecureNoWarnings": false, "files.associations": { - "iostream": "cpp" - } + "iostream": "cpp", + "ostream": "cpp" +} } \ No newline at end of file diff --git a/cpp05/ex00/Bureaucrat.cpp b/cpp05/ex00/Bureaucrat.cpp index d67aa95..b8f3482 100644 --- a/cpp05/ex00/Bureaucrat.cpp +++ b/cpp05/ex00/Bureaucrat.cpp @@ -6,13 +6,19 @@ /* By: fgras-ca +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2024/02/11 13:16:26 by fgras-ca #+# #+# */ -/* Updated: 2024/02/11 13:58:43 by fgras-ca ### ########.fr */ +/* Updated: 2024/02/14 14:38:10 by fgras-ca ### ########.fr */ /* */ /* ************************************************************************** */ #include "Bureaucrat.hpp" -Bureaucrat::Bureaucrat(const std::string &nom, int grade) : name(nom) +// Constructeur par défaut +Bureaucrat::Bureaucrat() : name("Default"), grade(150) +{ + std::cout << GREEN << "Bureaucrat default constructor called!\n" << RESET << std::endl; +} +// Constructeur avec paramètres +Bureaucrat::Bureaucrat(const std::string& name, int grade) :name(name), grade(grade) { if (grade < 1) { @@ -23,18 +29,39 @@ Bureaucrat::Bureaucrat(const std::string &nom, int grade) : name(nom) throw GradeTooLowException(); } this->grade = grade; + std::cout << GREEN << "Bureaucrat " << this->name << " constructor called with grade " << this->grade << RESET << std::endl; } - +// Constructeur de copie +Bureaucrat::Bureaucrat(const Bureaucrat& other) : name(other.name), grade(other.grade) +{ + std::cout << CYAN << "Copy constructor called for Bureaucrat " << this->name << RESET << std::endl; +} +// Opérateur d'affectation +Bureaucrat& Bureaucrat::operator=(const Bureaucrat& other) +{ + if (this != &other) + { + // L'attribut name étant const, nous ne pouvons pas le modifier. Seul grade est copié. + this->grade = other.grade; + } + return (*this); +} +// Destructeur +Bureaucrat::~Bureaucrat() +{ + std::cout << RED << "Bureaucrat " << this->name << " is destroyed!" << RESET << std::endl; +} +// Getter pour le nom std::string Bureaucrat::getName() const { - return (name); + return (this->name); } - +// Getter pour le grade int Bureaucrat::getGrade() const { - return (grade); + return (this->grade); } - +// Incrémente le grade void Bureaucrat::incrementGrade() { if (grade <= 1) @@ -43,18 +70,28 @@ void Bureaucrat::incrementGrade() } --grade; } - +// Décrémente le grade void Bureaucrat::decrementGrade() { - if (grade >= 150) - { + if (grade >= 150) { throw GradeTooLowException(); } ++grade; } - -std::ostream& operator<<(std::ostream &os, const Bureaucrat &bureaucrat) +// Méthodes pour les exceptions +const char* Bureaucrat::GradeTooHighException::what() const throw() { - os << bureaucrat.getName() << MAGENTA << ", bureaucrat grade " << RESET << bureaucrat.getGrade(); + return "Grade too hight\n"; +} + +const char* Bureaucrat::GradeTooLowException::what() const throw() +{ + return "Grade too low\n"; +} +// Surcharge de l'opérateur << +std::ostream& operator<<(std::ostream& os, const Bureaucrat& bureaucrat) +{ + os << bureaucrat.getName() << " bureaucrat grade " << bureaucrat.getGrade(); return (os); } + diff --git a/cpp05/ex00/Bureaucrat.hpp b/cpp05/ex00/Bureaucrat.hpp index 1fc5d19..8547078 100644 --- a/cpp05/ex00/Bureaucrat.hpp +++ b/cpp05/ex00/Bureaucrat.hpp @@ -6,7 +6,7 @@ /* By: fgras-ca +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2024/02/11 12:57:28 by fgras-ca #+# #+# */ -/* Updated: 2024/02/11 14:01:58 by fgras-ca ### ########.fr */ +/* Updated: 2024/02/14 14:32:41 by fgras-ca ### ########.fr */ /* */ /* ************************************************************************** */ @@ -17,53 +17,48 @@ #include #include -#define RESET "\033[0m" -#define BLACK "\033[30m" -#define RED "\033[31m" -#define GREEN "\033[32m" -#define YELLOW "\033[33m" -#define BLUE "\033[34m" -#define MAGENTA "\033[35m" -#define CYAN "\033[36m" -#define WHITE "\033[37m" +#define RESET "\033[0m" +#define BLACK "\033[30m" +#define RED "\033[31m" +#define GREEN "\033[32m" +#define YELLOW "\033[33m" +#define BLUE "\033[34m" +#define MAGENTA "\033[35m" +#define CYAN "\033[36m" +#define WHITE "\033[37m" class Bureaucrat { public: - class GradeTooHighException : public std::exception + class GradeTooHighException : public std::exception { - public: - const char* what() const throw() override - { - return ("Grade trop élevé"); - } - }; + public: + const char* what() const throw() override; + }; - class GradeTooLowException : public std::exception + class GradeTooLowException : public std::exception { - public: - const char* what() const throw() override - { - return ("Grade trop bas"); - } - }; + public: + const char* what() const throw() override; + }; + + Bureaucrat(); + Bureaucrat(const std::string& name, int grade); + Bureaucrat(const Bureaucrat& other); + Bureaucrat& operator=(const Bureaucrat& other); + ~Bureaucrat(); + + std::string getName() const; + int getGrade() const; + void incrementGrade(); + void decrementGrade(); private: - const std::string name; - int grade; - -public: - Bureaucrat(const std::string &nom, int grade); // Constructeur - Bureaucrat(const Bureaucrat& other) = default; // Constructeur par copie - Bureaucrat& operator=(const Bureaucrat& other) = default; // Opérateur d'affectation - ~Bureaucrat() = default; // Destructeur - - std::string getName() const; - int getGrade() const; - void incrementGrade(); - void decrementGrade(); + const std::string name; + int grade; }; -std::ostream& operator<<(std::ostream &os, const Bureaucrat &bureaucrat); +std::ostream& operator<<(std::ostream& os, const Bureaucrat& bureaucrat); #endif + diff --git a/cpp05/ex00/Bureaucrat.o b/cpp05/ex00/Bureaucrat.o new file mode 100644 index 0000000000000000000000000000000000000000..b55510ef928995468162cea590b52a4c768cbe6d GIT binary patch literal 16536 zcmc&*e{fvYb$+Wg#x%hwm?RD+WF=!G173DzIS35IKeYBL7Dllo;(<8NtJPZCLDFh= z-x}MAAsJ6HY=ntvr!7<3j+yCX;!ZkorcH)SQ*fgUgb6hKK?zBn)TLyijG5F;{=i}A zsOP)yoZa)@-Y2igOnYYD-uu3Le%*7=z3;yJq(?FX+uLF>M=0jp?KJKLb(}rvMt!rX zZg%c+?linB=>8hIAon4mQ}^dai$r$^_RtsO+R`HC;C_wuZ{J zT)&aZF1psybrWMZQ+W&5*K?Vq@>Z^=xZFTx4_&{z>iTy^vbA3hWsknKGFv+`pPkLj zXKOFaQ=5}Lc9|(^&(~|*Q2Txzc|KeFiO+2XXFuqxcuka^yB;>PwYh+$+UwGuo!xuk z#X0R)m+`AsJzE<&V}xc$&SqX6~Lp}ku$Zy#HIHvOFergTdSTL%g!!Y(?xz{Ynl18VAcdj8?E|Y>jsI`#1tKmc7~Umv_gx4KnU< zftk)-E}-slBN_bR3uFW(YCDDP0)_27^@Oer)f>H`+ZX4KOa277B}7f>+}sf;-IO_B zT?+N*K1{#o#b+{lp|&-FhG3qW(F~7dq)lr?X;%E74G?vpo@AlHy37`L#GLv(yE(D9 z5#PYNK}|<5#NPW{B=z&8remisSA6tpgl<*n2VgE{y3e| zsdsFIXKo`K?V}u6hZb8s%_>PY{7J1QshUIN`!kf2m}}RVHN;!fScx>>MW8q$V!{IY6mQsZh_N#eF8;XP1##5g@Nyr~fZMcBNB|)a_20bRRC221*ZQ4(1Cp zNV?2oy$H&uMLt^`pIBVMj&0lSNOX;iR;RscBArh5Bvb3tRdbtuxVt-<>RHFIF~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hldQAkFL*gz1cz3nQ@8N}W JA=DU_|6kG)IKcn_ literal 0 HcmV?d00001 diff --git a/cpp05/ex00/main.cpp b/cpp05/ex00/main.cpp index 9019a8f..252fed9 100644 --- a/cpp05/ex00/main.cpp +++ b/cpp05/ex00/main.cpp @@ -6,7 +6,7 @@ /* By: fgras-ca +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2024/02/11 13:28:49 by fgras-ca #+# #+# */ -/* Updated: 2024/02/11 14:08:26 by fgras-ca ### ########.fr */ +/* Updated: 2024/02/14 14:37:10 by fgras-ca ### ########.fr */ /* */ /* ************************************************************************** */ diff --git a/cpp05/ex01/Bureaucrat.cpp b/cpp05/ex01/Bureaucrat.cpp index b6f86a0..b8f3482 100644 --- a/cpp05/ex01/Bureaucrat.cpp +++ b/cpp05/ex01/Bureaucrat.cpp @@ -6,14 +6,19 @@ /* By: fgras-ca +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2024/02/11 13:16:26 by fgras-ca #+# #+# */ -/* Updated: 2024/02/11 14:50:15 by fgras-ca ### ########.fr */ +/* Updated: 2024/02/14 14:38:10 by fgras-ca ### ########.fr */ /* */ /* ************************************************************************** */ #include "Bureaucrat.hpp" -#include "Form.hpp" -Bureaucrat::Bureaucrat(const std::string &nom, int grade) : name(nom) +// Constructeur par défaut +Bureaucrat::Bureaucrat() : name("Default"), grade(150) +{ + std::cout << GREEN << "Bureaucrat default constructor called!\n" << RESET << std::endl; +} +// Constructeur avec paramètres +Bureaucrat::Bureaucrat(const std::string& name, int grade) :name(name), grade(grade) { if (grade < 1) { @@ -24,18 +29,39 @@ Bureaucrat::Bureaucrat(const std::string &nom, int grade) : name(nom) throw GradeTooLowException(); } this->grade = grade; + std::cout << GREEN << "Bureaucrat " << this->name << " constructor called with grade " << this->grade << RESET << std::endl; } - +// Constructeur de copie +Bureaucrat::Bureaucrat(const Bureaucrat& other) : name(other.name), grade(other.grade) +{ + std::cout << CYAN << "Copy constructor called for Bureaucrat " << this->name << RESET << std::endl; +} +// Opérateur d'affectation +Bureaucrat& Bureaucrat::operator=(const Bureaucrat& other) +{ + if (this != &other) + { + // L'attribut name étant const, nous ne pouvons pas le modifier. Seul grade est copié. + this->grade = other.grade; + } + return (*this); +} +// Destructeur +Bureaucrat::~Bureaucrat() +{ + std::cout << RED << "Bureaucrat " << this->name << " is destroyed!" << RESET << std::endl; +} +// Getter pour le nom std::string Bureaucrat::getName() const { - return (name); + return (this->name); } - +// Getter pour le grade int Bureaucrat::getGrade() const { - return (grade); + return (this->grade); } - +// Incrémente le grade void Bureaucrat::incrementGrade() { if (grade <= 1) @@ -44,30 +70,28 @@ void Bureaucrat::incrementGrade() } --grade; } - +// Décrémente le grade void Bureaucrat::decrementGrade() { - if (grade >= 150) - { + if (grade >= 150) { throw GradeTooLowException(); } ++grade; } - -void Bureaucrat::signForm(Form& form) +// Méthodes pour les exceptions +const char* Bureaucrat::GradeTooHighException::what() const throw() { - try - { - form.beSigned(*this); - std::cout << this->name << " signed " << form.getName() << std::endl; - } catch (std::exception& e) - { - std::cout << this->name << " couldn’t sign " << form.getName() << " because " << e.what() << std::endl; - } + return "Grade too hight\n"; } -std::ostream& operator<<(std::ostream &os, const Bureaucrat &bureaucrat) +const char* Bureaucrat::GradeTooLowException::what() const throw() { - os << bureaucrat.getName() << MAGENTA << ", bureaucrat grade " << RESET << bureaucrat.getGrade(); + return "Grade too low\n"; +} +// Surcharge de l'opérateur << +std::ostream& operator<<(std::ostream& os, const Bureaucrat& bureaucrat) +{ + os << bureaucrat.getName() << " bureaucrat grade " << bureaucrat.getGrade(); return (os); } + diff --git a/cpp05/ex01/Bureaucrat.hpp b/cpp05/ex01/Bureaucrat.hpp index 350c481..8547078 100644 --- a/cpp05/ex01/Bureaucrat.hpp +++ b/cpp05/ex01/Bureaucrat.hpp @@ -6,66 +6,59 @@ /* By: fgras-ca +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2024/02/11 12:57:28 by fgras-ca #+# #+# */ -/* Updated: 2024/02/11 14:59:51 by fgras-ca ### ########.fr */ +/* Updated: 2024/02/14 14:32:41 by fgras-ca ### ########.fr */ /* */ /* ************************************************************************** */ #ifndef BUREAUCRAT_HPP #define BUREAUCRAT_HPP -#include "Form.hpp" #include #include #include -#define RESET "\033[0m" -#define BLACK "\033[30m" -#define RED "\033[31m" -#define GREEN "\033[32m" -#define YELLOW "\033[33m" -#define BLUE "\033[34m" -#define MAGENTA "\033[35m" -#define CYAN "\033[36m" -#define WHITE "\033[37m" +#define RESET "\033[0m" +#define BLACK "\033[30m" +#define RED "\033[31m" +#define GREEN "\033[32m" +#define YELLOW "\033[33m" +#define BLUE "\033[34m" +#define MAGENTA "\033[35m" +#define CYAN "\033[36m" +#define WHITE "\033[37m" class Bureaucrat { public: - class GradeTooHighException : public std::exception + class GradeTooHighException : public std::exception { - public: - const char* what() const throw() override - { - return ("Grade trop élevé"); - } - }; + public: + const char* what() const throw() override; + }; - class GradeTooLowException : public std::exception + class GradeTooLowException : public std::exception { - public: - const char* what() const throw() override - { - return ("Grade trop bas"); - } - }; + public: + const char* what() const throw() override; + }; + + Bureaucrat(); + Bureaucrat(const std::string& name, int grade); + Bureaucrat(const Bureaucrat& other); + Bureaucrat& operator=(const Bureaucrat& other); + ~Bureaucrat(); + + std::string getName() const; + int getGrade() const; + void incrementGrade(); + void decrementGrade(); private: - const std::string name; - int grade; - -public: - Bureaucrat(const std::string &nom, int grade); // Constructeur - Bureaucrat(const Bureaucrat& other) = default; // Constructeur par copie - Bureaucrat& operator=(const Bureaucrat& other) = default; // Opérateur d'affectation - ~Bureaucrat() = default; // Destructeur - - std::string getName() const; - int getGrade() const; - void incrementGrade(); - void decrementGrade(); - void signForm(Form& form); + const std::string name; + int grade; }; -std::ostream& operator<<(std::ostream &os, const Bureaucrat &bureaucrat); +std::ostream& operator<<(std::ostream& os, const Bureaucrat& bureaucrat); #endif + diff --git a/cpp05/ex01/Form.hpp b/cpp05/ex01/Form.hpp index 364d6b5..28798e9 100644 --- a/cpp05/ex01/Form.hpp +++ b/cpp05/ex01/Form.hpp @@ -6,7 +6,7 @@ /* By: fgras-ca +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2024/02/11 14:37:14 by fgras-ca #+# #+# */ -/* Updated: 2024/02/11 18:03:35 by fgras-ca ### ########.fr */ +/* Updated: 2024/02/12 14:43:02 by fgras-ca ### ########.fr */ /* */ /* ************************************************************************** */ @@ -19,7 +19,7 @@ class Bureaucrat; -class AForm +class Form { private: const std::string name; @@ -30,14 +30,14 @@ private: public: //constructueur - AForm(const::std::string& name); - AForm(const std::string &name, int gradeRequiredToSign, int gradeRequiredToExecute); + Form(const::std::string& name); + Form(const std::string &name, int gradeRequiredToSign, int gradeRequiredToExecute); // Constructeur par copie - AForm(const AForm& other); + Form(const Form& other); // Opérateur d'affectation - AForm& operator=(const AForm& other); + Form& operator=(const Form& other); // Destructeur - ~AForm(); + ~Form(); std::string getName() const; @@ -67,6 +67,6 @@ public: }; // Surcharge de l'opérateur d'insertion -std::ostream& operator<<(std::ostream& os, const AForm& form); +std::ostream& operator<<(std::ostream& os, const Form& form); #endif