15 #ifndef ASYNCTASKMANAGER_H 16 #define ASYNCTASKMANAGER_H 18 #include "pandabase.h" 20 #include "asyncTask.h" 21 #include "asyncTaskCollection.h" 22 #include "asyncTaskChain.h" 23 #include "typedReferenceCount.h" 26 #include "mutexHolder.h" 27 #include "conditionVarFull.h" 30 #include "pStatCollector.h" 31 #include "clockObject.h" 32 #include "ordered_vector.h" 33 #include "indirectCompareNames.h" 59 BLOCKING
void cleanup();
64 int get_num_task_chains()
const;
66 MAKE_SEQ(get_task_chains, get_num_task_chains, get_task_chain);
69 BLOCKING
bool remove_task_chain(
const string &name);
74 AsyncTask *find_task(
const string &name)
const;
81 BLOCKING
void wait_for_tasks();
82 BLOCKING
void stop_threads();
85 INLINE
int get_num_tasks()
const;
92 double get_next_wake_time()
const;
94 virtual void output(ostream &out)
const;
95 virtual void write(ostream &out,
int indent_level = 0)
const;
103 INLINE
void add_task_by_name(
AsyncTask *task);
104 void remove_task_by_name(
AsyncTask *task);
108 virtual void do_output(ostream &out)
const;
111 static void make_global_ptr();
114 class AsyncTaskSortName {
117 return a->get_name() < b->get_name();
128 TaskChains _task_chains;
131 TasksByName _tasks_by_name;
142 static void init_type() {
143 TypedReferenceCount::init_type();
144 register_type(_type_handle,
"AsyncTaskManager",
145 TypedReferenceCount::get_class_type());
148 return get_class_type();
150 virtual TypeHandle force_init_type() {init_type();
return get_class_type();}
156 friend class AsyncTaskChain::AsyncTaskChainThread;
161 INLINE ostream &operator << (ostream &out,
const AsyncTaskManager &manager) {
166 #include "asyncTaskManager.I" void output(ostream &out) const
Outputs the Namable.
A class to manage a loose queue of isolated tasks, which can be performed either synchronously (in th...
A list of tasks, for instance as returned by some of the AsyncTaskManager query functions.
A base class for things which need to inherit from both TypedObject and from ReferenceCount.
A standard mutex, or mutual exclusion lock.
A specialization of ordered_vector that emulates a standard STL set: one copy of each element is allo...
A base class for all things which can have a name.
A ClockObject keeps track of elapsed real time and discrete time.
A special kind of task that serves as a list of tasks internally.
The AsyncTaskChain is a subset of the AsyncTaskManager.
This class represents a concrete task performed by an AsyncManager.
This class implements a condition variable; see ConditionVar for a brief introduction to this class...
TypeHandle is the identifier used to differentiate C++ class types.
This class can be used to test for string matches against standard Unix-shell filename globbing conve...