-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfactoryJava.h
More file actions
25 lines (19 loc) · 814 Bytes
/
factoryJava.h
File metadata and controls
25 lines (19 loc) · 814 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#ifndef FACTORYJAVA_H
#define FACTORYJAVA_H
#include "factoryAbstract.h"
#include "classJava.h"
#include "methodJava.h"
#include "printoperatorJava.h"
class FactoryJava : public FactoryAbstract{
public:
std::shared_ptr<Class> createClass(const std::string& name) const override {
return std::make_shared<ClassJava>(name); // переводим обычный указатель в умный
}
std::shared_ptr<Method> createMethod(const std::string& name, const std::string& returnType, Class::Flags flags) const override {
return std::make_shared<MethodJava>(name, returnType, flags);
}
std::shared_ptr<PrintOperator> createPrintOperator(const std::string& text) const override{
return std::make_shared<PrintOperatorJava>(text);
};
};
#endif // FACTORYJAVA_H