1 #ifndef DatabaseFactory_h 2 #define DatabaseFactory_h 30 #include <QSqlDatabase> 286 return (_defDatabase);
304 return (_defProfName);
320 return (_profiles.
exists(name));
325 bool isAvailable(
const QString &dbname =
"")
const;
332 bool setAsDefault =
false);
333 void remove(
const QString &dbname);
334 void destroy(
const QString &dbname);
341 static void DieAtExit();
352 QString _defProfName;
354 QString _defDatabase;
358 void initPreferences();
360 Drivers getResourceList(
bool drivers,
bool connections)
const;
QString getDefault() const
Returns the name of the default database.
Definition: DatabaseFactory.h:285
std::vector< QString > available() const
Determine what database drivers are available.
Definition: DatabaseFactory.cpp:273
void setDefault(const QString &name)
Sets the default name of the database.
Definition: DatabaseFactory.h:272
void addProfile(const DbProfile &profile)
Adds a database access profile to the list of profiles.
Definition: DatabaseFactory.cpp:207
DbProfile getProfile(const QString &name="") const
Get the specified database access profile.
Definition: DatabaseFactory.cpp:248
static DatabaseFactory * getInstance()
Returns and instance of this DatabaseFactory singleton.
Definition: DatabaseFactory.cpp:137
Create database interfaces using access profiles or generic drivers.
Definition: DatabaseFactory.h:258
A DbProfile is a container for access parameters to a database.
Definition: DbProfile.h:65
bool addAccessProfile(const QString &profileFile)
Establishes an access profile for subsequent database connections.
Definition: DatabaseFactory.cpp:165
bool setDefaultProfileName(const QString &name)
Sets the default profile to the name provided.
Definition: DatabaseFactory.h:318
bool exists(const K &key) const
Checks the existance of a particular key in the list.
Definition: CollectorMap.h:567
bool isAvailable(const QString &dbname="") const
Check for availablity of a database connection resource.
Definition: DatabaseFactory.cpp:310
bool isDriverAvailable(const QString &driver) const
Check for the existance of a specific database driver.
Definition: DatabaseFactory.cpp:292
QString getDefaultProfileName() const
Returns the name of the default profile.
Definition: DatabaseFactory.h:303
Collector/container for arbitrary items.
Definition: CollectorMap.h:435
void add(const QSqlDatabase &db, const QString &name, bool setAsDefault=false)
Adds the database to the connection pool making it persistant.
Definition: DatabaseFactory.cpp:428
Namespace for ISIS/Bullet specific routines.
Definition: Apollo.h:31
bool isConnected(const QString &dbname) const
Determines if the database resource is connected.
Definition: DatabaseFactory.cpp:328
std::vector< QString > getProfileList() const
Return list of names of currently available profiles.
Definition: DatabaseFactory.cpp:220
void destroy(const QString &dbname)
Removes the database from the connection pool and destroys it.
Definition: DatabaseFactory.cpp:448
bool isPersistant(const QString &name) const
Checks if the database resource is persistant.
Definition: DatabaseFactory.cpp:348
QSqlDatabase create(const QString &driver, const QString &dbname)
Create a database using the named driver.
Definition: DatabaseFactory.cpp:371