58 lines
1.7 KiB
C++
58 lines
1.7 KiB
C++
/* ************************************************************************** */
|
|
/* */
|
|
/* ::: :::::::: */
|
|
/* Bureaucrat.hpp :+: :+: :+: */
|
|
/* +:+ +:+ +:+ */
|
|
/* By: aortigos <aortigos@student.42malaga.com +#+ +:+ +#+ */
|
|
/* +#+#+#+#+#+ +#+ */
|
|
/* Created: 2026/02/21 12:13:47 by aortigos #+# #+# */
|
|
/* Updated: 2026/02/21 12:13:48 by aortigos ### ########.fr */
|
|
/* */
|
|
/* ************************************************************************** */
|
|
|
|
#ifndef BUREAUCRAT_HPP
|
|
|
|
# define BUREAUCRAT_HPP
|
|
|
|
# include <iostream>
|
|
|
|
class AForm;
|
|
|
|
class Bureaucrat
|
|
{
|
|
private:
|
|
const std::string name;
|
|
int grade;
|
|
|
|
public:
|
|
Bureaucrat();
|
|
Bureaucrat(const Bureaucrat &other);
|
|
Bureaucrat &operator=(const Bureaucrat &other);
|
|
~Bureaucrat();
|
|
|
|
Bureaucrat(std::string name, int grade);
|
|
|
|
std::string getName() const;
|
|
int getGrade() const;
|
|
|
|
void incrementGrade();
|
|
void decrementGrade();
|
|
|
|
void signForm(AForm &form);
|
|
void executeForm(AForm &form);
|
|
|
|
class GradeTooHighException : public std::exception {
|
|
public:
|
|
virtual const char* what() const throw();
|
|
};
|
|
|
|
class GradeTooLowException : public std::exception {
|
|
public:
|
|
virtual const char* what() const throw();
|
|
};
|
|
};
|
|
|
|
std::ostream& operator<<(std::ostream &os, const Bureaucrat &bureaucrat);
|
|
|
|
#endif
|