cpp/CPP05/ex03/Bureaucrat.hpp
2024-12-04 17:29:31 +01:00

43 lines
833 B
C++

#pragma once
#include <exception>
#include <iostream>
#include "AForm.hpp"
class AForm;
class Bureaucrat {
public:
class GradeTooHighException : public std::exception {
public:
char const* what() const throw();
};
class GradeTooLowException : public std::exception {
public:
char const* what() const throw();
};
Bureaucrat();
Bureaucrat(std::string name, int grade);
~Bureaucrat();
Bureaucrat(const Bureaucrat &other);
Bureaucrat &operator=(const Bureaucrat &other);
std::string getName() const;
int getGrade() const;
void setName(std::string name);
void increaseGrade();
void decreaseGrade();
void signAForm(AForm &form);
void executeAForm(AForm& form);
private:
const std::string name;
int grade;
};
std::ostream& operator<<(std::ostream& os, Bureaucrat const& crat);