Panda3D

genericAsyncTask.I

00001 // Filename: genericAsyncTask.I
00002 // Created by:  drose (03Oct08)
00003 //
00004 ////////////////////////////////////////////////////////////////////
00005 //
00006 // PANDA 3D SOFTWARE
00007 // Copyright (c) Carnegie Mellon University.  All rights reserved.
00008 //
00009 // All use of this software is subject to the terms of the revised BSD
00010 // license.  You should have received a copy of this license along
00011 // with this source code in a file named "LICENSE."
00012 //
00013 ////////////////////////////////////////////////////////////////////
00014 
00015 
00016 ////////////////////////////////////////////////////////////////////
00017 //     Function: GenericAsyncTask::set_function
00018 //       Access: Published
00019 //  Description: Replaces the function that is called when the task
00020 //               runs.
00021 ////////////////////////////////////////////////////////////////////
00022 INLINE void GenericAsyncTask::
00023 set_function(GenericAsyncTask::TaskFunc *function) {
00024   _function = function;
00025 }
00026 
00027 ////////////////////////////////////////////////////////////////////
00028 //     Function: GenericAsyncTask::get_function
00029 //       Access: Published
00030 //  Description: Returns the function that is called when the task
00031 //               runs.
00032 ////////////////////////////////////////////////////////////////////
00033 INLINE GenericAsyncTask::TaskFunc *GenericAsyncTask::
00034 get_function() const {
00035   return _function;
00036 }
00037 
00038 ////////////////////////////////////////////////////////////////////
00039 //     Function: GenericAsyncTask::set_upon_birth
00040 //       Access: Published
00041 //  Description: Replaces the function that is called when the task
00042 //               begins.  This is an optional function.
00043 ////////////////////////////////////////////////////////////////////
00044 INLINE void GenericAsyncTask::
00045 set_upon_birth(GenericAsyncTask::BirthFunc *upon_birth) {
00046   _upon_birth = upon_birth;
00047 }
00048 
00049 ////////////////////////////////////////////////////////////////////
00050 //     Function: GenericAsyncTask::get_upon_birth
00051 //       Access: Published
00052 //  Description: Returns the function that is called when the task
00053 //               begins, or NULL if the function is not defined.
00054 ////////////////////////////////////////////////////////////////////
00055 INLINE GenericAsyncTask::BirthFunc *GenericAsyncTask::
00056 get_upon_birth() const {
00057   return _upon_birth;
00058 }
00059 
00060 ////////////////////////////////////////////////////////////////////
00061 //     Function: GenericAsyncTask::set_upon_death
00062 //       Access: Published
00063 //  Description: Replaces the function that is called when the task
00064 //               ends.  This is an optional function.
00065 ////////////////////////////////////////////////////////////////////
00066 INLINE void GenericAsyncTask::
00067 set_upon_death(GenericAsyncTask::DeathFunc *upon_death) {
00068   _upon_death = upon_death;
00069 }
00070 
00071 ////////////////////////////////////////////////////////////////////
00072 //     Function: GenericAsyncTask::get_upon_death
00073 //       Access: Published
00074 //  Description: Returns the function that is called when the task
00075 //               ends, or NULL if the function is not defined.
00076 ////////////////////////////////////////////////////////////////////
00077 INLINE GenericAsyncTask::DeathFunc *GenericAsyncTask::
00078 get_upon_death() const {
00079   return _upon_death;
00080 }
00081 
00082 ////////////////////////////////////////////////////////////////////
00083 //     Function: GenericAsyncTask::set_user_data
00084 //       Access: Published
00085 //  Description: Replaces the void pointer that is passed to the task
00086 //               function.  This is any arbitrary pointer; the task
00087 //               object does no processing on it.
00088 ////////////////////////////////////////////////////////////////////
00089 INLINE void GenericAsyncTask::
00090 set_user_data(void *user_data) {
00091   _user_data = user_data;
00092 }
00093 
00094 ////////////////////////////////////////////////////////////////////
00095 //     Function: GenericAsyncTask::get_user_data
00096 //       Access: Published
00097 //  Description: Returns the void pointer that is passed to the task
00098 //               function.
00099 ////////////////////////////////////////////////////////////////////
00100 INLINE void *GenericAsyncTask::
00101 get_user_data() const {
00102   return _user_data;
00103 }
 All Classes Functions Variables Enumerations