Код: Выделить всё
#ifndef __FORGE_MENU_BUTTON_HPP__
#define __FORGE_MENU_BUTTON_HPP__
#include "ForgeConstruct.hpp"
#include "ForgeConstructFactory.hpp"
class ForgeMenuButton : public ForgeSDLConstruct {
public:
ForgeMenuButton() : ForgeSDLConstruct() {}
virtual void load(const ForgeConstructParams*);
// more code in here but removed conciseness ...
};
class ForgeMenuButtonCreator : public ForgeBaseCreator{
ForgeConstruct* createForgeConstruct() const {
return new ForgeMenuButton();
}
};
Код: Выделить всё
class ForgeBaseCreator{
public:
virtual ForgeConstruct* createForgeCosntruct() const = 0;
virtual ~ForgeBaseCreator() {}
};
Код: Выделить всё
class ForgeMenuButtonCreator : public ForgeBaseCreator{
ForgeConstruct* createForgeConstruct() const {
return new ForgeMenuButton();
}
};
Код: Выделить всё
ForgeConstructFactory::Instance()->registerType("MenuButton", new ForgeMenuButtonCreator());
ошибка при выделении объекта абстрактного класса
Ошибка при выделении объекта абстрактного класса
Ошибка при выделении объекта абстрактного класса p>
Ошибка компиляции с clang:
Код: Выделить всё
unimplemented pure virtual method 'createForgeCosntruct' in 'ForgeMenuButtonCreator'
virtual ForgeConstruct* createForgeCosntruct() const = 0;
Подробнее здесь: https://stackoverflow.com/questions/788 ... class-type