17 #include <boost/function.hpp>
19 #include <boost/optional.hpp>
20 #include <boost/noncopyable.hpp>
25 namespace MAKVRinTerra
29 class DtFeatureGeometry;
48 virtual void layerName(
const std::string&) = 0;
49 virtual void percent(
double) = 0;
50 virtual bool isCancelled() = 0;
58 using DtUniquePtr = std::unique_ptr<T, std::default_delete<T> >;
62 template <
typename>
class PtrTemplate =
DtUniquePtr,
63 typename InnerFS =
FS>
72 template <
typename FS,
typename InnerFS = FS>
75 template <
size_t N,
typename FS,
typename InnerFS = FS>
78 template <
typename FS>
81 template <
typename FS>
84 template <
typename FS,
typename F =
typename FS::Feature>
87 template <
typename FS>
104 template <
typename F>
106 :
private boost::noncopyable
107 #ifdef DtObjectDebugger_Enable
192 template <
typename FS>
195 std::unique_ptr<FS> set(fs);
196 return Wrap(std::move(set));
209 template <
typename FS>
212 if (!fs.get() || fs->elided())
218 template <
typename FS>
221 if (!fs || fs->elided())
227 template <
typename FS>
230 std::shared_ptr<FS> ptr(fs.lock());
231 if (!ptr || ptr->elided())
244 virtual bool blockOnAsynchronousOperations()
const;
249 virtual std::string label()
const = 0;
258 virtual void forEachFeatureParallel(
const ForEachFunction& func)
const = 0;
261 void forEachFeature(
const ForEachFunction& func)
const;
266 bool forEachFeatureParallelBlock(
const ForEachFunction& func,
double timeout = 60)
const;
267 bool forEachFeatureBlock(
const ForEachFunction& func,
double timeout = 60)
const;
294 virtual DetachCallback forEachFeatureAsync(
const ForEachFunction& func)
const = 0;
310 const boost::optional<DtFeatureGeometry>& geometry,
317 const boost::optional<DtFeatureGeometry>& geometry,
DtLoadType load)
const;
329 const boost::optional<DtFeatureGeometry>& geometry)
const;
331 bool load(
const DtQuery& query)
const;
332 bool load(
const boost::optional<DtFeatureGeometry>& geometry)
const;
360 virtual bool loaded(
double timeout=0.0)
const = 0;
371 virtual DetachCallback addLoadedCallback(
const LoadedCallback&)
const = 0;
382 virtual bool elided()
const = 0;
391 virtual bool empty()
const = 0;
395 virtual bool isIndexed()
const;
400 virtual bool isCacheable(
const boost::optional<DtFeatureGeometry>& area = boost::none_t())
const;
405 virtual void cacheEstimate(
406 double& time,
double&
size,
407 const boost::optional<DtFeatureGeometry>& area = boost::none_t())
const;
411 virtual void cacheData(
412 const boost::optional<DtFeatureGeometry>& area = boost::none_t(),
430 virtual unsigned numberOfFeatures()
const;
462 class SynchronizedFunction;
463 struct FeatureCounter;
469 template <
typename F>
478 template <
typename FS>
484 template <
typename FS>
498 #define DT_INSTANTIATE_FEATURE_SETS(F) \
499 template class MAKVRinTerra::DtFeatureSetTemplate<F>; \
500 template class MAKVRinTerra::DtFeatureSetList< MAKVRinTerra::DtFeatureSetTemplate<F> >; \
501 template class MAKVRinTerra::DtFeatureSetArray<4, MAKVRinTerra::DtFeatureSetTemplate<F> >; \
502 template class MAKVRinTerra::DtFilteredFeatureSet< MAKVRinTerra::DtFeatureSetTemplate<F> >; \
503 template class MAKVRinTerra::DtEmptyFeatureSet< MAKVRinTerra::DtFeatureSetTemplate<F> >; \
504 template class MAKVRinTerra::DtSinkFeatureSet< MAKVRinTerra::DtFeatureSetTemplate<F> >; \
505 template class MAKVRinTerra::DtSourceFeatureSet< MAKVRinTerra::DtFeatureSetTemplate<F> >; \
506 template class MAKVRinTerra::DtAsyncLoadingFeatureSet< MAKVRinTerra::DtFeatureSetTemplate<F> >; \
507 template class MAKVRinTerra::DtPagingFeatureSet< MAKVRinTerra::DtFeatureSetTemplate<F> >; \
Represents a set of DtFeature objects or others which conform to the DtFeature concept.
Definition: featureSet.h:105
DtFeatureSet which filters out features from a feature set. Wraps a feature set with a geometry and q...
Definition: featureSetUtils.h:45
boost::function< void(const Feature &)> ForEachFunction
Callback type type for iterating through features.
Definition: featureSet.h:160
#define DT_DLL_features
stop complaining about multiple independent base classes for boost::noncopyable this should probably ...
Definition: featuresDefines.h:41
virtual DtFeatureSetTemplate * clone() const =0
Clone the feature set. Called assumes ownership of returned feature set. Implementation should share ...
void reset(const DetachCallback &cb=DetachCallback())
Definition: featureSet.h:150
DtFilteredFeatureSet< FeatureSet > Filtered
Typedefs for various features system framework classes.
Definition: featureSet.h:174
Definition: featureSetList.h:98
static FeatureSet * Wrap(FS *fs)
Wrap a compatible feature set type in the interface of this feature set type. The Wrap functions are ...
Definition: featureSet.h:193
boost::function< void()> DetachCallback
Callback type for disconnecting other callbacks. Functions which register callbacks return a DetachCa...
Definition: featureSet.h:132
DtFeatureSetWrapper< FeatureSet, std::shared_ptr > SharedWrapper
Wraps a std::shared_ptr to a feature set.
Definition: featureSet.h:169
DtFeatureSetWrapper< FeatureSet, DtUniquePtr > ScopedWrapper
Wraps a std::unique_ptr to a feature set.
Definition: featureSet.h:166
DtFeatureSetTemplate()
Definition: featureSet.h:113
Definition: featureSet.h:45
static FeatureSet * Wrap(const std::weak_ptr< FS > &fs)
Wrap a compatible feature set type in the interface of this feature set type. The Wrap functions are ...
Definition: featureSet.h:228
Load all features which may be in the feature set.
Definition: featureSet.h:36
voidpf void uLong size
Definition: ioapi.h:39
Do not initiate new loads, read whatever is currently loaded.
Definition: featureSet.h:42
#define DT_DEFINE_OBJECT_DEBUGGER_NAME(type)
Definition: objectCounter.h:31
DtSourceFeatureSet< FeatureSet > Source
Typedefs for various features system framework classes.
Definition: featureSet.h:177
Default on in debug, off in release.
Definition: objectCounter.h:27
Definition: featureSet.h:64
DtEmptyFeatureSet< FeatureSet > Empty
Typedefs for various features system framework classes.
Definition: featureSet.h:175
DtFeatureSetTemplate FeatureSet
Feature set type.
Definition: featureSet.h:119
DtFeatureSetList< FeatureSet > List
Typedefs for various features system framework classes.
Definition: featureSet.h:173
static FeatureSet * Wrap(std::unique_ptr< FS > fs)
Wrap a compatible feature set type in the interface of this feature set type. The Wrap functions are ...
Definition: featureSet.h:210
Load all features but try to do as little work in the calling thread as possible. Not all feature set...
Definition: featureSet.h:40
DtFeatureSetTemplate< F > * new_clone(const DtFeatureSetTemplate< F > &from)
Makes DtFeatureSetTemplate usable with boost pointer containers.
Definition: featureSet.h:470
Feature set object which will take another feature set, iterate over its contents asynchronously and ...
Definition: featureSetUtils.h:141
DetachScopeGuard(const DetachCallback &cb=DetachCallback())
Definition: featureSet.h:140
Represents a set of characeters a DtFeature object can have. DtQuery objects are the way to communica...
Definition: query.h:37
#define DT_DEFINE_OBJECT_DEBUGGER_NAME_TEMPLATE(type)
Definition: objectCounter.h:32
static FeatureSet * Wrap(const std::shared_ptr< FS > &fs)
Wrap a compatible feature set type in the interface of this feature set type. The Wrap functions are ...
Definition: featureSet.h:219
Definition: featureSet.h:444
Dummy feature set which contains no features.
Definition: featureSetUtils.h:100
static DtFeatureSetTemplate * Wrap(std::unique_ptr< FeatureSet > fs)
Wrap a compatible feature set type in the interface of this feature set type. The Wrap functions are ...
Definition: featureSet.h:204
bool myBlockOnAsynchronousOperations
Definition: featureSet.h:463
bool DtIsElided(const FS &fs)
Helper functions using null pointers to feature sets to denote empty feature sets. This helps avoid dynamically allocating lots of empty feature sets.
Definition: featureSet.h:479
DtLoadType
Used to indicate whether to load features. See DtFeatureSetTemplate::filter.
Definition: featureSet.h:33
DtFeatureSetTemplate< DtFeature > DtFeatureSet
Definition: featureSet.h:494
DetachCallback callback
Definition: featureSet.h:137
Source feature sets are used to create your own feature sets with your own features.
Definition: featureSetUtils.h:287
~DetachScopeGuard()
Definition: featureSet.h:142
Definition: featureSet.h:66
std::unique_ptr< T, std::default_delete< T > > DtUniquePtr
Defining a unique_ptr that takes a single template argument instead of two This works around a C3201 ...
Definition: featureSet.h:58
Scope guard which will automatically call detach callback in destructor.
Definition: featureSet.h:135
DtFeatureSet used to combine multiple feature sets into one. This class allows all feature set algori...
Definition: featureSetList.h:26
boost::function< void()> LoadedCallback
Callback type type for async notification of feature set loading.
Definition: featureSet.h:163
static DtFeatureSetTemplate * Wrap(DtFeatureSetTemplate *fs)
Wrap a compatible feature set type in the interface of this feature set type. The Wrap functions are ...
Definition: featureSet.h:199
DtSinkFeatureSet< FeatureSet > Sink
Typedefs for various features system framework classes.
Definition: featureSet.h:176
Visitors allow feature sets which are implemented as compound structures of other feature sets to exp...
Definition: featureSet.h:437