MAK Data Logger API Documentation for DIS
List of all members | Public Member Functions | Static Public Member Functions | Protected Types | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Static Protected Attributes
DtDatabaseDriverFactory Class Reference

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 DtDatabaseDrivergetDriver (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.
DtDatabaseDriverlookupDriverByName (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 DtDatabaseDriverFactoryacquire ()
 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 &)
DtDatabaseDriverFactoryoperator= (const DtDatabaseDriverFactory &)

Detailed Description

A Static interface for creating Database drivers.

Member Typedef Documentation

typedef std::map<DtString,DtDatabaseDriver*> DtDatabaseDriverFactory::DriverMap
protected

Constructor & Destructor Documentation

DtDatabaseDriverFactory::~DtDatabaseDriverFactory ( )

DTOR.

DtDatabaseDriverFactory::DtDatabaseDriverFactory ( const DtDatabaseDriverFactory )
private
DtDatabaseDriverFactory::DtDatabaseDriverFactory ( )
explicitprotected

Protected CTOR since users do not create a Driver Factory.

Member Function Documentation

static DtDatabaseDriverFactory* DtDatabaseDriverFactory::acquire ( )
staticprotected

Acquire a factory.

static std::vector<DtString> DtDatabaseDriverFactory::getDataSources ( const DtString &  driver)
static

Attempt to get all known data sources.

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 std::vector<DtString> DtDatabaseDriverFactory::getInstalledDrivers ( )
static

Attempt to get all installed drivers.

DtDatabaseDriver* DtDatabaseDriverFactory::lookupDriverByName ( const DtString &  driverName)
protected

Lookup a driver by name.

DtDatabaseDriverFactory& DtDatabaseDriverFactory::operator= ( const DtDatabaseDriverFactory )
private
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.

Exceptions
DtInvalidInputif 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.

Returns
true is driver was registered, false if it was not.
static void DtDatabaseDriverFactory::release ( )
staticprotected

Release a factory.

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.

Exceptions
DtInvalidInputif the driver is null.

Member Data Documentation

DriverMap DtDatabaseDriverFactory::myDriverMap
protected
DtDatabaseDriverFactory DtDatabaseDriverFactory::theDriverFactory
staticprotected
DtMutex DtDatabaseDriverFactory::theFactoryMutex
staticprotected

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

Document ID: Generated on Thu Apr 11 12:13:00 EDT 2013 from SVN revision 126011
Copyright © 2005-2012 VT MÄK. All Rights Reserved (www.mak.com)