40 lines
771 B
C++
40 lines
771 B
C++
#ifndef BUREAUCRAT_HPP
|
|
#define BUREAUCRAT_HPP
|
|
|
|
#include <exception>
|
|
#include <iostream>
|
|
#include <string>
|
|
|
|
class Bureaucrat
|
|
{
|
|
private:
|
|
const std::string _name;
|
|
int _grade;
|
|
|
|
public:
|
|
Bureaucrat();
|
|
Bureaucrat(const std::string _name, int _grade);
|
|
Bureaucrat(const Bureaucrat ©);
|
|
Bureaucrat &operator=(const Bureaucrat &other);
|
|
|
|
std::string getName() const;
|
|
int getGrade() const;
|
|
void incrementGrade();
|
|
void decrementGrade();
|
|
|
|
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, Bureaucrat const &other);
|
|
|
|
#endif
|