「✨」 feat: finished ex03
This commit is contained in:
69
ex03/Bureaucrat.hpp
Normal file
69
ex03/Bureaucrat.hpp
Normal file
@ -0,0 +1,69 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* Bureaucrat.hpp :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/12/23 13:59:43 by adjoly #+# #+# */
|
||||
/* Updated: 2025/04/03 13:50:01 by adjoly ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <exception>
|
||||
#include <fstream>
|
||||
#include <iostream>
|
||||
#include <stdexcept>
|
||||
#include <string>
|
||||
|
||||
void _log(std::string emoji, std::string what, std::string who,
|
||||
std::string str);
|
||||
|
||||
class AForm;
|
||||
|
||||
typedef unsigned char uint8_t;
|
||||
|
||||
#define MAXGRADE 1
|
||||
#define MINGRADE 150
|
||||
|
||||
class Bureaucrat {
|
||||
public:
|
||||
Bureaucrat(void);
|
||||
Bureaucrat(const Bureaucrat &cpy);
|
||||
Bureaucrat(std::string name, uint8_t grade);
|
||||
~Bureaucrat(void);
|
||||
|
||||
const std::string &getName(void) const;
|
||||
uint8_t getGrade(void) const;
|
||||
|
||||
void executeForm(const AForm &) const;
|
||||
|
||||
class GradeTooHighException : public std::exception {
|
||||
public:
|
||||
virtual const char *what() const throw();
|
||||
};
|
||||
class GradeTooLowException : public std::exception {
|
||||
public:
|
||||
virtual const char *what() const throw();
|
||||
};
|
||||
|
||||
// Copy assignement operator
|
||||
Bureaucrat &operator=(Bureaucrat const &);
|
||||
|
||||
// Preincrement operator
|
||||
Bureaucrat &operator++(void);
|
||||
Bureaucrat &operator--(void);
|
||||
|
||||
// Post increment operator
|
||||
Bureaucrat operator++(int);
|
||||
Bureaucrat operator--(int);
|
||||
|
||||
void signForm(AForm &);
|
||||
private:
|
||||
const std::string _name;
|
||||
uint8_t _grade;
|
||||
};
|
||||
|
||||
std::ostream &operator<<(std::ostream &, Bureaucrat &);
|
Reference in New Issue
Block a user