Panda3D
Public Member Functions | List of all members
AsyncTaskCollection Class Reference

A list of tasks, for instance as returned by some of the AsyncTaskManager query functions. More...

Inheritance diagram for AsyncTaskCollection:
AsyncTaskSequence

Public Member Functions

 __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...
 

Detailed Description

A list of tasks, for instance as returned by some of the AsyncTaskManager query functions.

This also serves to define an AsyncTaskSequence.

TODO: None of this is thread-safe yet.

Member Function Documentation

◆ __init__() [1/2]

__init__ ( )

◆ __init__() [2/2]

__init__ ( const AsyncTaskCollection  copy)

◆ addTask()

addTask ( AsyncTask  task)

Adds a new AsyncTask to the collection.

◆ addTasksFrom()

addTasksFrom ( const AsyncTaskCollection  other)

Adds all the AsyncTasks indicated in the other collection to this task.

The other tasks are simply appended to the end of the tasks in this list; duplicates are not automatically removed.

◆ clear()

clear ( )

Removes all AsyncTasks from the collection.

◆ findTask()

AsyncTask findTask ( str  name)

Returns the task in the collection with the indicated name, if any, or NULL if no task has that name.

◆ getNumTasks()

int getNumTasks ( )

Returns the number of AsyncTasks in the collection.

◆ getTask()

AsyncTask getTask ( int  index)

Returns the nth AsyncTask in the collection.

◆ getTasks()

list getTasks ( )

◆ hasTask()

bool hasTask ( AsyncTask  task)

Returns true if the indicated AsyncTask appears in this collection, false otherwise.

◆ operator []()

AsyncTask operator [] ( int  index)

Returns the nth AsyncTask in the collection.

This is the same as get_task(), but it may be a more convenient way to access it.

◆ operator+()

AsyncTaskCollection operator+ ( const AsyncTaskCollection  other)

◆ operator+=()

AsyncTaskCollection operator+= ( const AsyncTaskCollection  other)

◆ operator=()

AsyncTaskCollection operator= ( const AsyncTaskCollection  copy)

◆ output()

output ( Ostream  out)

Writes a brief one-line description of the AsyncTaskCollection to the indicated output stream.

◆ removeDuplicateTasks()

removeDuplicateTasks ( )

Removes any duplicate entries of the same AsyncTasks on this collection.

If a AsyncTask appears multiple times, the first appearance is retained; subsequent appearances are removed.

◆ removeTask() [1/2]

bool removeTask ( AsyncTask  task)

Removes the indicated AsyncTask from the collection.

Returns true if the task was removed, false if it was not a member of the collection.

◆ removeTask() [2/2]

removeTask ( int  index)

Removes the nth AsyncTask from the collection.

◆ removeTasksFrom()

removeTasksFrom ( const AsyncTaskCollection  other)

Removes from this collection all of the AsyncTasks listed in the other collection.

◆ size()

int size ( )

Returns the number of tasks in the collection.

This is the same thing as get_num_tasks().

◆ write()

write ( Ostream  out,
int  indent_level 
)

Writes a complete multi-line description of the AsyncTaskCollection to the indicated output stream.