CPP05/ex00/inc/Bureaucrat.hpp
2025-06-23 23:31:09 +02:00

41 lines
859 B
C++

#pragma once
#include <string>
#include <exception>
#define HIGHEST_GRADE 1
#define LOWEST_GRADE 150
class Bureaucrat
{
private:
const std::string _name;
int _grade;
public:
Bureaucrat() = delete;
Bureaucrat(std::string name, int grade);
Bureaucrat(Bureaucrat &other);
~Bureaucrat();
Bureaucrat &operator=(Bureaucrat &other) = delete;
Bureaucrat &operator++(); // Pre-increment
Bureaucrat operator++(int); // Post-increment
Bureaucrat &operator--(); // Pre-decrement
Bureaucrat operator--(int); // Post-decrement
Bureaucrat &operator+=(int value);
Bureaucrat &operator-=(int value);
int getGrade() const;
const std::string getName() const;
class GradeTooHighException: public std::exception {
const char * what() const throw();
};
class GradeTooLowException: public std::exception {
const char *what() const throw();
};
};