DbPlugin Class Reference
[Public API]

Database plugin loader. More...

#include <dbplugin.h>

List of all members.


Public Member Functions

void close ()
 Unloads library.
DatabasecreateHandle () const throw (Exception)
 Creates new Database object.
 DbPlugin (const char *pFilename) throw (Exception)
 Loads library from path.
 DbPlugin ()
 Default constructor creates empty plugin (with no library loaded).
void destroyHandle (Database *pDb)
 Destroys Database object.
dbaPluginInfo getInfo () const throw (Exception)
 Loads plugin information.
void load (const char *pFilename) throw (Exception)
 Loads library from path.
virtual ~DbPlugin ()
 Destructor.

Detailed Description

Database plugin loader.

Loads plugin library and unloads it upon destruction. Usage:

try {
  DbPlugin* plugin = new DbPlugin("libsqlite3");
  Database* db(plugin->createHandle());
  DbConnection* conn = db->getConnection();
  [...]

  delete conn;
  delete db;
} catch (const dba::Exception& ex) {
  //error handling code
};

//cleanup only when all created databases and connections are deleted
delete plugin;


Constructor & Destructor Documentation

DbPlugin const char *  pFilename  )  throw (Exception)
 

Loads library from path.

Parameters:
pFilename OS specific path to library name

virtual ~DbPlugin  )  [virtual]
 

Destructor.

Calls close() if library is still loaded


Member Function Documentation

Database* createHandle  )  const throw (Exception)
 

Creates new Database object.

Returns:
pointer to created Database object

dbaPluginInfo getInfo  )  const throw (Exception)
 

Loads plugin information.

Returns:
pluginInfo structure that contains version, vendor and license information

void load const char *  pFilename  )  throw (Exception)
 

Loads library from path.

Parameters:
pFilename OS specific path to library name

The documentation for this class was generated from the following file:

Documentation
Quick start
Examples
Search

API Documentation
Class hierarchy
Member index
API Reference
Store filters
Store table macros
Back

Generated by doxygen at Sun Nov 9 02:08:19 2008