F:/KPlato/koffice/libs/kofficecore/threadAction/KoJobsListPolicy.h

Aller à la documentation de ce fichier.
00001 /*
00002  * Copyright (C) 2006 Thomas Zander <zander@kde.org>
00003  *
00004  * This library is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU Library General Public
00006  * License as published by the Free Software Foundation; either
00007  * version 2 of the License, or (at your option) any later version.
00008  *
00009  * This library is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012  * Library General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU Library General Public License
00015  * along with this library; see the file COPYING.LIB.  If not, write to
00016  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00017  * Boston, MA 02110-1301, USA.
00018  */
00019 #ifndef TW_JOBSLISTPOLICY_H
00020 #define TW_JOBSLISTPOLICY_H
00021 #include <QueuePolicy.h>
00022 
00023 #include <QMutex>
00024 #include <QList>
00025 
00026 class ThreadWeaver::Job;
00027 
00033 class KoJobsListPolicy : public ThreadWeaver::QueuePolicy {
00034 public:
00036     KoJobsListPolicy();
00038     void addJob(ThreadWeaver::Job *job);
00039 
00041     bool canRun (ThreadWeaver::Job *job);
00043     void free (ThreadWeaver::Job *job);
00045     void release (ThreadWeaver::Job *job);
00047     void destructed (ThreadWeaver::Job *job);
00048 
00055     const QList<ThreadWeaver::Job*> jobs();
00057     int count();
00058 
00064     void lock() { mutex.lock(); }
00069     void unlock() { mutex.unlock(); }
00070 
00071 private:
00072     QList<ThreadWeaver::Job*> m_jobs;
00073     QMutex mutex;
00074 };
00075 
00076 #endif

Généré le Wed Nov 22 23:41:04 2006 pour KPlato par  doxygen 1.5.1-p1