Main Page | Class Hierarchy | Class List | Directories | File List | Class Members | Related Pages

dbList.h

00001 /***************************************************************************
00002  *   Copyright (C) 2006 by Graeme Foster                                   *
00003  *   email    foster.graeme@gmail.com                                      *
00004  *                                                                         *
00005  *   This program is free software; you can redistribute it and/or modify  *
00006  *   it under the terms of the GNU General Public License as published by  *
00007  *   the Free Software Foundation; either version 2 of the License, or     *
00008  *   (at your option) any later version.                                   *
00009  *                                                                         *
00010  *   This program is distributed in the hope that it will be useful,       *
00011  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00012  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
00013  *   GNU General Public License for more details.                          *
00014  *                                                                         *
00015  *   You should have received a copy of the GNU General Public License     *
00016  *   along with this program; if not, write to the                         *
00017  *   Free Software Foundation, Inc.,                                       *
00018  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
00019  ***************************************************************************/
00020 
00021 #ifndef __DB_LIST_H
00022 #define __DB_LIST_H
00023 
00024 #include <QList>
00025 
00026 #include "../DataClasses/DataClass.h"
00027 #include "sql.h"
00028 
00029 
00038 class dbList
00039 {
00040         private: // properties
00041                 QList<DataClass * > * pdcList; 
00042         private: // methods
00050                 QList<DataClass * > * allChildrenDeep(DataClass * parent);
00051         public: // methods
00052                 
00054                 dbList();
00058                 dbList(QList<DataClass * > * p_dcList);
00059                 
00060                 // Access methods
00063                 QList<DataClass * > * list();
00071                 QList<DataClass * > * allChildren(DataClass * parent, bool deep = false);
00072                 
00073                 // Modification methods
00078                 inline void insert(int posn, DataClass * data){pdcList->insert(posn,data);}
00082                 inline void append(DataClass * data){pdcList->append(data);}
00088                 DataClass * remove(int posn);
00093                 template <typename LessThan>
00094                 void resort (LessThan lessThan){qSort(pdcList->begin(), pdcList->end(),lessThan);};
00095                 // Info Methods
00096                 
00098                 inline int size()    {return pdcList->size();}
00103                 DataClass * at(int posn);
00104                 
00106                 void dump();
00107 };
00108 
00109 #endif

Generated on Thu Apr 6 16:27:17 2006 for time-table by  doxygen 1.4.4