20 #include <boost/noncopyable.hpp>
21 #include <boost/unordered/unordered_map.hpp>
22 #include <boost/ptr_container/ptr_vector.hpp>
24 #include <tbb/mutex.h>
25 #include <tbb/tbb_thread.h>
26 #include <tbb/compat/condition_variable>
27 #include <tbb/enumerable_thread_specific.h>
28 #include <tbb/atomic.h>
29 #include <tbb/concurrent_queue.h>
89 virtual void runCallback() = 0;
92 typedef boost::unordered_map<std::string, bool>
EnabledMap;
134 virtual bool active()
const;
146 virtual bool enabled(
const std::string&,
bool def)
const;
152 virtual void printInfo(std::ostream&)
const;
171 template <
typename Container>
174 typedef typename Container::iterator iterator;
175 for (iterator i=cont.begin(), end=cont.end(); i != end; ++i)
179 template <
typename Container>
180 void addCallbacks(Container& cont,
const std::string& tag,
bool def=
true)
182 bool runNow = !
enabled(tag, def);
183 typedef typename Container::iterator iterator;
186 for (iterator i = cont.begin(), end = cont.end(); i != end; ++i)
193 for (iterator i = cont.begin(), end = cont.end(); i != end; ++i)
200 template <
typename Container>
250 unsigned maxConcurrent);
266 class ThreadLocalInfo;
268 virtual ThreadLocalInfo& threadLocalInfo();
271 static void RunJob(CallbackInterface*);
272 static void RunJob(CallbackInterface&);
274 virtual void executeDeferredJobs(AccessType access);
275 virtual void flushDeferredJobs();
282 typedef tbb::enumerable_thread_specific<
298 typedef tbb::concurrent_queue< boost::function<void()> >
JobQueue;
399 typedef std::vector<DtCriticalSection*>
Stack;