You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
/* ************************************************************************** */
|
|
|
|
/* */
|
|
|
|
/* ::: :::::::: */
|
|
|
|
/* Form.hpp :+: :+: :+: */
|
|
|
|
/* +:+ +:+ +:+ */
|
|
|
|
/* By: narnaud <narnaud@student.42.fr> +#+ +:+ +#+ */
|
|
|
|
/* +#+#+#+#+#+ +#+ */
|
|
|
|
/* Created: 2022/06/26 15:47:12 by narnaud #+# #+# */
|
|
|
|
/* Updated: 2022/06/27 09:36:10 by narnaud ### ########.fr */
|
|
|
|
/* */
|
|
|
|
/* ************************************************************************** */
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "Bureaucrat.hpp"
|
|
|
|
#include <iostream>
|
|
|
|
#include <stdexcept>
|
|
|
|
#include <string>
|
|
|
|
using std::cout;
|
|
|
|
using std::endl;
|
|
|
|
using std::string;
|
|
|
|
|
|
|
|
class Bureaucrat;
|
|
|
|
|
|
|
|
class Form {
|
|
|
|
const string _name;
|
|
|
|
int _signGrade;
|
|
|
|
int _exeGrade;
|
|
|
|
bool _isSigned;
|
|
|
|
|
|
|
|
public:
|
|
|
|
class GradeTooHighException : virtual public std::exception {
|
|
|
|
public:
|
|
|
|
const char *what(void) const throw();
|
|
|
|
};
|
|
|
|
class GradeTooLowException : virtual public std::exception {
|
|
|
|
public:
|
|
|
|
const char *what(void) const throw();
|
|
|
|
};
|
|
|
|
Form(void);
|
|
|
|
Form(const string name, const int signGrade,
|
|
|
|
const int exeGrade) throw(GradeTooHighException, GradeTooLowException);
|
|
|
|
Form &operator=(Form const &f);
|
|
|
|
Form(Form const &f);
|
|
|
|
~Form(void);
|
|
|
|
const string getName(void) const;
|
|
|
|
int getSignGrade(void) const;
|
|
|
|
int getExeGrade(void) const;
|
|
|
|
bool beSigned(const Bureaucrat &b) throw(GradeTooLowException);
|
|
|
|
};
|
|
|
|
|
|
|
|
std::ostream &operator<<(std::ostream &out, const Form &f);
|