00001 /***************************************************************************** 00002 * Copyright (C) 2011 by Benjamin Hadorn (b_hadorn@bluewin.ch) 00003 ***************************************************************************** 00004 * Project : Zeus Base Library 00005 * Module : IThreadManager 00006 * Package : Zeus.ZeusBase.System.Interfaces 00007 * Author : Benjamin Hadorn 00008 * Date : 27.12.2011 00009 * System : Zeus-Framework 00010 ***************************************************************************** 00011 * Licence: * 00012 * This library is free software; you can redistribute it and/or modify * 00013 * it under the terms of the GNU Lesser General Public License as * 00014 * published by the Free Software Foundation; either version * 00015 * 2.1 of the License, or (at your option) any later version. * 00016 * * 00017 * This library is distributed in the hope that it will be useful, * 00018 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00019 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 00020 * GNU Lesser General Public License for more details. * 00021 * * 00022 * You should have received a copy of the GNU Lesser General Public * 00023 * License along with this library; if not, write to the Free Software * 00024 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA * 00025 *****************************************************************************/ 00026 00027 /***************************************************************************** 00028 * Changes: 00029 * 27.12.2011 bha: created zeus 2.0 00030 *****************************************************************************/ 00031 00032 #ifndef IThreadManagerHPP 00033 #define IThreadManagerHPP 00034 00035 #include <zeusbase/System/Interfaces/IZUnknown.hpp> 00036 00037 BEGIN_NAMESPACE_Zeus 00038 00039 // {ECA36038-829C-4110-B81E-0BA95EDEFD88} 00040 #define INTERFACE_IThreadManager TIID(0xeca36038, 0x829c, 0x4110, 0xb8, 0x1e, 0xb, 0xa9, 0x5e, 0xde, 0xfd, 0x88) 00041 00042 00043 class IThreadMessageQueue; 00044 class ISynchronizeObject; 00045 00046 /***************************************************************************/ 00049 /***************************************************************************/ 00050 class IThreadManager : public IZUnknown 00051 { 00052 HIDE_ASSIGNMENT_OPERATOR(IThreadManager) 00053 00054 public: 00055 00056 /***********************************************************************/ 00063 /***********************************************************************/ 00064 virtual void MQUALIFIER addThread(Uint uiID, IThreadMessageQueue& rQueue, bool bInterrupted) = 0; 00065 00066 /***********************************************************************/ 00070 /***********************************************************************/ 00071 virtual Uint MQUALIFIER getCurrentThreadID() const = 0; 00072 00073 /***********************************************************************/ 00080 /***********************************************************************/ 00081 virtual Retval MQUALIFIER getMessageQueue(Uint uiThreadID, IThreadMessageQueue*& rpQueue) = 0; 00082 00083 /***********************************************************************/ 00089 /***********************************************************************/ 00090 virtual bool MQUALIFIER isThreadInterrupted(Uint uiID)const=0; 00091 00092 /***********************************************************************/ 00096 /***********************************************************************/ 00097 virtual void MQUALIFIER removeThread(Uint uiID)=0; 00098 00099 /***********************************************************************/ 00104 /***********************************************************************/ 00105 virtual void MQUALIFIER setThreadState(Uint uiID, bool bInterrupted)=0; 00106 00107 /***********************************************************************/ 00110 /***********************************************************************/ 00111 virtual Uint MQUALIFIER getMainThreadID() const=0; 00112 00113 /***********************************************************************/ 00120 /***********************************************************************/ 00121 virtual Retval MQUALIFIER postObject(Uint uiThreadID, 00122 ISynchronizeObject& rObject, 00123 bool bWaitForCompletion)=0; 00124 00125 /***********************************************************************/ 00131 /***********************************************************************/ 00132 virtual Retval MQUALIFIER postObjectToMainThread(ISynchronizeObject& rObject, 00133 bool bWaitForCompletion)=0; 00134 00135 /***********************************************************************/ 00138 /***********************************************************************/ 00139 virtual bool MQUALIFIER isCurrentThread(Uint uiThreadID) const=0; 00140 00141 /***********************************************************************/ 00144 /***********************************************************************/ 00145 virtual bool MQUALIFIER isCurrentMainThread() const=0; 00146 }; 00147 00148 END_NAMESPACE_Zeus 00149 00150 #endif 00151