This snippet illustrates how to use dynamic module. Dynmod provide a support for dynamically loading shared libraries with the specific implementation based on standard API with versioning (checking API versions) and standard lifecycle methods (single init & finalization library, creating an instance of object, looking up object by class name)
The TestDynmod module should exist and ITestInstance interface should be implemented inside it.
// Load module
auxutils::dynmod::ModulesFactory* poFactory = auxutils::dynmod::ModulesFactory::getInstance();
auxutils::dynmod::IModule::SharedPtr poModule = poFactory->loadModule("TestDynmod");
// Create the object instance
boost::shared_ptr poInstance = poModule->createModuleObject();
poInstance->doIt();
// ..
// Delete object and unload module
poInstance.reset();
poFactory->unloadModule ( poModule );