Panda3D
 All Classes Functions Variables Enumerations
asyncTaskBase.h
1 // Filename: asyncTaskBase.h
2 // Created by: drose (09Feb10)
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 ASYNCTASKBASE_H
16 #define ASYNCTASKBASE_H
17 
18 #include "pandabase.h"
19 
20 #include "typedReferenceCount.h"
21 #include "namable.h"
22 
23 class Thread;
24 
25 ////////////////////////////////////////////////////////////////////
26 // Class : AsyncTaskBase
27 // Description : The abstract base class for AsyncTask. This is
28 // defined here only so we can store a pointer to the
29 // current task on the Thread.
30 ////////////////////////////////////////////////////////////////////
31 class EXPCL_PANDA_PIPELINE AsyncTaskBase : public TypedReferenceCount, public Namable {
32 protected:
33  AsyncTaskBase();
34 public:
35  ALLOC_DELETED_CHAIN(AsyncTaskBase);
36 
37 PUBLISHED:
38  virtual ~AsyncTaskBase();
39 
40 protected:
41  void record_task(Thread *current_thread);
42  void clear_task(Thread *current_thread);
43 
44 public:
45  static TypeHandle get_class_type() {
46  return _type_handle;
47  }
48  static void init_type() {
49  TypedReferenceCount::init_type();
50  register_type(_type_handle, "AsyncTaskBase",
51  TypedReferenceCount::get_class_type());
52  }
53  virtual TypeHandle get_type() const {
54  return get_class_type();
55  }
56  virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
57 
58 private:
59  static TypeHandle _type_handle;
60 };
61 
62 #include "asyncTaskBase.I"
63 
64 #endif
The abstract base class for AsyncTask.
Definition: asyncTaskBase.h:31
A base class for things which need to inherit from both TypedObject and from ReferenceCount.
A base class for all things which can have a name.
Definition: namable.h:29
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