42 lines
795 B
C++
42 lines
795 B
C++
#pragma once
|
|
|
|
#include <exception>
|
|
#include <iostream>
|
|
#include "Form.hpp"
|
|
|
|
class Form;
|
|
|
|
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 signForm(Form &form);
|
|
|
|
private:
|
|
const std::string name;
|
|
int grade;
|
|
};
|
|
|
|
std::ostream& operator<<(std::ostream& os, Bureaucrat const& crat);
|