Panda3D
Public Member Functions | Static Public Member Functions | List of all members
AsyncTaskSequence Class Reference

A special kind of task that serves as a list of tasks internally. More...

Inheritance diagram for AsyncTaskSequence:
AsyncTask AsyncTaskCollection AsyncFuture Namable TypedReferenceCount TypedObject ReferenceCount

Public Member Functions

 __init__ (const AsyncTaskSequence)
 
 __init__ (str name)
 
int getCurrentTaskIndex ()
 Returns the index of the task within the sequence that is currently being executed (or that will be executed at the next epoch). More...
 
int getRepeatCount ()
 Returns the repeat count of the sequence. More...
 
 operator new (int size)
 
 setRepeatCount (int repeat_count)
 Sets the repeat count of the sequence. More...
 
- Public Member Functions inherited from AsyncTask
 __init__ (const AsyncTask)
 
 clearDelay ()
 Removes any delay specified for the task. More...
 
 clearName ()
 Resets the task's name to empty. More...
 
double getAverageDt ()
 Returns the average amount of time elapsed during each of the task's previous run cycles, in seconds. More...
 
double getDelay ()
 Returns the delay value that has been set via set_delay, if any. More...
 
double getDt ()
 Returns the amount of time elapsed during the task's previous run cycle, in seconds. More...
 
int getElapsedFrames ()
 Returns the number of frames that have elapsed since the task was started, according to the task manager's clock. More...
 
double getElapsedTime ()
 Returns the amount of time that has elapsed since the task was started, according to the task manager's clock. More...
 
AsyncTaskManager getManager ()
 Returns the AsyncTaskManager that this task is active on. More...
 
double getMaxDt ()
 Returns the maximum amount of time elapsed during any one of the task's previous run cycles, in seconds. More...
 
str getNamePrefix ()
 Returns the initial part of the name, up to but not including any trailing digits following a hyphen or underscore. More...
 
int getPriority ()
 Returns the task's current priority value. More...
 
int getSort ()
 Returns the task's current sort value. More...
 
int getStartFrame ()
 Returns the frame number at which the task was started, according to the task manager's clock. More...
 
double getStartTime ()
 Returns the time at which the task was started, according to the task manager's clock. More...
 
AsyncTask::State getState ()
 Returns the current state of the task. More...
 
str getTaskChain ()
 Returns the AsyncTaskChain on which this task will be running. More...
 
AtomicAdjust::Integer getTaskId ()
 Returns a number guaranteed to be unique for each different AsyncTask object in the universe. More...
 
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. More...
 
bool hasDelay ()
 Returns true if a delay has been set for this task via set_delay(), or false otherwise. More...
 
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. More...
 
 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(). More...
 
bool remove ()
 Removes the task from its active manager, if any, and makes the state S_inactive (or possible S_servicing_removed). More...
 
 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. More...
 
 setDoneEvent (str done_event)
 Sets the event name that will be triggered when the task finishes. More...
 
 setName (str name)
 
 setPriority (int priority)
 Specifies a priority value for this task. More...
 
 setSort (int sort)
 Specifies a sort value for this task. More...
 
 setTaskChain (str chain_name)
 Specifies the AsyncTaskChain on which this task will be running. More...
 
- Public Member Functions inherited from AsyncFuture
 __init__ ()
 Initializes the future in the pending state. More...
 
 __init__ (const AsyncFuture)
 
object addDoneCallback (object fn)
 
bool cancel ()
 Cancels the future. More...
 
bool cancelled ()
 Returns true if the future was cancelled. More...
 
bool done ()
 Returns true if the future is done or has been cancelled. More...
 
str getDoneEvent ()
 Returns the event name that will be triggered when the future finishes. More...
 
 output (Ostream out)
 
object result (object timeout)
 
 setDoneEvent (str done_event)
 Sets the event name that will be triggered when the future finishes. More...
 
 setResult (const EventParameter result)
 
 setResult (TypedObject result)
 
 setResult (TypedReferenceCount result)
 
 setResult (TypedWritableReferenceCount result)
 
 setResult (nullptr_t)
 Sets this future's result. More...
 
 wait ()
 Waits until the future is done. More...
 
 wait (double timeout)
 Waits until the future is done, or until the timeout is reached. More...
 
- 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. More...
 
bool isExactType (TypeHandle handle)
 Returns true if the current object is the indicated type exactly. More...
 
bool isOfType (TypeHandle handle)
 Returns true if the current object is or derives from the indicated type. More...
 
- Public Member Functions inherited from ReferenceCount
int getRefCount ()
 Returns the current reference count. More...
 
 ref ()
 Explicitly increments the reference count. More...
 
bool testRefCountIntegrity ()
 Does some easy checks to make sure that the reference count isn't completely bogus. More...
 
bool testRefCountNonzero ()
 Does some easy checks to make sure that the reference count isn't zero, or completely bogus. More...
 
bool unref ()
 Explicitly decrements the reference count. More...
 
- Public Member Functions inherited from Namable
 __init__ (const Namable)
 
 __init__ (str initial_name)
 
 clearName ()
 Resets the Namable's name to empty. More...
 
str getName ()
 
bool hasName ()
 Returns true if the Namable has a nonempty name set, false if the name is empty. More...
 
 output (Ostream out)
 Outputs the Namable. More...
 
 setName (str name)
 
- Public Member Functions inherited from AsyncTaskCollection
 __init__ ()
 
 __init__ (const AsyncTaskCollection copy)
 
 addTask (AsyncTask task)
 Adds a new AsyncTask to the collection. More...
 
 addTasksFrom (const AsyncTaskCollection other)
 Adds all the AsyncTasks indicated in the other collection to this task. More...
 
 clear ()
 Removes all AsyncTasks from the collection. More...
 
AsyncTask findTask (str name)
 Returns the task in the collection with the indicated name, if any, or NULL if no task has that name. More...
 
int getNumTasks ()
 Returns the number of AsyncTasks in the collection. More...
 
AsyncTask getTask (int index)
 Returns the nth AsyncTask in the collection. More...
 
list getTasks ()
 
bool hasTask (AsyncTask task)
 Returns true if the indicated AsyncTask appears in this collection, false otherwise. More...
 
AsyncTask operator [] (int index)
 Returns the nth AsyncTask in the collection. More...
 
AsyncTaskCollection operator+ (const AsyncTaskCollection other)
 
AsyncTaskCollection operator+= (const AsyncTaskCollection other)
 
AsyncTaskCollection operator= (const AsyncTaskCollection copy)
 
 output (Ostream out)
 Writes a brief one-line description of the AsyncTaskCollection to the indicated output stream. More...
 
 removeDuplicateTasks ()
 Removes any duplicate entries of the same AsyncTasks on this collection. More...
 
bool removeTask (AsyncTask task)
 Removes the indicated AsyncTask from the collection. More...
 
 removeTask (int index)
 Removes the nth AsyncTask from the collection. More...
 
 removeTasksFrom (const AsyncTaskCollection other)
 Removes from this collection all of the AsyncTasks listed in the other collection. More...
 
int size ()
 Returns the number of tasks in the collection. More...
 
 write (Ostream out, int indent_level)
 Writes a complete multi-line description of the AsyncTaskCollection to the indicated output stream. More...
 

Static Public Member Functions

static TypeHandle getClassType ()
 
- Static Public Member Functions inherited from AsyncTask
static TypeHandle getClassType ()
 
- Static Public Member Functions inherited from AsyncFuture
static object __await__ ()
 
static object __iter__ ()
 
static object gather (object args)
 
static TypeHandle getClassType ()
 
- Static Public Member Functions inherited from TypedReferenceCount
static TypeHandle getClassType ()
 
- Static Public Member Functions inherited from TypedObject
static TypeHandle getClassType ()
 
- Static Public Member Functions inherited from ReferenceCount
static TypeHandle getClassType ()
 
- Static Public Member Functions inherited from Namable
static TypeHandle getClassType ()
 

Additional Inherited Members

- Public Types inherited from AsyncTask
enum  DoneStatus {
  DS_done = 0, DS_cont = 1, DS_again = 2, DS_pickup = 3,
  DS_exit = 4, DS_pause = 5, DS_interrupt = 6, DS_await = 7
}
 
enum  State {
  S_inactive = 0, S_active = 1, S_servicing = 2, S_servicing_removed = 3,
  S_sleeping = 4, S_active_nested = 5, S_awaiting = 6
}
 
- 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. More...
 
double average_dt
 Returns the average amount of time elapsed during each of the task's previous run cycles, in seconds. More...
 
const String done_event
 ** More...
 
double dt
 Returns the amount of time elapsed during the task's previous run cycle, in seconds. More...
 
AtomicAdjust::Integer id
 This is a number guaranteed to be unique for each different AsyncTask object in the universe. More...
 
AsyncTaskManager manager
 Returns the AsyncTaskManager that this task is active on. More...
 
double max_dt
 Returns the maximum amount of time elapsed during any one of the task's previous run cycles, in seconds. More...
 
const String name
 The name of this task. More...
 
int priority
 Returns the task's current priority value. More...
 
int sort
 Returns the task's current sort value. More...
 
AsyncTask::State state
 Returns the current state of the task. More...
 
const String task_chain
 Returns the AsyncTaskChain on which this task will be running. More...
 
- Public Attributes inherited from AsyncFuture
const String done_event
 Returns the event name that will be triggered when the future finishes. More...
 
- Public Attributes inherited from TypedObject
TypeHandle type
 Returns the TypeHandle representing this object's type. More...
 
- Public Attributes inherited from ReferenceCount
int ref_count
 The current reference count. More...
 
- Public Attributes inherited from Namable
const String name
 

Detailed Description

A special kind of task that serves as a list of tasks internally.

Each task on the list is executed in sequence, one per epoch.

This is similar to a Sequence interval, though it has some slightly different abilities. For instance, although you can't start at any arbitrary point in the sequence, you can construct a task sequence whose duration changes during playback.

Member Function Documentation

◆ __init__() [1/2]

__init__ ( const  AsyncTaskSequence)

◆ __init__() [2/2]

__init__ ( str  name)

◆ getClassType()

static TypeHandle getClassType ( )
static

◆ getCurrentTaskIndex()

int getCurrentTaskIndex ( )

Returns the index of the task within the sequence that is currently being executed (or that will be executed at the next epoch).

◆ getRepeatCount()

int getRepeatCount ( )

Returns the repeat count of the sequence.

See set_repeat_count().

◆ operator new()

operator new ( int  size)

◆ setRepeatCount()

setRepeatCount ( int  repeat_count)

Sets the repeat count of the sequence.

If the count is 0 or 1, the sequence will run exactly once. If it is greater than 0, it will run that number of times. If it is negative, it will run forever until it is explicitly removed.