17 #include <boost/function.hpp>
18 #include <boost/scoped_ptr.hpp>
19 #include <boost/shared_ptr.hpp>
20 #include <boost/weak_ptr.hpp>
22 #include <boost/optional.hpp>
23 #include <boost/noncopyable.hpp>
28 namespace MAKVRinTerra
32 class DtFeatureGeometry;
51 virtual void layerName(
const std::string&) = 0;
52 virtual void percent(
double) = 0;
53 virtual bool isCancelled() = 0;
58 template <
typename>
class PtrTemplate = boost::scoped_ptr,
59 typename InnerFS = FS>
68 template <
typename FS,
typename InnerFS = FS>
71 template <
size_t N,
typename FS,
typename InnerFS = FS>
74 template <
typename FS>
77 template <
typename FS>
80 template <
typename FS,
typename F =
typename FS::Feature>
83 template <
typename FS>
100 template <
typename F>
102 :
private boost::noncopyable
183 template <
typename FS>
186 std::auto_ptr<FS> set(fs);
200 template <
typename FS>
203 if (!fs.get() || fs->elided())
209 template <
typename FS>
212 if (!fs || fs->elided())
218 template <
typename FS>
221 boost::shared_ptr<FS> ptr(fs.lock());
222 if (!ptr || ptr->elided())
235 virtual std::string label()
const = 0;
244 virtual void forEachFeatureParallel(
const ForEachFunction& func)
const = 0;
247 void forEachFeature(
const ForEachFunction& func)
const;
252 bool forEachFeatureParallelBlock(
const ForEachFunction& func,
double timeout = 60)
const;
253 bool forEachFeatureBlock(
const ForEachFunction& func,
double timeout = 60)
const;
280 virtual DetachCallback forEachFeatureAsync(
const ForEachFunction& func)
const = 0;
296 const boost::optional<DtFeatureGeometry>& geometry,
303 const boost::optional<DtFeatureGeometry>& geometry,
DtLoadType load)
const;
315 const boost::optional<DtFeatureGeometry>& geometry)
const;
317 bool load(
const DtQuery& query)
const;
318 bool load(
const boost::optional<DtFeatureGeometry>& geometry)
const;
346 virtual bool loaded(
double timeout=0.0)
const = 0;
357 virtual DetachCallback addLoadedCallback(
const LoadedCallback&)
const = 0;
368 virtual bool elided()
const = 0;
377 virtual bool empty()
const = 0;
381 virtual bool isIndexed()
const;
386 virtual bool isCacheable(
const boost::optional<DtFeatureGeometry>& area = boost::none_t())
const;
391 virtual void cacheEstimate(
392 double& time,
double&
size,
393 const boost::optional<DtFeatureGeometry>& area = boost::none_t())
const;
397 virtual void cacheData(
398 const boost::optional<DtFeatureGeometry>& area = boost::none_t(),
416 virtual unsigned numberOfFeatures()
const;
448 class SynchronizedFunction;
449 struct FeatureCounter;
453 template <
typename F>
462 template <
typename FS>
468 template <
typename FS>
482 #define DT_INSTANTIATE_FEATURE_SETS(F) \
483 template class MAKVRinTerra::DtFeatureSetTemplate<F>; \
484 template class MAKVRinTerra::DtFeatureSetList< MAKVRinTerra::DtFeatureSetTemplate<F> >; \
485 template class MAKVRinTerra::DtFeatureSetArray<4, MAKVRinTerra::DtFeatureSetTemplate<F> >; \
486 template class MAKVRinTerra::DtFilteredFeatureSet< MAKVRinTerra::DtFeatureSetTemplate<F> >; \
487 template class MAKVRinTerra::DtEmptyFeatureSet< MAKVRinTerra::DtFeatureSetTemplate<F> >; \
488 template class MAKVRinTerra::DtSinkFeatureSet< MAKVRinTerra::DtFeatureSetTemplate<F> >; \
489 template class MAKVRinTerra::DtSourceFeatureSet< MAKVRinTerra::DtFeatureSetTemplate<F> >; \
490 template class MAKVRinTerra::DtAsyncLoadingFeatureSet< MAKVRinTerra::DtFeatureSetTemplate<F> >; \
491 template class MAKVRinTerra::DtPagingFeatureSet< MAKVRinTerra::DtFeatureSetTemplate<F> >; \
Represents a set of DtFeature objects or others which conform to the DtFeature concept.
Definition: featureSet.h:101
DtFeatureSet which filters out features from a feature set.
Definition: featureSetUtils.h:48
boost::function< void(const Feature &)> ForEachFunction
Callback type type for iterating through features.
Definition: featureSet.h:151
#define DT_DLL_features
stop complaining about multiple independent base classes for boost::noncopyable this should probably ...
Definition: featuresDefines.h:36
virtual DtFeatureSetTemplate * clone() const =0
Clone the feature set.
void reset(const DetachCallback &cb=DetachCallback())
Definition: featureSet.h:141
DtFilteredFeatureSet< FeatureSet > Filtered
Definition: featureSet.h:165
Definition: featureSetList.h:91
static FeatureSet * Wrap(FS *fs)
Wrap a compatible feature set type in the interface of this feature set type.
Definition: featureSet.h:184
boost::function< void()> DetachCallback
Callback type for disconnecting other callbacks.
Definition: featureSet.h:123
Definition: featureSet.h:48
Load all features which may be in the feature set.
Definition: featureSet.h:39
voidpf void uLong size
Definition: ioapi.h:39
Do not initiate new loads, read whatever is currently loaded.
Definition: featureSet.h:45
#define DT_DEFINE_OBJECT_DEBUGGER_NAME(type)
Definition: objectCounter.h:265
DtSourceFeatureSet< FeatureSet > Source
Definition: featureSet.h:168
Default on in debug, off in release.
Definition: objectCounter.h:31
F Feature
Type of feature objects accessed through this interface.
Definition: featureSet.h:107
static DtFeatureSetTemplate * Wrap(std::auto_ptr< FeatureSet > fs)
Definition: featureSet.h:195
Definition: featureSet.h:60
DtEmptyFeatureSet< FeatureSet > Empty
Definition: featureSet.h:166
DtFeatureSetTemplate FeatureSet
Feature set type.
Definition: featureSet.h:110
DtFeatureSetWrapper< FeatureSet, boost::shared_ptr > SharedWrapper
Wraps a boost::shared_ptr to a feature set.
Definition: featureSet.h:160
static FeatureSet * Wrap(const boost::weak_ptr< FS > &fs)
Definition: featureSet.h:219
DtFeatureSetList< FeatureSet > List
Typedefs for various features system framework classes.
Definition: featureSet.h:164
Load all features but try to do as little work in the calling thread as possible. ...
Definition: featureSet.h:43
DtFeatureSetTemplate< F > * new_clone(const DtFeatureSetTemplate< F > &from)
Makes DtFeatureSetTemplate usable with boost pointer containers.
Definition: featureSet.h:454
Feature set object which will take another feature set, iterate over its contents asynchronously and ...
Definition: featureSetUtils.h:140
DetachScopeGuard(const DetachCallback &cb=DetachCallback())
Definition: featureSet.h:131
Represents a set of characeters a DtFeature object can have.
Definition: query.h:38
#define DT_DEFINE_OBJECT_DEBUGGER_NAME_TEMPLATE(type)
Definition: objectCounter.h:275
Definition: featureSet.h:430
Dummy feature set which contains no features.
Definition: featureSetUtils.h:101
bool DtIsElided(const FS &fs)
Helper functions using null pointers to feature sets to denote empty feature sets.
Definition: featureSet.h:463
DtLoadType
Used to indicate whether to load features.
Definition: featureSet.h:36
DtFeatureSetTemplate< DtFeature > DtFeatureSet
Definition: featureSet.h:478
DetachCallback callback
Definition: featureSet.h:128
Source feature sets are used to create your own feature sets with your own features.
Definition: featureSetUtils.h:280
~DetachScopeGuard()
Definition: featureSet.h:133
Definition: featureSet.h:62
DtFeatureSetWrapper< FeatureSet, boost::scoped_ptr > ScopedWrapper
Wraps a boost::scoped_ptr to a feature set.
Definition: featureSet.h:157
Scope guard which will automatically call detach callback in destructor.
Definition: featureSet.h:126
DtFeatureSet used to combine multiple feature sets into one.
Definition: featureSetList.h:21
boost::function< void()> LoadedCallback
Callback type type for async notification of feature set loading.
Definition: featureSet.h:154
static FeatureSet * Wrap(std::auto_ptr< FS > fs)
Definition: featureSet.h:201
static FeatureSet * Wrap(const boost::shared_ptr< FS > &fs)
Definition: featureSet.h:210
static DtFeatureSetTemplate * Wrap(DtFeatureSetTemplate *fs)
Definition: featureSet.h:190
DtSinkFeatureSet< FeatureSet > Sink
Definition: featureSet.h:167
Visitors allow feature sets which are implemented as compound structures of other feature sets to exp...
Definition: featureSet.h:423