18 #include <tbb/spin_mutex.h>
19 #include <tbb/mutex.h>
21 #include <boost/signals2.hpp>
23 namespace MAKVRinTerra
28 template <
typename FS>
32 ,
public std::enable_shared_from_this<DtAsyncLoadingFeatureSet<FS> >
36 typedef std::shared_ptr<DtAsyncLoadingFeatureSet>
Ptr;
39 typedef std::weak_ptr<DtAsyncLoadingFeatureSet>
WPtr;
55 virtual void start(
bool wait);
57 virtual std::string label()
const override;
62 bool loaded(
double)
const;
64 unsigned numberOfFeatures()
const;
68 virtual unsigned size()
const override;
69 virtual std::shared_ptr<DtUnusedFeatureTileTracker::Trackable> getPtr()
const override;
71 virtual void load()
override;
72 virtual bool unload()
override;
73 virtual bool loading()
const override;
74 virtual bool loaded()
const override;
81 typedef boost::signals2::signal_type<
83 boost::signals2::keywords::mutex_type<tbb::spin_mutex> >::type
LoadedSignal;
86 struct SizeCalculator;
91 virtual bool run(
bool wait);
99 virtual void inputLoadedCallback();
101 struct InputLoadedCaller;
105 const boost::optional<DtFeatureGeometry>& geom,
124 template <
typename FS>
127 #ifdef DtObjectDebugger_Enable
128 ,
public DtObjectDebugger<typename DtAsyncLoadingFeatureSet<FS>::LoadingFeatureSet>
140 const std::shared_ptr<FS>&,
147 std::string
label()
const;
154 struct WrapWithLoadingFeatureRef;
161 template <
typename FS>
166 typedef std::shared_ptr<DtQueueLoadingFeatureSet>
Ptr;
167 typedef std::shared_ptr<DtQueueLoadingFeatureSet>
WPtr;
179 virtual void start(
bool wait)
override;
183 const boost::optional<DtFeatureGeometry>& geom,
184 const std::shared_ptr<Queue>& queue,
std::unique_lock< Mutex > ScopedLock
Definition: asyncLoadingFeatureSet.h:79
#define DT_DLL_features
stop complaining about multiple independent base classes for boost::noncopyable this should probably ...
Definition: featuresDefines.h:41
FS FeatureSet
Definition: asyncLoadingFeatureSet.h:41
FeatureSet::LoadedCallback LoadedCallback
Definition: asyncLoadingFeatureSet.h:44
FeatureSet::ForEachFunction ForEachFunction
Definition: asyncLoadingFeatureSet.h:43
std::atomic_bool myRunningFlag
requested to load
Definition: asyncLoadingFeatureSet.h:112
FeatureSet::ForEachFunction ForEachFunction
Definition: asyncLoadingFeatureSet.h:171
std::shared_ptr< DtQueueLoadingFeatureSet > Ptr
Definition: asyncLoadingFeatureSet.h:166
DtAsyncLoadingFeatureSet< FS >::WPtr BaseWPtr
Definition: asyncLoadingFeatureSet.h:169
ConditionVariable myWaitCondition
Definition: asyncLoadingFeatureSet.h:109
boost::optional< DtFeatureGeometry > myGeometry
Definition: asyncLoadingFeatureSet.h:120
Definition: asyncLoadingFeatureSet.h:162
std::shared_ptr< DtAsyncLoadingFeatureSet > Ptr
Shared pointer.
Definition: asyncLoadingFeatureSet.h:36
std::shared_ptr< DtUnusedFeatureTileTracker > Ptr
Definition: unusedFeatureTileTracker.h:49
voidpf void uLong size
Definition: ioapi.h:39
Default on in debug, off in release.
Definition: objectCounter.h:27
Simple asynchronous callback queue.
Definition: vrfCallbackQueue.h:29
std::shared_ptr< Sentinel > Ptr
Definition: unusedFeatureTileTracker.h:232
DtFeatureSetWrapper< FeatureSet, std::shared_ptr > myFeatureSet
Definition: asyncLoadingFeatureSet.h:121
Definition: featureSet.h:64
std::weak_ptr< DtAsyncLoadingFeatureSet > WPtr
Weak pointer.
Definition: asyncLoadingFeatureSet.h:39
DtVrfCallbackQueue Queue
Definition: asyncLoadingFeatureSet.h:173
Loads a feature set using a user supplied threading policy. This class uses std::enable_shared_from_t...
Definition: asyncLoadingFeatureSet.h:29
std::mutex Mutex
Definition: asyncLoadingFeatureSet.h:77
Mixin interface for classes which wish to be tracked.
Definition: unusedFeatureTileTracker.h:142
Represents a set of characeters a DtFeature object can have. DtQuery objects are the way to communica...
Definition: query.h:37
FS::Feature Feature
Definition: asyncLoadingFeatureSet.h:42
std::unique_ptr< FeatureSet > myInputFeatureSet
Definition: asyncLoadingFeatureSet.h:118
bool myLoadedFlag
input feature set has finished loading
Definition: asyncLoadingFeatureSet.h:114
FeatureSet::DetachCallback DetachCallback
Definition: asyncLoadingFeatureSet.h:45
Mutex myConditionMutex
Definition: asyncLoadingFeatureSet.h:108
LoadedSignal myLoadedSignal
wrapped feature set created
Definition: asyncLoadingFeatureSet.h:116
FeatureSet * clone() const
DtFeatureSetWrapper< FS, std::shared_ptr > Base
Definition: asyncLoadingFeatureSet.h:132
std::condition_variable ConditionVariable
Definition: asyncLoadingFeatureSet.h:78
const std::weak_ptr< Queue > myQueue
Definition: asyncLoadingFeatureSet.h:188
std::atomic_bool myInputLoadedFlag
actually running
Definition: asyncLoadingFeatureSet.h:113
virtual std::string label() const override
Only used for output, won't change operation.
DetachCallback forEachFeatureAsync(const ForEachFunction &) const
boost::signals2::signal_type< void(), boost::signals2::keywords::mutex_type< tbb::spin_mutex > >::type LoadedSignal
Definition: asyncLoadingFeatureSet.h:83
DtLoadType
Used to indicate whether to load features. See DtFeatureSetTemplate::filter.
Definition: featureSet.h:33
DtQuery myQuery
Definition: asyncLoadingFeatureSet.h:119
std::shared_ptr< DtQueueLoadingFeatureSet > WPtr
Definition: asyncLoadingFeatureSet.h:167
Definition: asyncLoadingFeatureSet.h:125
DtUnusedFeatureTileTracker::Sentinel::Ptr mySentinel
Definition: asyncLoadingFeatureSet.h:158
void forEachFeatureParallel(const ForEachFunction &) const
class DT_DLL_features LoadingFeatureSet
Definition: asyncLoadingFeatureSet.h:48
std::atomic_bool myLoadingFlag
Definition: asyncLoadingFeatureSet.h:111
FeatureSet * filter(const DtQuery &, const boost::optional< DtFeatureGeometry > &, DtLoadType) const
DtAsyncLoadingFeatureSet< FS >::Ptr BasePtr
Definition: asyncLoadingFeatureSet.h:168
DtAsyncLoadingFeatureSet< FS >::FeatureSet FeatureSet
Definition: asyncLoadingFeatureSet.h:170