task: provide more properties on AsyncTask

This commit is contained in:
rdb 2018-10-07 23:02:50 +02:00
parent a9ff8a22f0
commit 80951b3268
2 changed files with 21 additions and 7 deletions

View File

@ -99,6 +99,27 @@ PUBLISHED:
virtual void output(std::ostream &out) const; virtual void output(std::ostream &out) const;
PUBLISHED:
MAKE_PROPERTY(state, get_state);
MAKE_PROPERTY(alive, is_alive);
MAKE_PROPERTY(manager, get_manager);
// The name of this task.
MAKE_PROPERTY(name, get_name, set_name);
// This is a number guaranteed to be unique for each different AsyncTask
// object in the universe.
MAKE_PROPERTY(id, get_task_id);
MAKE_PROPERTY(task_chain, get_task_chain, set_task_chain);
MAKE_PROPERTY(sort, get_sort, set_sort);
MAKE_PROPERTY(priority, get_priority, set_priority);
MAKE_PROPERTY(done_event, get_done_event, set_done_event);
MAKE_PROPERTY(dt, get_dt);
MAKE_PROPERTY(max_dt, get_max_dt);
MAKE_PROPERTY(average_dt, get_average_dt);
protected: protected:
void jump_to_task_chain(AsyncTaskManager *manager); void jump_to_task_chain(AsyncTaskManager *manager);
DoneStatus unlock_and_do_task(); DoneStatus unlock_and_do_task();

View File

@ -61,9 +61,6 @@ PUBLISHED:
int __clear__(); int __clear__();
PUBLISHED: PUBLISHED:
// The name of this task.
MAKE_PROPERTY(name, get_name, set_name);
// The amount of seconds that have elapsed since the task was started, // The amount of seconds that have elapsed since the task was started,
// according to the task manager's clock. // according to the task manager's clock.
MAKE_PROPERTY(time, get_elapsed_time); MAKE_PROPERTY(time, get_elapsed_time);
@ -88,10 +85,6 @@ PUBLISHED:
// according to the task manager's clock. // according to the task manager's clock.
MAKE_PROPERTY(frame, get_elapsed_frames); MAKE_PROPERTY(frame, get_elapsed_frames);
// This is a number guaranteed to be unique for each different AsyncTask
// object in the universe.
MAKE_PROPERTY(id, get_task_id);
// This is a special variable to hold the instance dictionary in which // This is a special variable to hold the instance dictionary in which
// custom variables may be stored. // custom variables may be stored.
PyObject *__dict__; PyObject *__dict__;