| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- /* ************************************************************************** */
- /* */
- /* ::: :::::::: */
- /* Bureaucrat.hpp :+: :+: :+: */
- /* +:+ +:+ +:+ */
- /* By: bchanot <bchanot@42.fr> +#+ +:+ +#+ */
- /* +#+#+#+#+#+ +#+ */
- /* Created: 2025/12/26 17:51:13 by bchanot #+# #+# */
- /* Updated: 2025/12/29 16:31:34 by bchanot ### ########.fr */
- /* */
- /* ************************************************************************** */
- #ifndef BUREAUCRAT_HPP
- # define BUREAUCRAT_HPP
- # include <iostream>
- # include <string>
- # include <cstdint>
- class Bureaucrat
- {
- public:
- Bureaucrat();
- Bureaucrat( Bureaucrat const & src );
- Bureaucrat( std::string const name, u_int8_t grade );
- ~Bureaucrat();
- Bureaucrat &operator=( Bureaucrat const & rhs );
- Bureaucrat &operator++();
- Bureaucrat &operator--();
- class GradeTooHighException : public std::exception {
- public:
- virtual const char *what() const throw() {
- return ("The grade specified is too high !");
- }
- };
-
- class GradeTooLowException : public std::exception {
- public:
- virtual const char *what() const throw() {
- return ("The grade specified is too low !");
- }
- };
- uint8_t getGrade(void) const;
- std::string getName(void) const;
- void decrementGrade(void);
- void incrementGrade(void);
- private:
- std::string _name;
- uint8_t _grade;
- };
- std::ostream & operator<<( std::ostream & o, Bureaucrat const & i );
- #endif /* ****************************************************** BUREAUCRAT_H */
|