-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfactoryCpp.h
More file actions
24 lines (19 loc) · 803 Bytes
/
factoryCpp.h
File metadata and controls
24 lines (19 loc) · 803 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
#ifndef FACTORYCPP_H
#define FACTORYCPP_H
#include "factoryAbstract.h"
#include "classCpp.h"
#include "methodCpp.h"
#include "printoperatorCpp.h"
class FactoryCpp : public FactoryAbstract{
public:
std::shared_ptr<Class> createClass(const std::string& name) const override {
return std::make_shared<ClassCpp>(name); // переводим обычный указатель в умный
}
std::shared_ptr<Method> createMethod(const std::string& name, const std::string& returnType, Class::Flags flags) const override {
return std::make_shared<MethodCpp>(name, returnType, flags);
}
std::shared_ptr<PrintOperator> createPrintOperator(const std::string& text) const override{
return std::make_shared<PrintOperatorCpp>(text);
};
};
#endif // FACTORYCPP_H