Panda3D
 All Classes Functions Variables Enumerations
genericAsyncTask.I
1 // Filename: genericAsyncTask.I
2 // Created by: drose (03Oct08)
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 
16 ////////////////////////////////////////////////////////////////////
17 // Function: GenericAsyncTask::set_function
18 // Access: Published
19 // Description: Replaces the function that is called when the task
20 // runs.
21 ////////////////////////////////////////////////////////////////////
22 INLINE void GenericAsyncTask::
23 set_function(GenericAsyncTask::TaskFunc *function) {
24  _function = function;
25 }
26 
27 ////////////////////////////////////////////////////////////////////
28 // Function: GenericAsyncTask::get_function
29 // Access: Published
30 // Description: Returns the function that is called when the task
31 // runs.
32 ////////////////////////////////////////////////////////////////////
33 INLINE GenericAsyncTask::TaskFunc *GenericAsyncTask::
34 get_function() const {
35  return _function;
36 }
37 
38 ////////////////////////////////////////////////////////////////////
39 // Function: GenericAsyncTask::set_upon_birth
40 // Access: Published
41 // Description: Replaces the function that is called when the task
42 // begins. This is an optional function.
43 ////////////////////////////////////////////////////////////////////
44 INLINE void GenericAsyncTask::
45 set_upon_birth(GenericAsyncTask::BirthFunc *upon_birth) {
46  _upon_birth = upon_birth;
47 }
48 
49 ////////////////////////////////////////////////////////////////////
50 // Function: GenericAsyncTask::get_upon_birth
51 // Access: Published
52 // Description: Returns the function that is called when the task
53 // begins, or NULL if the function is not defined.
54 ////////////////////////////////////////////////////////////////////
55 INLINE GenericAsyncTask::BirthFunc *GenericAsyncTask::
56 get_upon_birth() const {
57  return _upon_birth;
58 }
59 
60 ////////////////////////////////////////////////////////////////////
61 // Function: GenericAsyncTask::set_upon_death
62 // Access: Published
63 // Description: Replaces the function that is called when the task
64 // ends. This is an optional function.
65 ////////////////////////////////////////////////////////////////////
66 INLINE void GenericAsyncTask::
67 set_upon_death(GenericAsyncTask::DeathFunc *upon_death) {
68  _upon_death = upon_death;
69 }
70 
71 ////////////////////////////////////////////////////////////////////
72 // Function: GenericAsyncTask::get_upon_death
73 // Access: Published
74 // Description: Returns the function that is called when the task
75 // ends, or NULL if the function is not defined.
76 ////////////////////////////////////////////////////////////////////
77 INLINE GenericAsyncTask::DeathFunc *GenericAsyncTask::
78 get_upon_death() const {
79  return _upon_death;
80 }
81 
82 ////////////////////////////////////////////////////////////////////
83 // Function: GenericAsyncTask::set_user_data
84 // Access: Published
85 // Description: Replaces the void pointer that is passed to the task
86 // function. This is any arbitrary pointer; the task
87 // object does no processing on it.
88 ////////////////////////////////////////////////////////////////////
89 INLINE void GenericAsyncTask::
90 set_user_data(void *user_data) {
91  _user_data = user_data;
92 }
93 
94 ////////////////////////////////////////////////////////////////////
95 // Function: GenericAsyncTask::get_user_data
96 // Access: Published
97 // Description: Returns the void pointer that is passed to the task
98 // function.
99 ////////////////////////////////////////////////////////////////////
100 INLINE void *GenericAsyncTask::
101 get_user_data() const {
102  return _user_data;
103 }
BirthFunc * get_upon_birth() const
Returns the function that is called when the task begins, or NULL if the function is not defined...
TaskFunc * get_function() const
Returns the function that is called when the task runs.
void set_user_data(void *user_data)
Replaces the void pointer that is passed to the task function.
void set_upon_birth(BirthFunc *function)
Replaces the function that is called when the task begins.
void set_function(TaskFunc *function)
Replaces the function that is called when the task runs.
void set_upon_death(DeathFunc *function)
Replaces the function that is called when the task ends.
void * get_user_data() const
Returns the void pointer that is passed to the task function.
DeathFunc * get_upon_death() const
Returns the function that is called when the task ends, or NULL if the function is not defined...