14 #ifndef GENERICASYNCTASK_H
15 #define GENERICASYNCTASK_H
30 typedef void DeathFunc(
GenericAsyncTask *task,
bool clean_exit,
void *user_data);
33 GenericAsyncTask(
const std::string &name, TaskFunc *
function,
void *user_data);
36 INLINE
void set_function(TaskFunc *
function);
37 INLINE TaskFunc *get_function()
const;
39 INLINE
void set_upon_birth(BirthFunc *
function);
40 INLINE BirthFunc *get_upon_birth()
const;
42 INLINE
void set_upon_death(DeathFunc *
function);
43 INLINE DeathFunc *get_upon_death()
const;
45 INLINE
void set_user_data(
void *user_data);
46 INLINE
void *get_user_data()
const;
49 virtual bool is_runnable();
50 virtual DoneStatus do_task();
56 BirthFunc *_upon_birth;
57 DeathFunc *_upon_death;
64 static void init_type() {
65 AsyncTask::init_type();
67 AsyncTask::get_class_type());
70 return get_class_type();
72 virtual TypeHandle force_init_type() {init_type();
return get_class_type();}