Esempio n. 1
0
// =-=-=-=-=-=-=-
// function to load and return an initialized database plugin
    error load_database_plugin(
        database_ptr&      _plugin,
        const std::string& _plugin_name,
        const std::string& _inst_name,
        const std::string& _context ) {
        // =-=-=-=-=-=-=-
        // resolve plugin directory
        std::string plugin_home;
        error ret = resolve_plugin_path( PLUGIN_TYPE_DATABASE, plugin_home );
        if( !ret.ok() ) {
            return PASS( ret );
        }

        // =-=-=-=-=-=-=-
        // call generic plugin loader
        database* db = 0;
        ret = load_plugin< database >(
                  db,
                  _plugin_name,
                  plugin_home,
                  _inst_name,
                  _context );
        if ( ret.ok() && db ) {
            _plugin.reset( db );
            return SUCCESS();

        }
        else {
            return PASS( ret );

        }

    } // load_database_plugin
Esempio n. 2
0
 void check()
 {
     m_db.reset();
 }