Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Class Members | File Members

DatabaseManager Class Reference

#include <DatabaseManager.h>

List of all members.

Public Member Functions

 DatabaseManager (QWidget *parent, QString flNme, bool saveDB, DBInterface *netDBInter, DBInterface *archDBInter, DBInterface *pattDBInter, DBInterface *devDBInter)
 ~DatabaseManager ()

Private Slots

void cancelButtonPressed ()
void okButtonPressed ()
void processExited ()
void readFromStderr ()
void readFromStdout ()

Private Member Functions

int addDatabaseToTable (DBInterface *dbInter)
 DatabaseManager (const DatabaseManager &)
void fillLoadTable ()
void getAvailableDatabases ()
void loadDatabase (DBInterface *dbInter)
DatabaseManager operator= (const DatabaseManager &)
void saveDatabase (DBInterface *dbInter, bool compress)

Private Attributes

DBInterface * archDBInterface
int archDBRow
BusyDialogbusyDialog
stack< DBInterface * > dbStack
QTable * dbTable
DBInterface * devDBInterface
int devDBRow
QString fileName
QString fileNameNoExtension
unsigned int hostCol
bool listingDatabases
QStringList loadDBList
bool loadingDatabase
unsigned int nameCol
DBInterface * netDBInterface
int netDBRow
DBInterface * pattDBInterface
int pattDBRow
QProcess * process
bool saveMode
bool savingDatabase
unsigned int selectionCol
bool storeList


Detailed Description

Provides an interface that allows the user to select which databases to save or load and carries out this saving and loading.

Definition at line 45 of file DatabaseManager.h.


Constructor & Destructor Documentation

DatabaseManager::DatabaseManager QWidget *  parent,
QString  flNme,
bool  saveDB,
DBInterface *  netDBInter,
DBInterface *  archDBInter,
DBInterface *  pattDBInter,
DBInterface *  devDBInter
 

Constructor.

Definition at line 36 of file DatabaseManager.cpp.

References addDatabaseToTable(), archDBInterface, archDBRow, busyDialog, cancelButtonPressed(), dbTable, devDBInterface, devDBRow, fileName, fileNameNoExtension, getAvailableDatabases(), hostCol, nameCol, netDBInterface, netDBRow, okButtonPressed(), pattDBInterface, pattDBRow, process, processExited(), readFromStderr(), readFromStdout(), saveMode, and selectionCol.

DatabaseManager::~DatabaseManager  ) 
 

Destructor.

Definition at line 128 of file DatabaseManager.cpp.

DatabaseManager::DatabaseManager const DatabaseManager  )  [private]
 

Declare copy constructor private so it cannot be used inadvertently.


Member Function Documentation

int DatabaseManager::addDatabaseToTable DBInterface *  dbInter  )  [private]
 

Adds the information in the database to the table.

Definition at line 330 of file DatabaseManager.cpp.

References dbTable, hostCol, nameCol, and selectionCol.

Referenced by DatabaseManager(), and fillLoadTable().

void DatabaseManager::cancelButtonPressed  )  [private, slot]
 

Hides dialog when cancel button is pressed.

Definition at line 140 of file DatabaseManager.cpp.

Referenced by DatabaseManager().

void DatabaseManager::fillLoadTable  )  [private]
 

Looks at list of databases stored in the file and adds them to the table.

Definition at line 353 of file DatabaseManager.cpp.

References addDatabaseToTable(), archDBInterface, archDBRow, devDBInterface, devDBRow, loadDBList, netDBInterface, netDBRow, pattDBInterface, and pattDBRow.

Referenced by processExited().

void DatabaseManager::getAvailableDatabases  )  [private]
 

Uses the DBFileInspector script to list all of the databases in the file.

Definition at line 375 of file DatabaseManager.cpp.

References fileName, listingDatabases, loadingDatabase, process, savingDatabase, and SpikeStreamMainWindow::workingDirectory.

Referenced by DatabaseManager().

void DatabaseManager::loadDatabase DBInterface *  dbInter  )  [private]
 

Loads a database from the file using LoadSpikeStreamDatabase script.

Definition at line 399 of file DatabaseManager.cpp.

References dbStack, fileName, listingDatabases, loadingDatabase, process, savingDatabase, and SpikeStreamMainWindow::workingDirectory.

Referenced by okButtonPressed(), and processExited().

void DatabaseManager::okButtonPressed  )  [private, slot]
 

Checks to see which databases are to be saved or loaded and carries out the appropriate actions.

Definition at line 147 of file DatabaseManager.cpp.

References archDBInterface, archDBRow, busyDialog, dbStack, dbTable, devDBInterface, devDBRow, loadDatabase(), netDBInterface, netDBRow, pattDBInterface, pattDBRow, saveDatabase(), saveMode, selectionCol, and BusyDialog::showDialog().

Referenced by DatabaseManager().

DatabaseManager DatabaseManager::operator= const DatabaseManager  )  [private]
 

Declare assignment private so it cannot be used inadvertently.

void DatabaseManager::processExited  )  [private, slot]
 

Slot called when QProcess exits.

Definition at line 203 of file DatabaseManager.cpp.

References busyDialog, dbStack, fileName, fillLoadTable(), listingDatabases, loadDatabase(), loadingDatabase, saveDatabase(), and savingDatabase.

Referenced by DatabaseManager().

void DatabaseManager::readFromStderr  )  [private, slot]
 

Reads output from stderr generated by process. Tries to terminate process.

Definition at line 264 of file DatabaseManager.cpp.

References busyDialog, and process.

Referenced by DatabaseManager().

void DatabaseManager::readFromStdout  )  [private, slot]
 

Prints stdout. When listing databases this is used to get the list of databases available in a file.

Definition at line 294 of file DatabaseManager.cpp.

References listingDatabases, loadDBList, process, and storeList.

Referenced by DatabaseManager().

void DatabaseManager::saveDatabase DBInterface *  dbInter,
bool  compress
[private]
 

Saves a database into the file using SaveSpikeStreamDatabase script. If it is the last database to be saved, compress should be set to true so that the file is compressed.

Definition at line 449 of file DatabaseManager.cpp.

References dbStack, fileNameNoExtension, listingDatabases, loadingDatabase, process, savingDatabase, and SpikeStreamMainWindow::workingDirectory.

Referenced by okButtonPressed(), and processExited().


Member Data Documentation

DBInterface* DatabaseManager::archDBInterface [private]
 

Definition at line 65 of file DatabaseManager.h.

Referenced by DatabaseManager(), fillLoadTable(), and okButtonPressed().

int DatabaseManager::archDBRow [private]
 

Definition at line 88 of file DatabaseManager.h.

Referenced by DatabaseManager(), fillLoadTable(), and okButtonPressed().

BusyDialog* DatabaseManager::busyDialog [private]
 

Dialog to inform user that it is busy.

Definition at line 109 of file DatabaseManager.h.

Referenced by DatabaseManager(), okButtonPressed(), processExited(), and readFromStderr().

stack<DBInterface*> DatabaseManager::dbStack [private]
 

Holds references to all of the databases that need to be saved.

Definition at line 106 of file DatabaseManager.h.

Referenced by loadDatabase(), okButtonPressed(), processExited(), and saveDatabase().

QTable* DatabaseManager::dbTable [private]
 

Definition at line 93 of file DatabaseManager.h.

Referenced by addDatabaseToTable(), DatabaseManager(), and okButtonPressed().

DBInterface* DatabaseManager::devDBInterface [private]
 

Definition at line 67 of file DatabaseManager.h.

Referenced by DatabaseManager(), fillLoadTable(), and okButtonPressed().

int DatabaseManager::devDBRow [private]
 

Definition at line 90 of file DatabaseManager.h.

Referenced by DatabaseManager(), fillLoadTable(), and okButtonPressed().

QString DatabaseManager::fileName [private]
 

Name of the file to save or load. Should be with an extension.

Definition at line 96 of file DatabaseManager.h.

Referenced by DatabaseManager(), getAvailableDatabases(), loadDatabase(), and processExited().

QString DatabaseManager::fileNameNoExtension [private]
 

File name with extension removed. The extension should be added back by script.

Definition at line 100 of file DatabaseManager.h.

Referenced by DatabaseManager(), and saveDatabase().

unsigned int DatabaseManager::hostCol [private]
 

Definition at line 83 of file DatabaseManager.h.

Referenced by addDatabaseToTable(), and DatabaseManager().

bool DatabaseManager::listingDatabases [private]
 

Set to true when the script is running to list the databases.

Definition at line 73 of file DatabaseManager.h.

Referenced by getAvailableDatabases(), loadDatabase(), processExited(), readFromStdout(), and saveDatabase().

QStringList DatabaseManager::loadDBList [private]
 

List of databases that can be loaded from the file.

Definition at line 116 of file DatabaseManager.h.

Referenced by fillLoadTable(), and readFromStdout().

bool DatabaseManager::loadingDatabase [private]
 

Set to true when the script is running to load the databases.

Definition at line 79 of file DatabaseManager.h.

Referenced by getAvailableDatabases(), loadDatabase(), processExited(), and saveDatabase().

unsigned int DatabaseManager::nameCol [private]
 

Definition at line 82 of file DatabaseManager.h.

Referenced by addDatabaseToTable(), and DatabaseManager().

DBInterface* DatabaseManager::netDBInterface [private]
 

Definition at line 64 of file DatabaseManager.h.

Referenced by DatabaseManager(), fillLoadTable(), and okButtonPressed().

int DatabaseManager::netDBRow [private]
 

Definition at line 87 of file DatabaseManager.h.

Referenced by DatabaseManager(), fillLoadTable(), and okButtonPressed().

DBInterface* DatabaseManager::pattDBInterface [private]
 

Definition at line 66 of file DatabaseManager.h.

Referenced by DatabaseManager(), fillLoadTable(), and okButtonPressed().

int DatabaseManager::pattDBRow [private]
 

Definition at line 89 of file DatabaseManager.h.

Referenced by DatabaseManager(), fillLoadTable(), and okButtonPressed().

QProcess* DatabaseManager::process [private]
 

The process that executes the script.

Definition at line 103 of file DatabaseManager.h.

Referenced by DatabaseManager(), getAvailableDatabases(), loadDatabase(), readFromStderr(), readFromStdout(), and saveDatabase().

bool DatabaseManager::saveMode [private]
 

Are we saving or loading the database.

Definition at line 70 of file DatabaseManager.h.

Referenced by DatabaseManager(), and okButtonPressed().

bool DatabaseManager::savingDatabase [private]
 

Set to true when the script is running to save the databases.

Definition at line 76 of file DatabaseManager.h.

Referenced by getAvailableDatabases(), loadDatabase(), processExited(), and saveDatabase().

unsigned int DatabaseManager::selectionCol [private]
 

Definition at line 84 of file DatabaseManager.h.

Referenced by addDatabaseToTable(), DatabaseManager(), and okButtonPressed().

bool DatabaseManager::storeList [private]
 

Records whether the script has started outputing information about the files.

Definition at line 113 of file DatabaseManager.h.

Referenced by readFromStdout().


The documentation for this class was generated from the following files:
Generated on Mon Sep 3 22:29:05 2007 for SpikeStream Application by  doxygen 1.4.4