46 case S_servicing_removed:
138 nassertr(_state != S_inactive, 0.0);
153 nassertr(_state != S_inactive, 0);
224 nassertv(_state == S_inactive);
225 _done_event = done_event;
246 INLINE
void AsyncTask::
247 set_python_object(PyObject *python_object) {
248 Py_XINCREF(python_object);
249 Py_XDECREF(_python_object);
250 _python_object = python_object;
252 #endif // HAVE_PYTHON
262 INLINE PyObject *AsyncTask::
263 get_python_object()
const {
264 if (_python_object != (PyObject *)NULL) {
265 Py_XINCREF(_python_object);
266 return _python_object;
271 #endif // HAVE_PYTHON
303 if (_num_frames == 0) {
306 return _total_dt / _num_frames;
const string & get_task_chain() const
Returns the AsyncTaskChain on which this task will be running.
double get_dt() const
Returns the amount of time elapsed during the task's previous run cycle, in seconds.
State get_state() const
Returns the current state of the task.
int get_priority() const
Returns the task's current priority value.
double get_start_time() const
Returns the time at which the task was started, according to the task manager's clock.
bool has_delay() const
Returns true if a delay has been set for this task via set_delay(), or false otherwise.
A class to manage a loose queue of isolated tasks, which can be performed either synchronously (in th...
AsyncTaskManager * get_manager() const
Returns the AsyncTaskManager that this task is active on.
int get_start_frame() const
Returns the frame number at which the task was started, according to the task manager's clock...
int get_sort() const
Returns the task's current sort value.
void clear_name()
Resets the task's name to empty.
double get_delay() const
Returns the delay value that has been set via set_delay, if any.
bool is_alive() const
Returns true if the task is currently active or sleeping on some task chain, meaning that it will be ...
const string & get_done_event() const
Returns the event name that will be triggered when the task finishes.
double get_average_dt() const
Returns the average amount of time elapsed during each of the task's previous run cycles...
void clear_delay()
Removes any delay specified for the task.
void set_delay(double delay)
Specifies the amount of time, in seconds, by which this task will be delayed after it has been added ...
double get_max_dt() const
Returns the maximum amount of time elapsed during any one of the task's previous run cycles...
AtomicAdjust::Integer get_task_id() const
Returns a number guaranteed to be unique for each different AsyncTask object in the universe...
void set_done_event(const string &done_event)
Sets the event name that will be triggered when the task finishes.