14 #ifndef ASYNCTASKMANAGER_H
15 #define ASYNCTASKMANAGER_H
53 BLOCKING
void cleanup();
57 MAKE_PROPERTY(clock, get_clock, set_clock);
59 int get_num_task_chains()
const;
61 MAKE_SEQ(get_task_chains, get_num_task_chains, get_task_chain);
64 BLOCKING
bool remove_task_chain(
const std::string &name);
69 AsyncTask *find_task(
const std::string &name)
const;
76 BLOCKING
void wait_for_tasks();
77 BLOCKING
void stop_threads();
80 INLINE
size_t get_num_tasks()
const;
85 MAKE_PROPERTY(tasks, get_tasks);
86 MAKE_PROPERTY(active_tasks, get_active_tasks);
87 MAKE_PROPERTY(sleeping_tasks, get_sleeping_tasks);
90 double get_next_wake_time()
const;
91 MAKE_PROPERTY(next_wake_time, get_next_wake_time);
93 virtual void output(std::ostream &out)
const;
94 virtual void write(std::ostream &out,
int indent_level = 0)
const;
102 INLINE
void add_task_by_name(
AsyncTask *task);
103 void remove_task_by_name(
AsyncTask *task);
107 virtual void do_output(std::ostream &out)
const;
110 static void make_global_ptr();
113 class AsyncTaskSortName {
116 return a->get_name() < b->get_name();
127 TaskChains _task_chains;
130 TasksByName _tasks_by_name;
141 static void init_type() {
142 TypedReferenceCount::init_type();
144 TypedReferenceCount::get_class_type());
147 return get_class_type();
149 virtual TypeHandle force_init_type() {init_type();
return get_class_type();}
156 friend class AsyncTaskChain::AsyncTaskChainThread;
159 friend class PythonTask;
162 INLINE std::ostream &operator << (std::ostream &out,
const AsyncTaskManager &manager) {
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
This class represents a thread-safe handle to a promised future result of an asynchronous operation,...
The AsyncTaskChain is a subset of the AsyncTaskManager.
A list of tasks, for instance as returned by some of the AsyncTaskManager query functions.
A class to manage a loose queue of isolated tasks, which can be performed either synchronously (in th...
A special kind of task that serves as a list of tasks internally.
This class represents a concrete task performed by an AsyncManager.
A ClockObject keeps track of elapsed real time and discrete time.
This class implements a condition variable; see ConditionVar for a brief introduction to this class.
This class can be used to test for string matches against standard Unix- shell filename globbing conv...
An STL function object class, this is intended to be used on any ordered collection of pointers to cl...
A standard mutex, or mutual exclusion lock.
A base class for all things which can have a name.
void output(std::ostream &out) const
Outputs the Namable.
TypeHandle is the identifier used to differentiate C++ class types.
A base class for things which need to inherit from both TypedObject and from ReferenceCount.
A specialization of ordered_vector that emulates a standard STL set: one copy of each element is allo...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
void register_type(TypeHandle &type_handle, const std::string &name)
This inline function is just a convenient way to call TypeRegistry::register_type(),...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.