summaryrefslogtreecommitdiff
path: root/tests/modules/testmod3/TestMod3.cpp
blob: c37fe723632e4620c3cc1dc53ad391cf7852acf9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#include "TestMod3.hpp"
#include "Common.hpp"

#include <iostream>

#include <vector>
#include <string>

using namespace std;

Derived::Derived( )
{
	vector<string> modules;
#ifndef _WIN32
	modules.push_back( "./testmod2/mod_test2.so" );
#else
	modules.push_back( ".\\testmod2\\mod_test2.dll" );	
#endif
	m_loader = new ModuleLoader<Base>( modules );
}

Derived::~Derived( )
{
	delete m_loader;
}

void Derived::hello( )
{
	Base *obj = m_loader->create( "testmod2" );
	obj->hello( );
	m_loader->destroy( obj );
	Common::instance( ).print( "hello world from module" );
}

REGISTER_MODULE( "testmod3", 0, 0, Base, Derived )