Something went wrong. Try again.
Java--'s try/catch projects.intra.42.fr/projects/cpp-module-05
Something went wrong. Try again.
1.2 kB · 54 lines
C++
at main
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455#pragma once
#include <exception>#include <iostream>#include <ostream>#include <string>
class Bureaucrat;
class AForm { public: AForm(); AForm(const AForm& other); AForm(const std::string& name); AForm(const std::string& name, const unsigned short gradeToSign, const unsigned short gradeToExecute);
void beSigned(Bureaucrat& bureaucrat); void execute(Bureaucrat const & executor) const;
const std::string& getName() const; bool getIsSigned() const; unsigned short getGradeToSign() const; unsigned short getGradeToExecute() const;
AForm& operator=(const AForm& other);
virtual ~AForm(); protected: virtual void executeAction() const = 0; private: const std::string name;
bool isSigned;
const unsigned short gradeToSign; const unsigned short gradeToExecute;
class GradeTooHighException : public std::exception { public: const char* what() const throw(); };
class GradeTooLowException : public std::exception { public: const char* what() const throw(); };
class FormNotSignedException : public std::exception { public: const char* what() const throw(); };};
std::ostream& operator<<(std::ostream& ostream, const AForm& form);