libmoldeo (Moldeo 1.0 Core)  1.0
libmoldeo is the group of objects and functions that executes the basic operations of Moldeo 1.0 Platform.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
moThread.h
Go to the documentation of this file.
1 /*******************************************************************************
2 
3  moThread.h
4 
5  ****************************************************************************
6  * *
7  * This source is free software; you can redistribute it and/or modify *
8  * it under the terms of the GNU General Public License as published by *
9  * the Free Software Foundation; either version 2 of the License, or *
10  * (at your option) any later version. *
11  * *
12  * This code is distributed in the hope that it will be useful, but *
13  * WITHOUT ANY WARRANTY; without even the implied warranty of *
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
15  * General Public License for more details. *
16  * *
17  * A copy of the GNU General Public License is available on the World *
18  * Wide Web at <http://www.gnu.org/copyleft/gpl.html>. You can also *
19  * obtain it by writing to the Free Software Foundation, *
20  * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
21  * *
22  ****************************************************************************
23 
24  Copyright(C) 2006 Fabricio Costa
25 
26  Authors:
27  Fabricio Costa
28 
29 
30  Class:
31  moThread
32 
33  Description:
34  Thread Class implementation, virtual
35 
36 
37 *******************************************************************************/
38 
39 #include "moTypes.h"
40 
41 
42 #include "moLock.h"
43 
44 #ifndef __MO_THREAD_H
45 #define __MO_THREAD_H
46 
48 
52 typedef void* moBoostThread;
53 
55 
56  public:
57  moThread();
58  virtual ~moThread();
59 
60  bool CreateThread();
61 
62  bool KillThread();
63  bool ThreadExists();
64 
65  bool SendThreadMessage( int message );
66 
67  private:
68 
69  moBoostThread m_handleThread;
70  moLock m_DataLock;
71 
72  virtual int ThreadUserFunction() = 0;
73 
74 #ifndef WIN32
75  static void* InitialThreadFunction( void *data );
76 #else
77  static DWORD WINAPI InitialThreadFunction( LPVOID data );
78 #endif
79 
80 
81 
82 
83  bool ProcessMessage();
84 
85 };
86 
87 #endif
88 
Definition: moLock.h:50
#define LIBMOLDEO_API
Definition: moTypes.h:180
void * moBoostThread
implementación de threads, primera versión basda en SDL_Thread
Definition: moThread.h:52
const char * message