「🎉」 init: hello world !
This commit is contained in:
65
ex02/AForm.hpp
Normal file
65
ex02/AForm.hpp
Normal file
@@ -0,0 +1,65 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* AForm.hpp :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: mmoussou <mmoussou@student.42angouleme.fr +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/06/27 13:36:33 by mmoussou #+# #+# */
|
||||
/* Updated: 2025/08/02 13:13:41 by mmoussou ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
|
||||
void _log(std::string emoji, std::string what, std::string who, std::string str);
|
||||
|
||||
typedef unsigned char uint8_t;
|
||||
|
||||
#include "Bureaucrat.hpp"
|
||||
|
||||
class AForm {
|
||||
public:
|
||||
AForm(void);
|
||||
AForm(std::string name, uint8_t minForSign, uint8_t minForExec);
|
||||
AForm(const AForm &);
|
||||
~AForm(void);
|
||||
|
||||
AForm &operator=(const AForm &);
|
||||
|
||||
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 NotSigned : public std::exception {
|
||||
public:
|
||||
virtual const char *what() const throw();
|
||||
};
|
||||
|
||||
std::string getName(void) const;
|
||||
bool getSigned(void) const;
|
||||
uint8_t getMinForSign(void) const;
|
||||
uint8_t getMinForExec(void) const;
|
||||
|
||||
void execute(const Bureaucrat &) const;
|
||||
|
||||
void beSigned(Bureaucrat);
|
||||
|
||||
private:
|
||||
std::string _name;
|
||||
bool _signed;
|
||||
const uint8_t _minForSign;
|
||||
const uint8_t _minForExec;
|
||||
|
||||
void _gradeCheck(void) const;
|
||||
virtual void _exec(const Bureaucrat &) const = 0;
|
||||
};
|
||||
|
||||
std::ostream &operator<<(std::ostream &, AForm &);
|
||||
|
||||
Reference in New Issue
Block a user