A Static interface for creating Database drivers. More...
Collaboration diagram for DtDatabaseDriverFactory:Public Member Functions | |
| ~DtDatabaseDriverFactory () | |
| DTOR. | |
Static Public Member Functions | |
| static std::vector< DtString > | getInstalledDrivers () |
| Attempt to get all installed drivers. | |
| static const DtDatabaseDriver * | getDriver (const DtString &driverName) |
| Get a particular database driver. | |
| static void | registerDriver (DtDatabaseDriver *driver) |
| Register a driver, If a driver with the same name exists this function will fail and throw an exception. | |
| static void | replaceDriver (DtDatabaseDriver *driver) |
| Register a driver, If a driver with the same name exists, the original driver is destroyed and the new driver takes it's place. | |
| static std::vector< DtString > | getDataSources (const DtString &driver) |
| Attempt to get all known data sources. | |
Protected Types | |
|
typedef std::map< DtString, DtDatabaseDriver * > | DriverMap |
Protected Member Functions | |
| DtDatabaseDriverFactory () | |
| Protected CTOR since users do not create a Driver Factory. | |
| DtDatabaseDriver * | lookupDriverByName (const DtString &driverName) |
| Lookup a driver by name. | |
| bool | registerDriver (DtDatabaseDriver *driver, bool allowReplace) |
| Protected function for registering a driver. | |
Static Protected Member Functions | |
| static DtDatabaseDriverFactory * | acquire () |
| Acquire a factory. | |
| static void | release () |
| Release a factory. | |
Protected Attributes | |
| DriverMap | myDriverMap |
Static Protected Attributes | |
| static DtMutex | theFactoryMutex |
| static DtDatabaseDriverFactory | theDriverFactory |
Private Member Functions | |
| DtDatabaseDriverFactory (const DtDatabaseDriverFactory &) | |
| DtDatabaseDriverFactory & | operator= (const DtDatabaseDriverFactory &) |
A Static interface for creating Database drivers.
| static const DtDatabaseDriver* DtDatabaseDriverFactory::getDriver | ( | const DtString & | driverName | ) | [static] |
Get a particular database driver.
If the driver is not found. a null pointer is returned.
| static void DtDatabaseDriverFactory::registerDriver | ( | DtDatabaseDriver * | driver | ) | [static] |
Register a driver, If a driver with the same name exists this function will fail and throw an exception.
| DtInvalidInput | if a driver with the same name exists or if the driver is null. |
| bool DtDatabaseDriverFactory::registerDriver | ( | DtDatabaseDriver * | driver, |
| bool | allowReplace | ||
| ) | [protected] |
Protected function for registering a driver.
| static void DtDatabaseDriverFactory::replaceDriver | ( | DtDatabaseDriver * | driver | ) | [static] |
Register a driver, If a driver with the same name exists, the original driver is destroyed and the new driver takes it's place.
| DtInvalidInput | if the driver is null. |