This class exists to allow association of a Python function or coroutine with the AsyncTaskManager.
More...
|
int | __clear__ () |
|
int | __delattr__ (object attr) |
|
object | __getattr__ (object attr) |
|
| __init__ (const PythonTask) |
|
| __init__ (object function, str name) |
|
int | __setattr__ (object attr, object v) |
|
int | __traverse__ (Visitproc visit, void arg) |
|
object | getArgs () |
|
object | getFunction () |
| Returns the function that is called when the task runs.
|
|
object | getOwner () |
| Returns the "owner" object.
|
|
object | getUponDeath () |
| Returns the function that is called when the task finishes.
|
|
| operator new (int size) |
|
| setArgs (object args, bool append_task) |
|
| setFunction (object function) |
|
| setOwner (object owner) |
|
| setResult (object result) |
| Sets the "result" of this task.
|
|
| setUponDeath (object upon_death) |
|
Public Member Functions inherited from AsyncTask |
| __init__ (const AsyncTask) |
|
| clearDelay () |
| Removes any delay specified for the task.
|
|
| clearName () |
| Resets the task's name to empty.
|
|
double | getAverageDt () |
| Returns the average amount of time elapsed during each of the task's previous run cycles, in seconds.
|
|
double | getDelay () |
| Returns the delay value that has been set via set_delay, if any.
|
|
double | getDt () |
| Returns the amount of time elapsed during the task's previous run cycle, in seconds.
|
|
int | getElapsedFrames () |
| Returns the number of frames that have elapsed since the task was started, according to the task manager's clock.
|
|
double | getElapsedTime () |
| Returns the amount of time that has elapsed since the task was started, according to the task manager's clock.
|
|
AsyncTaskManager | getManager () |
| Returns the AsyncTaskManager that this task is active on.
|
|
double | getMaxDt () |
| Returns the maximum amount of time elapsed during any one of the task's previous run cycles, in seconds.
|
|
str | getNamePrefix () |
| Returns the initial part of the name, up to but not including any trailing digits following a hyphen or underscore.
|
|
int | getPriority () |
| Returns the task's current priority value.
|
|
int | getSort () |
| Returns the task's current sort value.
|
|
int | getStartFrame () |
| Returns the frame number at which the task was started, according to the task manager's clock.
|
|
double | getStartTime () |
| Returns the time at which the task was started, according to the task manager's clock.
|
|
AsyncTask::State | getState () |
| Returns the current state of the task.
|
|
str | getTaskChain () |
| Returns the AsyncTaskChain on which this task will be running.
|
|
AtomicAdjust::Integer | getTaskId () |
| Returns a number guaranteed to be unique for each different AsyncTask object in the universe.
|
|
double | getWakeTime () |
| If this task has been added to an AsyncTaskManager with a delay in effect, this returns the time at which the task is expected to awaken.
|
|
bool | hasDelay () |
| Returns true if a delay has been set for this task via set_delay(), or false otherwise.
|
|
bool | isAlive () |
| Returns true if the task is currently active or sleeping on some task chain, meaning that it will be executed in its turn, or false if it is not active.
|
|
| output (Ostream out) |
|
| recalcWakeTime () |
| If the task is currently sleeping on a task chain, this resets its wake time to the current time + get_delay().
|
|
bool | remove () |
| Removes the task from its active manager, if any, and makes the state S_inactive (or possible S_servicing_removed).
|
|
| setDelay (double delay) |
| Specifies the amount of time, in seconds, by which this task will be delayed after it has been added to the AsyncTaskManager.
|
|
| setDoneEvent (str done_event) |
| Sets the event name that will be triggered when the task finishes.
|
|
| setName (str name) |
|
| setPriority (int priority) |
| Specifies a priority value for this task.
|
|
| setSort (int sort) |
| Specifies a sort value for this task.
|
|
| setTaskChain (str chain_name) |
| Specifies the AsyncTaskChain on which this task will be running.
|
|
Public Member Functions inherited from AsyncFuture |
| __init__ () |
| Initializes the future in the pending state.
|
|
| __init__ (const AsyncFuture) |
|
object | addDoneCallback (object fn) |
|
bool | cancel () |
| Cancels the future.
|
|
bool | cancelled () |
| Returns true if the future was cancelled.
|
|
bool | done () |
| Returns true if the future is done or has been cancelled.
|
|
str | getDoneEvent () |
| Returns the event name that will be triggered when the future finishes.
|
|
| output (Ostream out) |
|
object | result (object timeout) |
|
| setDoneEvent (str done_event) |
| Sets the event name that will be triggered when the future finishes.
|
|
| setResult (object) |
|
| wait () |
| Waits until the future is done.
|
|
| wait (double timeout) |
| Waits until the future is done, or until the timeout is reached.
|
|
Public Member Functions inherited from TypedObject |
TypeHandle | getType () |
|
int | getTypeIndex () |
| Returns the internal index number associated with this object's TypeHandle, a unique number for each different type.
|
|
bool | isExactType (TypeHandle handle) |
| Returns true if the current object is the indicated type exactly.
|
|
bool | isOfType (TypeHandle handle) |
| Returns true if the current object is or derives from the indicated type.
|
|
Public Member Functions inherited from ReferenceCount |
int | getRefCount () |
| Returns the current reference count.
|
|
| ref () |
| Explicitly increments the reference count.
|
|
bool | testRefCountIntegrity () |
| Does some easy checks to make sure that the reference count isn't completely bogus.
|
|
bool | testRefCountNonzero () |
| Does some easy checks to make sure that the reference count isn't zero, or completely bogus.
|
|
bool | unref () |
| Explicitly decrements the reference count.
|
|
Public Member Functions inherited from Namable |
| __init__ (const Namable) |
|
| __init__ (str initial_name) |
|
| clearName () |
| Resets the Namable's name to empty.
|
|
str | getName () |
|
bool | hasName () |
| Returns true if the Namable has a nonempty name set, false if the name is empty.
|
|
| output (Ostream out) |
| Outputs the Namable.
|
|
| setName (str name) |
|
|
object | __dict__ |
| This is a special variable to hold the instance dictionary in which custom variables may be stored.
|
|
double | delay_time |
| The delay value that has been set on this task, if any, or None.
|
|
double | delayTime |
| Alias of delay_time.
|
|
int | frame |
| The number of frames that have elapsed since the task was started, according to the task manager's clock.
|
|
double | time |
| The amount of seconds that have elapsed since the task was started, according to the task manager's clock.
|
|
double | wake_time |
| If this task has been added to an AsyncTaskManager with a delay in effect, this contains the time at which the task is expected to awaken. It has no meaning of the task has not yet been added to a queue, or if there was no delay in effect at the time the task was added. If the task's status is not S_sleeping, this contains 0.0.
|
|
double | wakeTime |
| Alias of wake_time.
|
|
Public Attributes inherited from AsyncTask |
bool | alive |
| Returns true if the task is currently active or sleeping on some task chain, meaning that it will be executed in its turn, or false if it is not active.
|
|
double | average_dt |
| Returns the average amount of time elapsed during each of the task's previous run cycles, in seconds.
|
|
const String | done_event |
| **
|
|
double | dt |
| Returns the amount of time elapsed during the task's previous run cycle, in seconds.
|
|
AtomicAdjust::Integer | id |
| This is a number guaranteed to be unique for each different AsyncTask object in the universe.
|
|
AsyncTaskManager | manager |
| Returns the AsyncTaskManager that this task is active on.
|
|
double | max_dt |
| Returns the maximum amount of time elapsed during any one of the task's previous run cycles, in seconds.
|
|
const String | name |
| The name of this task.
|
|
int | priority |
| Returns the task's current priority value.
|
|
int | sort |
| Returns the task's current sort value.
|
|
AsyncTask::State | state |
| Returns the current state of the task.
|
|
const String | task_chain |
| Returns the AsyncTaskChain on which this task will be running.
|
|
Public Attributes inherited from AsyncFuture |
const String | done_event |
| Returns the event name that will be triggered when the future finishes.
|
|
Public Attributes inherited from TypedObject |
TypeHandle | type |
| Returns the TypeHandle representing this object's type.
|
|
Public Attributes inherited from ReferenceCount |
int | ref_count |
| The current reference count.
|
|
Public Attributes inherited from Namable |
const String | name |
|
This class exists to allow association of a Python function or coroutine with the AsyncTaskManager.