| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667 | /*= StarPU-Top for StarPU =Copyright (C) 2011 William BraikYann CourtoisJean-Marie CouteyenAnthony RoyThis library is free software; you can redistribute it and/ormodify it under the terms of the GNU Lesser General PublicLicense as published by the Free Software Foundation; eitherversion 2.1 of the License, or (at your option) any later version.This library is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY; without even the implied warranty ofMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNULesser General Public License for more details.You should have received a copy of the GNU Lesser General PublicLicense along with this library; if not, write to the Free SoftwareFoundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA*/#ifndef TASKMANAGER_H#define TASKMANAGER_H#include "starputoptypes.h"#include <QDebug>#include <QtSql/QSqlDatabase>#include <QtSql/QSqlQuery>class TaskManager{ /* Manages the tasks received from the server     in a memory SQLITE database. */public:    TaskManager();    ~TaskManager();    void initialize();    bool connectDatabase();    // Add new tasks    void addTaskPrev(int taskId, int deviceId, qlonglong timestampStart,                     qlonglong timestampEnd);    void addTaskStart(int taskId, int deviceId, qlonglong timestampStart);    void addTaskEnd(int taskId, qlonglong timestampEnd);    // Getters    QList<StarputopTask> tasks(qlonglong timestampStart,                               qlonglong timestampEnd);    QList<StarputopTask> prevTasks(qlonglong timestampStart,                                   qlonglong timestampEnd);private:    // Metadata    // Database    QSqlDatabase _database;    // Queries    QSqlQuery _insertTaskPrevQuery;    QSqlQuery _insertTaskStartQuery;    QSqlQuery _updateTaskEndQuery;    QSqlQuery _selectTasksQuery;    QSqlQuery _selectPrevTasksQuery;};#endif // TASKMANAGER_H
 |