ajout ex03 et correction dump core

This commit is contained in:
Hugo LAMY
2022-03-17 11:12:31 +01:00
parent bac6161af8
commit 5f090531bc
20 changed files with 1053 additions and 4 deletions

View File

@@ -0,0 +1,48 @@
#ifndef BUREAUCRAT_HPP
# define BUREAUCRAT_HPP
# include "color.h"
# include <iostream>
# include <string>
# include <stdexcept>
class AForm;
# include "AForm.hpp"
class Bureaucrat {
public:
Bureaucrat(std::string name, int grade);
Bureaucrat( Bureaucrat const & src );
~Bureaucrat();
Bureaucrat & operator=( Bureaucrat const & rhs );
std::string getName() const;
int getGrade() const;
void gradeUp();
void gradeDown();
void signForm( AForm & f );
void executeForm( AForm const & form );
protected:
std::string const _name;
int _grade;
private:
Bureaucrat();
class GradeTooHighException : public std::exception {
const char * what() const throw();};
class GradeTooLowException : public std::exception {
const char * what() const throw();};
};
std::ostream & operator<<(std::ostream & o, Bureaucrat const & rhs);
#endif