#include </home/clem/local/src/opie/noncore/apps/tableviewer/db/datacache.h>
Collaboration diagram for DBStore:

Public Member Functions | |
| DBStore () | |
| ~DBStore () | |
| bool | openSource (QIODevice *, const QString &source) |
| bool | saveSource (QIODevice *, const QString &source) |
| void | addItem (DataElem *) |
| void | addItemInternal (DataElem *) |
| void | removeItem (DataElem *) |
| void | setName (const QString &name) |
| QString | getName () |
| KeyList * | getKeys () |
| void | setKeys (KeyList *) |
| int | getNumFields () |
| int | getKeyIndex (QString qs) |
| TVVariant::KeyType | getKeyType (int i) |
| QString | getKeyName (int i) |
| void | first () |
| void | last () |
| bool | next () |
| bool | previous () |
| DataElem * | getCurrentData () |
Private Member Functions | |
| void | freeTable () |
Private Attributes | |
| QString | name |
| QVector< DataElem > | master_table |
| DBAccess * | archive |
| KeyList * | kRep |
| unsigned int | number_elems |
| unsigned int | table_size |
| bool | full |
| unsigned int | current_elem |
Definition at line 68 of file datacache.h.
|
|
Constructs a DBStore item Definition at line 53 of file datacache.cpp. References archive, current_elem, full, INIT_TABLE_SIZE, kRep, master_table, name, number_elems, and table_size. |
|
|
Removes all items from the DBStore and destroys the DBStore Definition at line 90 of file datacache.cpp. References freeTable(). |
|
|
This function is used to add new elements to the database. If the database has already reached the maximum allowable size this function does not alter the database.
Definition at line 152 of file datacache.cpp. References addItemInternal(). Referenced by DBXmlHandler::endElement(), TableViewerWindow::newItemSlot(), and DBCsv::openSource(). |
|
|
Definition at line 157 of file datacache.cpp. References current_elem, full, master_table, number_elems, oendl, owarn, and table_size. Referenced by addItem(). |
|
|
Sets the current element to the first element of the database Definition at line 240 of file datacache.cpp. References current_elem. Referenced by TableViewerWindow::applyFilter(), TableViewerWindow::editKeysSlot(), TableViewerWindow::openDocument(), DBXml::saveSource(), and DBCsv::saveSource(). |
|
|
Reinitializes the table to empty (include a resize of the master table, which should free some memory) Definition at line 71 of file datacache.cpp. References archive, QIntDict< type >::clear(), current_elem, full, INIT_TABLE_SIZE, kRep, master_table, name, number_elems, and table_size. Referenced by openSource(), and ~DBStore(). |
|
|
Returns the current data element in the database. Which element is current is affected by newly added items, findItem, next, previous, first and last functions
Definition at line 296 of file datacache.cpp. References current_elem, master_table, NULL, and number_elems. Referenced by TableViewerWindow::applyFilter(), TableViewerWindow::editKeysSlot(), TableViewerWindow::openDocument(), DBXml::saveSource(), and DBCsv::saveSource(). |
|
|
gets the index of a key given its name Definition at line 96 of file datacache.h. References KeyList::getKeyIndex(), and kRep. Referenced by DataElem::getField(), DataElem::getFieldType(), DataElem::hasValidValue(), DataElem::setField(), and DataElem::unsetField(). |
|
|
gets the name of a key given its index Definition at line 106 of file datacache.h. References KeyList::getKeyName(), and kRep. Referenced by DataElem::toQString(). |
|
|
Retrieves a pointer to the key representation of the database for other classes to use as reference.
Definition at line 223 of file datacache.cpp. References kRep. Referenced by DataElem::getKeys(), DataElem::hasValidValue(), TableViewerWindow::newDocument(), TableViewerWindow::openDocument(), DBXml::saveSource(), DBCsv::saveSource(), and TableViewerWindow::TableViewerWindow(). |
|
|
gets the type of a key given its index Definition at line 101 of file datacache.h. References KeyList::getKeyType(), and kRep. Referenced by DataElem::getFieldType(), DBXml::saveSource(), DataElem::setField(), and DataElem::toSortableQString(). |
|
|
Gets the name of the database
Definition at line 212 of file datacache.cpp. References name. Referenced by TableViewerWindow::openDocument(), and DBXml::saveSource(). |
|
|
gets the number of fields defined in the database Definition at line 91 of file datacache.h. References KeyList::getNumFields(), and kRep. Referenced by DataElem::DataElem(), and DataElem::getNumFields(). |
|
|
Sets the current element to the last element of the database Definition at line 248 of file datacache.cpp. References current_elem, and number_elems. |
|
|
Sets the current element to the next element of the database if there exists an element after the current one. Definition at line 257 of file datacache.cpp. References current_elem, and number_elems. Referenced by TableViewerWindow::applyFilter(), TableViewerWindow::editKeysSlot(), TableViewerWindow::openDocument(), DBXml::saveSource(), and DBCsv::saveSource(). |
|
||||||||||||
|
This function opens the given xml file, loads it and sets up the appropriate data structures.
Definition at line 102 of file datacache.cpp. References archive, freeTable(), number_elems, and DBAccess::openSource(). Referenced by TableViewerWindow::openDocument(). |
|
|
Sets the current element to the previous element of the database if there exists an element before the current one. Definition at line 275 of file datacache.cpp. References current_elem, and number_elems. |
|
|
Definition at line 185 of file datacache.cpp. References master_table, and number_elems. Referenced by TableViewerWindow::deleteItemSlot(). |
|
||||||||||||
|
Definition at line 119 of file datacache.cpp. References archive, DBAccess::saveSource(), and DBAccess::type(). Referenced by TableViewerWindow::saveDocument(). |
|
|
sets the database's key representation the passed pointer
Definition at line 232 of file datacache.cpp. References kRep. Referenced by TableViewerWindow::editKeysSlot(), DBXmlHandler::endElement(), and DBCsv::openSource(). |
|
|
Sets the name of the database
Definition at line 202 of file datacache.cpp. References name. Referenced by DBXmlHandler::startElement(). |
|
|
Definition at line 126 of file datacache.h. Referenced by DBStore(), freeTable(), openSource(), and saveSource(). |
|
|
Definition at line 134 of file datacache.h. Referenced by addItemInternal(), DBStore(), first(), freeTable(), getCurrentData(), last(), next(), and previous(). |
|
|
Definition at line 132 of file datacache.h. Referenced by addItemInternal(), DBStore(), and freeTable(). |
|
|
Definition at line 128 of file datacache.h. Referenced by DBStore(), freeTable(), getKeyIndex(), getKeyName(), getKeys(), getKeyType(), getNumFields(), and setKeys(). |
|
|
Definition at line 125 of file datacache.h. Referenced by addItemInternal(), DBStore(), freeTable(), getCurrentData(), and removeItem(). |
|
|
Definition at line 123 of file datacache.h. Referenced by DBStore(), freeTable(), getName(), and setName(). |
|
|
Definition at line 130 of file datacache.h. Referenced by addItemInternal(), DBStore(), freeTable(), getCurrentData(), last(), next(), openSource(), previous(), and removeItem(). |
|
|
Definition at line 131 of file datacache.h. Referenced by addItemInternal(), DBStore(), and freeTable(). |
1.4.2