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 | C++를 위한 Lottie 라이브러리 with SDL2 | makersweb | 2021.08.15 | 979 |
14 | NAppGUI, C언어용 크로스 플랫폼 GUI 라이브러리 | makersweb | 2022.10.10 | 900 |
13 | Protocol Buffers 를 이용한 직렬화 with Conan Package Manager | makersweb | 2021.02.24 | 881 |
12 | ZeroMQ 를 이용한 Qt 응용프로그램 간 통신 | makersweb | 2021.08.28 | 874 |
11 | VSCode 와 Qbs 플러그인으로 C/C++ 개발환경 구성 | makersweb | 2021.09.12 | 874 |
10 | 윈도우에서 안드로이드 flutter 프로그래밍 개발환경 구축(with Visual Studio Code) | makersweb | 2020.09.16 | 808 |
9 | Chromium과 Ozone 층 | makersweb | 2022.03.03 | 754 |
8 | Windows에서 Qt Creator + CMake + vcpkg 로 C++ 개발환경 구성 (POCO 라이브러리 DirectoryWatcher 예제) | makersweb | 2023.01.14 | 724 |
7 | 라즈베리파이에서 Redis의 Pub/Sub 패턴을 사용하는 Electron 응용프로그램 | makersweb | 2021.01.31 | 691 |
6 | 라즈베리파이4에서 openFrameworks 예제 실행 | makersweb | 2020.12.13 | 564 |
5 | CopperSpice 에 대해서 (C++ Gui 라이브러리) | makersweb | 2022.01.02 | 552 |
4 | OTA 오픈소스 프로젝트 | makersweb | 2022.08.03 | 501 |
3 | 도커(docker)설치 및 기본 명령어 | makersweb | 2019.12.02 | 487 |
2 | Flutter 위젯의 상태관리에 대해서 | makersweb | 2023.04.06 | 468 |
1 | openFrameworks 한글 폰트 설정 및 출력하기 | makersweb | 2023.02.19 | 226 |