21Bureaucrat::Bureaucrat(
const std::string &name,
int grade) : _name(name) {
27 std::cout <<
"Bureaucrat " << _name <<
" created with grade " << _grade <<
"." <<
std::endl;
30Bureaucrat::Bureaucrat(
const Bureaucrat &other) : _name(other._name), _grade(other._grade) {
36 _grade = other._grade;
38 std::cout <<
"Bureaucrat " << _name <<
"'s grade has been assigned from " << other._name <<
"." <<
std::endl;
53 std::cout <<
"Bureaucrat " << _name <<
" grade incremented to " << _grade <<
"." <<
std::endl;
60 std::cout <<
"Bureaucrat " << _name <<
" grade decremented to " << _grade <<
"." <<
std::endl;
84 os << bureaucrat.
getName() <<
", bureaucrat grade " << bureaucrat.
getGrade();
virtual const char * what() const
Represents a bureaucrat with a name and a grade.
void incrementGrade()
Increments the bureaucrat's grade (e.g., from 3 to 2).
void decrementGrade()
Decrements the bureaucrat's grade (e.g., from 2 to 3).
void signForm(Form &form)
Attempts to sign a form. Calls the form's beSigned method and prints the result.
int getGrade() const
Gets the grade of the Bureaucrat.
~Bureaucrat()
Destroy the Bureaucrat:: Bureaucrat object
Bureaucrat & operator=(const Bureaucrat &other)
Assignment operator for Bureaucrat.
const std::string & getName() const
Gets the name of the Bureaucrat.
Defines the Bureaucrat class, updated to execute AForms.
std::ostream & operator<<(std::ostream &os, const Bureaucrat &bureaucrat)
Overloads the << operator to print Bureaucrat information.