CPP05 1.0
読み取り中…
検索中…
一致する文字列を見つけられません
Intern.hpp
[詳解]
1/* ************************************************************************** */
2/* */
3/* ::: :::::::: */
4/* Intern.hpp :+: :+: :+: */
5/* +:+ +:+ +:+ */
6/* By: kamitsui <kamitsui@student.42tokyo.jp> +#+ +:+ +#+ */
7/* +#+#+#+#+#+ +#+ */
8/* Created: 2025/06/30 13:50:05 by kamitsui #+# #+# */
9/* Updated: 2025/07/18 18:00:58 by kamitsui ### ########.fr */
10/* */
11/* ************************************************************************** */
12
18#ifndef INTERN_HPP
19#define INTERN_HPP
20
21#include "AForm.hpp"
22#include "IFormFactory.hpp"
26#include <string>
27
28// --- Default Factory for production ---
30 public:
31 virtual AForm *createShrubbery(const std::string &target) const;
32 virtual AForm *createRobotomy(const std::string &target) const;
33 virtual AForm *createPresidential(const std::string &target) const;
34};
35
36class Intern {
37 private:
38 IFormFactory *_factory;
39 bool _ownsFactory;
40
41 public:
42 // Orthodox Canonical Form
43 Intern(IFormFactory *factory);
44 Intern();
45 ~Intern();
46
47 // Member function
48 AForm *makeForm(const std::string &formName, const std::string &formTarget);
49
50 // Exception for unknown form types
52 public:
53 virtual const char *what() const throw();
54 };
55
56 private:
57 Intern(const Intern &other);
58 Intern &operator=(const Intern &other);
59};
60
61#endif
An abstract base class for forms.
Definition AForm.hpp:34
virtual AForm * createPresidential(const std::string &target) const
Definition Intern.cpp:20
virtual AForm * createShrubbery(const std::string &target) const
Definition Intern.cpp:16
virtual AForm * createRobotomy(const std::string &target) const
Definition Intern.cpp:19
virtual const char * what() const
Definition Intern.cpp:68
AForm * makeForm(const std::string &formName, const std::string &formTarget)
Definition Intern.cpp:45
~Intern()
Definition Intern.cpp:37
Intern()
Definition Intern.cpp:33
Defines the abstract base class AForm for all specific forms.
Defines the PresidentialPardonForm class.
Defines the RobotomyRequestForm class.
Defines the ShrubberyCreationForm class.