Panda3D
Loading...
Searching...
No Matches
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...

#include <pandadoc.hpp>

Inheritance diagram for AsyncTaskCollection:
AsyncTaskSequence

Public Member Functions

 __init__ ()
 
 __init__ (const AsyncTaskCollection copy)
 
 addTask (AsyncTask task)
 Adds a new AsyncTask to the collection.
 
 addTasksFrom (const AsyncTaskCollection other)
 Adds all the AsyncTasks indicated in the other collection to this task.
 
 clear ()
 Removes all AsyncTasks from the collection.
 
AsyncTask findTask (str name)
 Returns the task in the collection with the indicated name, if any, or NULL if no task has that name.
 
int getNumTasks ()
 Returns the number of AsyncTasks in the collection.
 
AsyncTask getTask (int index)
 Returns the nth AsyncTask in the collection.
 
list getTasks ()
 
bool hasTask (AsyncTask task)
 Returns true if the indicated AsyncTask appears in this collection, false otherwise.
 
AsyncTaskCollection operator+ (const AsyncTaskCollection other)
 
AsyncTaskCollection operator+= (const AsyncTaskCollection other)
 
AsyncTaskCollection operator= (const AsyncTaskCollection copy)
 
AsyncTask operator[] (int index)
 Returns the nth AsyncTask in the collection.
 
 output (Ostream out)
 Writes a brief one-line description of the AsyncTaskCollection to the indicated output stream.
 
 removeDuplicateTasks ()
 Removes any duplicate entries of the same AsyncTasks on this collection.
 
bool removeTask (AsyncTask task)
 Removes the indicated AsyncTask from the collection.
 
 removeTask (int index)
 Removes the nth AsyncTask from the collection.
 
 removeTasksFrom (const AsyncTaskCollection other)
 Removes from this collection all of the AsyncTasks listed in the other collection.
 
int size ()
 Returns the number of tasks in the collection.
 
 write (Ostream out, int indent_level)
 Writes a complete multi-line description of the AsyncTaskCollection to the indicated output stream.
 

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+()

AsyncTaskCollection operator+ ( const AsyncTaskCollection other)

◆ operator+=()

AsyncTaskCollection operator+= ( const AsyncTaskCollection other)

◆ operator=()

AsyncTaskCollection operator= ( const AsyncTaskCollection copy)

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

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