AsyncTaskCollection

class AsyncTaskCollection

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.

Inheritance diagram

Inheritance diagram of AsyncTaskCollection

AsyncTaskCollection(void)
AsyncTaskCollection(AsyncTaskCollection const &copy)
void add_task(AsyncTask *task)

Adds a new AsyncTask to the collection.

void add_tasks_from(AsyncTaskCollection const &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.

void clear(void)

Removes all AsyncTasks from the collection.

AsyncTask *find_task(std::string const &name) const

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

std::size_t get_num_tasks(void) const

Returns the number of AsyncTasks in the collection.

AsyncTask *get_task(std::size_t index) const

Returns the nth AsyncTask in the collection.

bool has_task(AsyncTask *task) const

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

void output(std::ostream &out) const

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

void remove_duplicate_tasks(void)

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.

bool remove_task(AsyncTask *task)
void remove_task(std::size_t index)

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

Removes the nth AsyncTask from the collection.

void remove_tasks_from(AsyncTaskCollection const &other)

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

std::size_t size(void) const

Returns the number of tasks in the collection. This is the same thing as get_num_tasks().

void write(std::ostream &out, int indent_level = 0) const

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