ajout ex03 et correction dump core
This commit is contained in:
48
d05/ex03/headers/Bureaucrat.hpp
Normal file
48
d05/ex03/headers/Bureaucrat.hpp
Normal 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
|
||||
|
||||
Reference in New Issue
Block a user