15 #ifndef GENERICASYNCTASK_H
16 #define GENERICASYNCTASK_H
18 #include "pandabase.h"
20 #include "asyncTask.h"
32 typedef void DeathFunc(
GenericAsyncTask *task,
bool clean_exit,
void *user_data);
38 INLINE
void set_function(TaskFunc *
function);
39 INLINE TaskFunc *get_function()
const;
41 INLINE
void set_upon_birth(BirthFunc *
function);
42 INLINE BirthFunc *get_upon_birth()
const;
44 INLINE
void set_upon_death(DeathFunc *
function);
45 INLINE DeathFunc *get_upon_death()
const;
47 INLINE
void set_user_data(
void *user_data);
48 INLINE
void *get_user_data()
const;
51 virtual bool is_runnable();
52 virtual DoneStatus do_task();
58 BirthFunc *_upon_birth;
59 DeathFunc *_upon_death;
66 static void init_type() {
67 AsyncTask::init_type();
68 register_type(_type_handle,
"GenericAsyncTask",
69 AsyncTask::get_class_type());
72 return get_class_type();
74 virtual TypeHandle force_init_type() {init_type();
return get_class_type();}
80 #include "genericAsyncTask.I"
A class to manage a loose queue of isolated tasks, which can be performed either synchronously (in th...
Associates a generic C-style function pointer with an AsyncTask object.
This class represents a concrete task performed by an AsyncManager.
TypeHandle is the identifier used to differentiate C++ class types.