21Bureaucrat::Bureaucrat(
const std::string &name,
int grade) : _name(name) {
29Bureaucrat::Bureaucrat(
const Bureaucrat &other) : _name(other._name), _grade(other._grade) {}
33 _grade = other._grade;
86 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.
void executeForm(AForm const &form)
Attempts to execute a form. Calls the form's execute method and prints the result.
~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.