src/common/modfactory.cpp
void ModuleFactory::unload(const std::string& id)
{
    BOOST_ASSERT(id.empty() == false);
    // first of all look at the known modules list
    IModulePtr module = getModule(id);
    if (module == NULL)
    {
        // can be called during unloading dependencies
        // that can be not loaded
        klk_log(KLKLOG_ERROR, "Failed to unload module '%s'. "
                "The module does not exist.", id.c_str());
        return;
    }

    IThreadPtr thread =
        boost::dynamic_pointer_cast<IThread, IModule>(module);
    BOOST_ASSERT(thread);
    if (getScheduler()->isStarted(thread))
    {
        getScheduler()->stopThread(thread);
    }
    BOOST_ASSERT(getScheduler()->isStarted(thread) == false);
}
// Unloads a module by its id
// @param[in] id the module id
Unloads a module by its id
Unloads a module by its id
void ModuleFactory::unload(const std::string& id)
{
    BOOST_ASSERT(id.empty() == false);
    IModulePtr module = getModule(id);
    if (module == NULL)
    {
        klk_log(KLKLOG_ERROR, "Failed to unload module '%s'. "
                "The module does not exist.", id.c_str());
        return;
    }
    IThreadPtr thread =
        boost::dynamic_pointer_cast<IThread, IModule>(module);
    BOOST_ASSERT(thread);
    if (getScheduler()->isStarted(thread))
    {
        getScheduler()->stopThread(thread);
    }
    BOOST_ASSERT(getScheduler()->isStarted(thread) == false);
}
void ModuleFactory :: unload ( const std :: string & id ) { BOOST_ASSERT ( id . empty ( ) == false ) ; IModulePtr module = getModule ( id ) ; if ( module == NULL ) { klk_log ( KLKLOG_ERROR , " " " " , id . c_str ( ) ) ; return ; } IThreadPtr thread = boost :: dynamic_pointer_cast < IThread , IModule > ( module ) ; BOOST_ASSERT ( thread ) ; if ( getScheduler ( ) -> isStarted ( thread ) ) { getScheduler ( ) -> stopThread ( thread ) ; } BOOST_ASSERT ( getScheduler ( ) -> isStarted ( thread ) == false ) ; }
Unloads a module by its id
Unloads a module by its id
// first of all look at the known modules list // can be called during unloading dependencies // that can be not loaded