# DriverFactoryBase Class Reference

Inheritance diagram for DriverFactoryBase:

## Public Member Functions

virtual | ~DriverFactoryBase ()
| Frees memory used for this->name.
virtual const char * | GetDescription ()=0
| Get a nice description of the driver-class.
virtual Driver * | CreateInstance ()=0
| Create an instance of this driver-class.

## Static Public Member Functions

static void | ShutdownDrivers ()
| Shuts down all active drivers.
static Driver * | SelectDriver (const char *name, Driver::Type type)
| Find the requested driver and return its class.
static char * | GetDriversInfo (char *p, const char *last)
| Build a human readable list of available drivers, grouped by type.

## Protected Member Functions

void | RegisterDriver (const char *name, Driver::Type type, int priority)
| Register a driver internally, based on its name.

## Private Types

typedef std::map< const char *, DriverFactoryBase *, StringCompare > | Drivers

## Static Private Member Functions

static Drivers & | GetDrivers ()
static Driver ** | GetActiveDriver (Driver::Type type)
static const char * | GetDriverTypeName (Driver::Type type)

## Private Attributes

Driver::Type | type
const char * | name
int | priority

## Detailed Description

Definition at line 46 of file driver.h.

## Member Function Documentation

void DriverFactoryBase::RegisterDriver | ( | const char * | name,
|  | Driver::Type | type,
|  | int | priority |
| ) |  |  | `[protected]`

Register a driver internally, based on its name.

Parameters:

  | name | the name of the driver.
  | type | the type of driver to register
  | priority | the priority; how badly do we want this as default?

Note:
  an assert() will be trigger if 2 driver with the same name try to register.

Definition at line 153 of file driver.cpp.

References lastof, and strecpy().

Driver * DriverFactoryBase::SelectDriver | ( | const char * | name,
|  | Driver::Type | type |
| ) |  |  | `[static]`

Find the requested driver and return its class.

Parameters:

  | name | the driver to select.
  | type | the type of driver to select

Postcondition:
  Sets the driver so GetCurrentDriver() returns it too.

Definition at line 68 of file driver.cpp.

References CreateInstance(), lastof, lengthof, strecpy(), StrEmpty(), and usererror().

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

- src/driver.h
- src/driver.cpp