00001 //******************************************************************************* 00002 // 00003 // ******* *** *** * 00004 // * * * * 00005 // * * * ***** 00006 // * * *** * * ** * ** *** 00007 // * * * * * * * **** * * * 00008 // * * * * * * * * * * * 00009 // * *** *** * ** ** ** * * 00010 // * 00011 //******************************************************************************* 00012 // see http://sourceforge.net/projects/tcsystem/ for details. 00013 // Copyright (C) 2003 - 2008 Thomas Goessler. All Rights Reserved. 00014 //******************************************************************************* 00015 // 00016 // TCSystem is the legal property of its developers. 00017 // Please refer to the COPYRIGHT file distributed with this source distribution. 00018 // 00019 // This library is free software; you can redistribute it and/or 00020 // modify it under the terms of the GNU Lesser General Public 00021 // License as published by the Free Software Foundation; either 00022 // version 2.1 of the License, or (at your option) any later version. 00023 // 00024 // This library is distributed in the hope that it will be useful, 00025 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00026 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00027 // Lesser General Public License for more details. 00028 // 00029 // You should have received a copy of the GNU Lesser General Public 00030 // License along with this library; if not, write to the Free Software 00031 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. 00032 //******************************************************************************* 00033 // $Id: TCMTFactory.h 826 2008-02-27 17:07:33Z the_____tiger $ 00034 //******************************************************************************* 00035 00036 #ifndef _TC_MT_FACTORY_H_ 00037 #define _TC_MT_FACTORY_H_ 00038 00039 #include "TCMTCondition.h" 00040 #include "TCMTEvent.h" 00041 #include "TCMTMutex.h" 00042 #include "TCMTSemaphore.h" 00043 #include "TCMTThread.h" 00044 #include "TCMTMessageDispatcher.h" 00045 00046 namespace TC 00047 { 00048 namespace MT 00049 { 00064 namespace Factory 00065 { 00074 TCMT_API ThreadPtr CreateThread(const std::string& thread_name, 00075 uint32 stack_size=0, 00076 Thread::ThreadPriority priority=Thread::PRIORITY_NORMAL); 00077 00082 TCMT_API MessageDispatcherPtr CreateMessageDispatcher(); 00083 00087 TCMT_API ThreadPtr GetCurrentThread(); 00088 00096 TCMT_API MutexPtr CreateMutex(bool locked=false); 00105 TCMT_API MutexPtr CreateMutex(const std::string& shared_name, bool locked=false); 00106 00112 TCMT_API EventPtr CreateEvent(bool manual_reset=false, bool initial_state=false); 00113 00118 TCMT_API SemaphorePtr CreateSemaphore(uint32 initial_value); 00124 TCMT_API SemaphorePtr CreateSemaphore(const std::string& shared_name, uint32 initial_value); 00125 00133 TCMT_API ConditionPtr CreateCondition(); 00134 00138 TCMT_API ConditionPtr CreateCondition(MutexPtr mutex); 00139 }; 00140 00145 } // namespace MT 00146 } // namespace TC 00147 00148 00149 #endif //_TC_MT_FACTORY_H_