ThreadWeaver
WorkingHardState.h
Go to the documentation of this file.00001 /* -*- C++ -*- 00002 00003 This file declares the WorkingHardState class. 00004 00005 $ Author: Mirko Boehm $ 00006 $ Copyright: (C) 2005, 2006 Mirko Boehm $ 00007 $ Contact: mirko@kde.org 00008 http://www.kde.org 00009 http://www.hackerbuero.org $ 00010 00011 This library is free software; you can redistribute it and/or 00012 modify it under the terms of the GNU Library General Public 00013 License as published by the Free Software Foundation; either 00014 version 2 of the License, or (at your option) any later version. 00015 00016 This library is distributed in the hope that it will be useful, 00017 but WITHOUT ANY WARRANTY; without even the implied warranty of 00018 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00019 Library General Public License for more details. 00020 00021 You should have received a copy of the GNU Library General Public License 00022 along with this library; see the file COPYING.LIB. If not, write to 00023 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00024 Boston, MA 02110-1301, USA. 00025 00026 $Id: WorkingHardState.h 32 2005-08-17 08:38:01Z mirko $ 00027 */ 00028 00029 #ifndef WorkingHardState_H 00030 #define WorkingHardState_H 00031 00032 #include "StateImplementation.h" 00033 #include "WeaverImpl.h" 00034 00035 #ifndef THREADWEAVER_PRIVATE_API 00036 #define THREADWEAVER_PRIVATE_API 00037 #endif 00038 00039 namespace ThreadWeaver { 00040 00041 /* WorkingHardState handles the state dependent calls in the state where 00042 jobs are executed. */ 00043 class WorkingHardState : public StateImplementation 00044 { 00045 public: 00046 explicit WorkingHardState( WeaverImpl *weaver) 00047 : StateImplementation (weaver) 00048 { 00049 } 00051 virtual void suspend(); 00053 virtual void resume(); 00055 virtual Job* applyForWork ( Thread *th, Job* previous ); 00057 virtual void waitForAvailableJob ( Thread *th ); 00059 void activated(); 00060 00062 StateId stateId() const; 00063 }; 00064 00065 } 00066 00067 #endif // WorkingHardIState_H