10 #include <tbb/spin_mutex.h>
11 #include <tbb/tbb_thread.h>
12 #include <tbb/compat/condition_variable>
15 namespace MAKVRinTerra
21 ,
public boost::enable_shared_from_this<DtAsyncLoadingFeatureSet<F> >
24 typedef boost::shared_ptr<DtAsyncLoadingFeatureSet>
Ptr;
25 typedef boost::weak_ptr<DtAsyncLoadingFeatureSet>
WPtr;
28 typedef boost::function<FeatureSet* (FeatureSet*)>
TileFactory;
29 typedef boost::function<void (const FeatureSet&)>
Callback;
33 virtual void start() = 0;
36 virtual bool loading()
const;
43 bool loaded(
double)
const;
44 unsigned numberOfFeatures()
const;
54 static void Run(
WPtr);
57 virtual void run(
const Ptr&);
80 typedef boost::shared_ptr<DtThreadLoadingFeatureSet>
Ptr;
107 template <
typename F>
112 typedef boost::shared_ptr<DtTaskLoadingFeatureSet>
Ptr;
113 typedef boost::shared_ptr<DtTaskLoadingFeatureSet>
WPtr;
133 tbb::task* execute();
150 template <
typename F>
155 typedef boost::shared_ptr<DtQueueLoadingFeatureSet>
Ptr;
156 typedef boost::shared_ptr<DtQueueLoadingFeatureSet>
WPtr;
165 class Queue :
public boost::enable_shared_from_this<Queue>
168 explicit Queue(
unsigned maxTasks);
176 void taskDestroyed();
179 typedef std::list<typename DtAsyncLoadingFeatureSet<F>::WPtr>
WPtrList;
188 boost::shared_ptr<Queue> queue,
199 explicit Task(boost::shared_ptr<Queue>);
203 tbb::task* execute();
212 boost::shared_ptr<Queue> queue,