#include "TestMod3.hpp" #include "Common.hpp" #include #include #include using namespace std; Derived::Derived( ) { vector modules; #ifndef _WIN32 modules.push_back( "./testmod2/mod_test2.so" ); #else modules.push_back( ".\\testmod2\\mod_test2.dll" ); #endif m_loader = new ModuleLoader( 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 )