class Warrior{
public:
virtual std::string getDescription() const = 0;
};
PLUMA_PROVIDER_HEADER(Warrior);
#include "Warrior.hpp"
PLUMA_PROVIDER_SOURCE(Warrior, 1, 1);
#include "Warrior.hpp"
class Eagle: public Warrior{
public:
std::string getDescription(){
return "Eagle Warrior: soldier of the sun";
}
};
PLUMA_INHERIT_PROVIDER(Type, BaseType)
PLUMA_INHERIT_PROVIDER(Eagle, Warrior);
#include <Pluma/Pluma.hpp>
#include <Pluma/Connector.hpp>
PLUMA_CONNECTOR
bool connect(pluma::Host& host){
...
}
host.add( new EagleProvider() );
host.add( new JaguarProvider() );
pluma::Pluma manager;
manager.acceptProviderType< WarriorProvider >();
manager.load("plugins", "elite-warriors");
pluma.loadFromFolder("plugins", true);
std::vector<WarriorProvider*> providers;
manager.getProviders(providers);
std::vector<WarriorProvider*>::iterator it;
for (it = providers.begin() ; it != providers.end() ; ++it){
Warrior* warrior = (*it)->create();
std::cout << warrior->getDescription() << std::endl;
delete warrior;
}
▲Windows에서 MinGW 7.3.0 컴파일 후 실행. Plugin.dll (플러그인)을 로드하여 각각 Description을 출력한다.
번호 | 제목 | 글쓴이 | 날짜 | 조회 수 |
---|---|---|---|---|
» |
Pluma(C++ Plug-in Management Framework) 튜토리얼
![]() | makersweb | 2019.12.07 | 12905 |
6 | 도커(docker)설치 및 기본 명령어 | makersweb | 2019.12.02 | 304 |
5 |
webOS소개 및 Raspberry Pi 3 에서 실행
![]() | makersweb | 2019.10.13 | 3194 |
4 |
리눅스에서 SDL2 최신버전 컴파일과 Qt Creator로 개발환경 구성
![]() | makersweb | 2019.10.06 | 2350 |
3 |
텔레그램(Telegram) Bot 개발
![]() | makersweb | 2019.07.21 | 4453 |
2 |
GDBus 튜토리얼(GDBus tutorial)
![]() | makersweb | 2019.06.30 | 7380 |
1 |
Wayland IVI Extension 간단 리뷰
![]() | makersweb | 2019.05.12 | 1654 |