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을 출력한다.
번호 | 제목 | 글쓴이 | 날짜 | 조회 수 |
---|---|---|---|---|
15 | ZeroMQ 비동기 클라이언트/서버 패턴 | makersweb | 2020.08.13 | 1775 |
14 | AGL (Automotive Grade Linux) 개요 | makersweb | 2022.06.19 | 1858 |
13 | Nana, C++용 크로스플랫폼 GUI 라이브러리 | makersweb | 2021.01.06 | 2072 |
12 | Wayland IVI Extension 간단 리뷰 | makersweb | 2019.05.12 | 2259 |
11 | Flutter Application 에서 한글(EUC-KR) 깨져서 나오는 문제 | makersweb | 2022.01.06 | 2685 |
10 | 리눅스에서 SDL2 최신버전 컴파일과 Qt Creator로 개발환경 구성 | makersweb | 2019.10.06 | 3040 |
9 | [SDL2 와 OpenGL]윈도우 생성과 2D그래픽 | makersweb | 2020.04.11 | 3076 |
8 | 가볍고 쉬운 임베디드용 그래픽 라이브러리 - LVGL | makersweb | 2020.09.16 | 3361 |
7 | webOS소개 및 Raspberry Pi 3 에서 실행 | makersweb | 2019.10.13 | 3884 |
6 | 텔레그램(Telegram) Bot 개발 | makersweb | 2019.07.21 | 5716 |
5 | GENIVI DLT(Diagnostic Log and Trace) 활용 | makersweb | 2020.11.19 | 8397 |
4 | ZeroMQ의 기본 메세지 패턴들 | makersweb | 2020.07.31 | 8522 |
3 | Dear ImGui, 경량의 C++ 용 GUI 및 Widget 라이브러리 | makersweb | 2020.11.28 | 9089 |
2 | GDBus 튜토리얼(GDBus tutorial) | makersweb | 2019.06.30 | 10374 |
» | Pluma(C++ Plug-in Management Framework) 튜토리얼 | makersweb | 2019.12.07 | 14012 |