Panda3D
genericAsyncTask.I
Go to the documentation of this file.
1 /**
2  * PANDA 3D SOFTWARE
3  * Copyright (c) Carnegie Mellon University. All rights reserved.
4  *
5  * All use of this software is subject to the terms of the revised BSD
6  * license. You should have received a copy of this license along
7  * with this source code in a file named "LICENSE."
8  *
9  * @file genericAsyncTask.I
10  * @author drose
11  * @date 2008-10-03
12  */
13 
14 /**
15  * Replaces the function that is called when the task runs.
16  */
17 INLINE void GenericAsyncTask::
18 set_function(GenericAsyncTask::TaskFunc *function) {
19  _function = function;
20 }
21 
22 /**
23  * Returns the function that is called when the task runs.
24  */
25 INLINE GenericAsyncTask::TaskFunc *GenericAsyncTask::
26 get_function() const {
27  return _function;
28 }
29 
30 /**
31  * Replaces the function that is called when the task begins. This is an
32  * optional function.
33  */
34 INLINE void GenericAsyncTask::
35 set_upon_birth(GenericAsyncTask::BirthFunc *upon_birth) {
36  _upon_birth = upon_birth;
37 }
38 
39 /**
40  * Returns the function that is called when the task begins, or NULL if the
41  * function is not defined.
42  */
43 INLINE GenericAsyncTask::BirthFunc *GenericAsyncTask::
44 get_upon_birth() const {
45  return _upon_birth;
46 }
47 
48 /**
49  * Replaces the function that is called when the task ends. This is an
50  * optional function.
51  */
52 INLINE void GenericAsyncTask::
53 set_upon_death(GenericAsyncTask::DeathFunc *upon_death) {
54  _upon_death = upon_death;
55 }
56 
57 /**
58  * Returns the function that is called when the task ends, or NULL if the
59  * function is not defined.
60  */
61 INLINE GenericAsyncTask::DeathFunc *GenericAsyncTask::
62 get_upon_death() const {
63  return _upon_death;
64 }
65 
66 /**
67  * Replaces the void pointer that is passed to the task function. This is any
68  * arbitrary pointer; the task object does no processing on it.
69  */
70 INLINE void GenericAsyncTask::
71 set_user_data(void *user_data) {
72  _user_data = user_data;
73 }
74 
75 /**
76  * Returns the void pointer that is passed to the task function.
77  */
78 INLINE void *GenericAsyncTask::
79 get_user_data() const {
80  return _user_data;
81 }
BirthFunc * get_upon_birth() const
Returns the function that is called when the task begins, or NULL if the function is not defined.
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.
TaskFunc * get_function() const
Returns the function that is called when the task runs.
DeathFunc * get_upon_death() const
Returns the function that is called when the task ends, or NULL if the function is not defined.
void * get_user_data() const
Returns the void pointer that is passed to the task function.