00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef ASYNCTASKCOLLECTION_H
00016 #define ASYNCTASKCOLLECTION_H
00017
00018 #include "pandabase.h"
00019 #include "pointerToArray.h"
00020 #include "asyncTask.h"
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030 class EXPCL_PANDA_PGRAPH AsyncTaskCollection {
00031 PUBLISHED:
00032 AsyncTaskCollection();
00033 AsyncTaskCollection(const AsyncTaskCollection ©);
00034 void operator = (const AsyncTaskCollection ©);
00035 INLINE ~AsyncTaskCollection();
00036
00037 void add_task(AsyncTask *task);
00038 bool remove_task(AsyncTask *task);
00039 void add_tasks_from(const AsyncTaskCollection &other);
00040 void remove_tasks_from(const AsyncTaskCollection &other);
00041 void remove_duplicate_tasks();
00042 bool has_task(AsyncTask *task) const;
00043 void clear();
00044
00045 AsyncTask *find_task(const string &name) const;
00046
00047 int get_num_tasks() const;
00048 AsyncTask *get_task(int index) const;
00049 MAKE_SEQ(get_tasks, get_num_tasks, get_task);
00050 void remove_task(int index);
00051 AsyncTask *operator [] (int index) const;
00052 int size() const;
00053 INLINE void operator += (const AsyncTaskCollection &other);
00054 INLINE AsyncTaskCollection operator + (const AsyncTaskCollection &other) const;
00055
00056 void output(ostream &out) const;
00057 void write(ostream &out, int indent_level = 0) const;
00058
00059 private:
00060 typedef PTA(PT(AsyncTask)) AsyncTasks;
00061 AsyncTasks _tasks;
00062 };
00063
00064 INLINE ostream &operator << (ostream &out, const AsyncTaskCollection &col) {
00065 col.output(out);
00066 return out;
00067 }
00068
00069 #include "asyncTaskCollection.I"
00070
00071 #endif
00072
00073