Panda3D
 All Classes Functions Variables Enumerations
mainThread.h
1 // Filename: mainThread.h
2 // Created by: drose (15Jan06)
3 //
4 ////////////////////////////////////////////////////////////////////
5 //
6 // PANDA 3D SOFTWARE
7 // Copyright (c) Carnegie Mellon University. All rights reserved.
8 //
9 // All use of this software is subject to the terms of the revised BSD
10 // license. You should have received a copy of this license along
11 // with this source code in a file named "LICENSE."
12 //
13 ////////////////////////////////////////////////////////////////////
14 
15 #ifndef MAINTHREAD_H
16 #define MAINTHREAD_H
17 
18 #include "pandabase.h"
19 #include "thread.h"
20 
21 ////////////////////////////////////////////////////////////////////
22 // Class : MainThread
23 // Description : The special "main thread" class. There is one
24 // instance of these in the world, and it is returned by
25 // Thread::get_main_thread().
26 ////////////////////////////////////////////////////////////////////
27 class EXPCL_PANDA_PIPELINE MainThread : public Thread {
28 private:
29  MainThread();
30  virtual void thread_main();
31 
32 PUBLISHED:
33  static TypeHandle get_class_type() {
34  return _type_handle;
35  }
36 public:
37  static void init_type() {
38  Thread::init_type();
39  register_type(_type_handle, "MainThread",
40  Thread::get_class_type());
41  }
42  virtual TypeHandle get_type() const {
43  return get_class_type();
44  }
45  virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
46 
47 private:
48  static TypeHandle _type_handle;
49 
50  friend class Thread;
51 };
52 
53 #endif
The special "main thread" class.
Definition: mainThread.h:27
A thread; that is, a lightweight process.
Definition: thread.h:51
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:85