#include <dbList.h>
Public Member Functions | |
dbList () | |
The default constructor. | |
dbList (QList< DataClass * > *p_dcList) | |
QList< DataClass * > * | list () |
QList< DataClass * > * | allChildren (DataClass *parent, bool deep=false) |
void | insert (int posn, DataClass *data) |
void | append (DataClass *data) |
DataClass * | remove (int posn) |
template<typename LessThan> | |
void | resort (LessThan lessThan) |
int | size () |
Method that returns the size of the list. | |
DataClass * | at (int posn) |
void | dump () |
Method to dump out some details about the current result set. |
This is a simple container class that will hold the data from a single table. This data will be kept in sychronisation with the database.
It is the responsibility of the dbListManager class to maintain the synchronisation.
Definition at line 38 of file dbList.h.
|
A constructor that will use the list passed in.
Definition at line 28 of file dbList.cpp.
|
|
Method that will return a list of all the rows that are children of the argument parent. if deep is true then the method allChildrenDeep will be called.
Definition at line 39 of file dbList.cpp. References size(). Referenced by dbListManager::getDepartmentList(), dbListManager::getFacultyList(), dbListManager::getMLAllocList(), dbListManager::getModuleList(), dbListManager::getProgrammeList(), dbListManager::getRoomList(), dbListManager::getStaffList(), and dbListManager::getTimeSlotList(). 00040 { 00041 if (deep) 00042 return allChildrenDeep(parent); 00043 00044 QList<DataClass * > * pChildren = new QList<DataClass * >(); 00045 for (int i = 0; i<size(); i++) 00046 if (pdcList->at(i)->getParent() == parent) 00047 pChildren->append(pdcList->at(i)); 00048 return pChildren; 00049 }
|
|
Method to add the object to the end of the list.
Definition at line 82 of file dbList.h.
|
|
Method that returns the object which is at the given position in the list
Definition at line 86 of file dbList.cpp. Referenced by dbListManager::dump(), dbListManager::insert(), and dbListManager::remove(). 00087 { 00088 if (posn < 0 || posn >= pdcList->size()) 00089 return 0; 00090 else 00091 { 00092 return pdcList->at(posn); 00093 } 00094 }
|
|
Method to insert an object into the list at the given position
Definition at line 78 of file dbList.h. Referenced by dbListManager::insert().
|
|
Method that will return all the rows that are held on the table Definition at line 34 of file dbList.cpp. Referenced by dbListManager::getDepartmentList(), dbListManager::getFacultyList(), dbListManager::getInstituteList(), dbListManager::getMLAllocList(), dbListManager::getModuleList(), dbListManager::getProgrammeList(), dbListManager::getRoomList(), dbListManager::getStaffList(), and dbListManager::getTimeSlotList().
|
|
Method to remove the object at the given position from the list. If posn is not valid then nothing is removes and 0 is returned.
Definition at line 73 of file dbList.cpp. Referenced by dbListManager::remove(). 00074 { 00075 if (posn < 0 || posn >= pdcList->size()) 00076 return 0; 00077 else 00078 { 00079 DataClass * dc = pdcList->at(posn); 00080 pdcList->removeAt(posn); 00081 return dc; 00082 } 00083 }
|
|
Method to resort the list. This is necessary if the data for which the sort field is the key has changed. Definition at line 94 of file dbList.h. Referenced by dbListManager::update().
|