Panda3D
Loading...
Searching...
No Matches
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 */
18set_function(GenericAsyncTask::TaskFunc *function) {
19 _function = function;
20}
21
22/**
23 * Returns the function that is called when the task runs.
24 */
25INLINE GenericAsyncTask::TaskFunc *GenericAsyncTask::
26get_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 */
35set_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 */
43INLINE GenericAsyncTask::BirthFunc *GenericAsyncTask::
44get_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 */
53set_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 */
61INLINE GenericAsyncTask::DeathFunc *GenericAsyncTask::
62get_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 */
71set_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 */
79get_user_data() const {
80 return _user_data;
81}
TaskFunc * get_function() const
Returns the function that is called when the task runs.
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.
void set_upon_birth(BirthFunc *function)
Replaces the function that is called when the task begins.
void set_user_data(void *user_data)
Replaces the void pointer that is passed to the task function.
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_upon_death(DeathFunc *function)
Replaces the function that is called when the task ends.
void set_function(TaskFunc *function)
Replaces the function that is called when the task runs.