/ CPP_Modules / CPP_Module_05 / ex03 / RobotomyRequestForm.hpp
RobotomyRequestForm.hpp
  1  /* ************************************************************************** */
  2  /*                                                                            */
  3  /*                                                        :::      ::::::::   */
  4  /*   RobotomyRequestForm.hpp                            :+:      :+:    :+:   */
  5  /*                                                    +:+ +:+         +:+     */
  6  /*   By: gychoi <gychoi@student.42seoul.kr>         +#+  +:+       +#+        */
  7  /*                                                +#+#+#+#+#+   +#+           */
  8  /*   Created: 2023/12/03 22:01:51 by gychoi            #+#    #+#             */
  9  /*   Updated: 2023/12/03 23:10:31 by gychoi           ###   ########.fr       */
 10  /*                                                                            */
 11  /* ************************************************************************** */
 12  
 13  #pragma once
 14  #ifndef __ROBOTOMYREQUESTFORM_HPP__
 15  #define __ROBOTOMYREQUESTFORM_HPP__
 16  
 17  #include <cstdlib>
 18  #include <ctime>
 19  
 20  #include "AForm.hpp"
 21  
 22  /* ************************************************************************** */
 23  /*                            RobotomyRequestForm                             */
 24  /* ************************************************************************** */
 25  class RobotomyRequestForm : public AForm
 26  {
 27  public:
 28  	RobotomyRequestForm();
 29  	RobotomyRequestForm(std::string const& targetName);
 30  	RobotomyRequestForm(RobotomyRequestForm const& target);
 31  	RobotomyRequestForm&	operator=(RobotomyRequestForm const& target);
 32  	virtual ~RobotomyRequestForm();
 33  
 34  public:
 35  	virtual void			beSigned(Bureaucrat const& bureaucrat);
 36  	virtual void			execute(Bureaucrat const& executor) const;
 37  
 38  /* ************************************************************************** */
 39  /*                 RobotomyRequestForm::GradeTooHighException                 */
 40  /* ************************************************************************** */
 41  public:
 42  	class GradeTooHighException : public AForm::GradeTooHighException
 43  	{
 44  	public:
 45  		GradeTooHighException();
 46  		GradeTooHighException(std::string const& msg);
 47  		GradeTooHighException(GradeTooHighException const& target);
 48  		GradeTooHighException&	operator=(GradeTooHighException const& target);
 49  		virtual ~GradeTooHighException() throw();
 50  
 51  	public:
 52  		std::string const&		getMessage() const;
 53  
 54  	public:
 55  		virtual char const*		what() const throw();
 56  
 57  	private:
 58  		std::string				mMessage;
 59  	};
 60  
 61  /* ************************************************************************** */
 62  /*                 RobotomyRequestForm::GradeTooLowException                  */
 63  /* ************************************************************************** */
 64  public:
 65  	class GradeTooLowException : public AForm::GradeTooLowException
 66  	{
 67  	public:
 68  		GradeTooLowException();
 69  		GradeTooLowException(std::string const& msg);
 70  		GradeTooLowException(GradeTooLowException const& target);
 71  		GradeTooLowException&	operator=(GradeTooLowException const& target);
 72  		virtual ~GradeTooLowException() throw();
 73  
 74  	public:
 75  		std::string const&		getMessage() const;
 76  
 77  	public:
 78  		virtual char const*		what() const throw();
 79  
 80  	private:
 81  		std::string				mMessage;
 82  	};
 83  
 84  /* ************************************************************************** */
 85  /*                RobotomyRequestForm::FormNotSignedException                 */
 86  /* ************************************************************************** */
 87  public:
 88  	class FormNotSignedException : public std::exception
 89  	{
 90  	public:
 91  		FormNotSignedException();
 92  		FormNotSignedException(std::string const& msg);
 93  		FormNotSignedException(FormNotSignedException const& target);
 94  		FormNotSignedException&	operator=(FormNotSignedException const& target);
 95  		virtual ~FormNotSignedException() throw();
 96  
 97  	public:
 98  		std::string const&		getMessage() const;
 99  
100  	public:
101  		virtual char const*		what() const throw();
102  
103  	private:
104  		std::string				mMessage;
105  	};
106  };
107  
108  std::ostream&	operator<<(std::ostream& os, RobotomyRequestForm const& target);
109  
110  #endif /* __ROBOTOMYREQUESTFORM_HPP__ */