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
103 #ifdef DtObjectDebugger_Enable
185 template <
typename FS>
188 std::auto_ptr<FS> set(fs);
202 template <
typename FS>
205 if (!fs.get() || fs->elided())
211 template <
typename FS>
214 if (!fs || fs->elided())
220 template <
typename FS>
223 boost::shared_ptr<FS> ptr(fs.lock());
224 if (!ptr || ptr->elided())
237 virtual std::string label()
const = 0;
246 virtual void forEachFeatureParallel(
const ForEachFunction& func)
const = 0;
249 void forEachFeature(
const ForEachFunction& func)
const;
254 bool forEachFeatureParallelBlock(
const ForEachFunction& func,
double timeout = 60)
const;
255 bool forEachFeatureBlock(
const ForEachFunction& func,
double timeout = 60)
const;
282 virtual DetachCallback forEachFeatureAsync(
const ForEachFunction& func)
const = 0;
298 const boost::optional<DtFeatureGeometry>& geometry,
305 const boost::optional<DtFeatureGeometry>& geometry,
DtLoadType load)
const;
317 const boost::optional<DtFeatureGeometry>& geometry)
const;
319 bool load(
const DtQuery& query)
const;
320 bool load(
const boost::optional<DtFeatureGeometry>& geometry)
const;
348 virtual bool loaded(
double timeout=0.0)
const = 0;
359 virtual DetachCallback addLoadedCallback(
const LoadedCallback&)
const = 0;
370 virtual bool elided()
const = 0;
379 virtual bool empty()
const = 0;
383 virtual bool isIndexed()
const;
388 virtual bool isCacheable(
const boost::optional<DtFeatureGeometry>& area = boost::none_t())
const;
393 virtual void cacheEstimate(
394 double& time,
double&
size,
395 const boost::optional<DtFeatureGeometry>& area = boost::none_t())
const;
399 virtual void cacheData(
400 const boost::optional<DtFeatureGeometry>& area = boost::none_t(),
418 virtual unsigned numberOfFeatures()
const;
450 class SynchronizedFunction;
451 struct FeatureCounter;
455 template <
typename F>
464 template <
typename FS>
470 template <
typename FS>
484 #define DT_INSTANTIATE_FEATURE_SETS(F) \
485 template class MAKVRinTerra::DtFeatureSetTemplate<F>; \
486 template class MAKVRinTerra::DtFeatureSetList< MAKVRinTerra::DtFeatureSetTemplate<F> >; \
487 template class MAKVRinTerra::DtFeatureSetArray<4, MAKVRinTerra::DtFeatureSetTemplate<F> >; \
488 template class MAKVRinTerra::DtFilteredFeatureSet< MAKVRinTerra::DtFeatureSetTemplate<F> >; \
489 template class MAKVRinTerra::DtEmptyFeatureSet< MAKVRinTerra::DtFeatureSetTemplate<F> >; \
490 template class MAKVRinTerra::DtSinkFeatureSet< MAKVRinTerra::DtFeatureSetTemplate<F> >; \
491 template class MAKVRinTerra::DtSourceFeatureSet< MAKVRinTerra::DtFeatureSetTemplate<F> >; \
492 template class MAKVRinTerra::DtAsyncLoadingFeatureSet< MAKVRinTerra::DtFeatureSetTemplate<F> >; \
493 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. Wraps a feature set with a geometry and q...
Definition: featureSetUtils.h:48
boost::function< void(const Feature &)> ForEachFunction
Callback type type for iterating through features.
Definition: featureSet.h:153
#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:143
DtFilteredFeatureSet< FeatureSet > Filtered
Typedefs for various features system framework classes.
Definition: featureSet.h:167
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:186
boost::function< void()> DetachCallback
Callback type for disconnecting other callbacks. Functions which register callbacks return a DetachCa...
Definition: featureSet.h:125
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
Typedefs for various features system framework classes.
Definition: featureSet.h:170
Default on in debug, off in release.
Definition: objectCounter.h:31
F Feature
Type of feature objects accessed through this interface.
Definition: featureSet.h:109
static DtFeatureSetTemplate * Wrap(std::auto_ptr< FeatureSet > fs)
Wrap a compatible feature set type in the interface of this feature set type. The Wrap functions are ...
Definition: featureSet.h:197
Definition: featureSet.h:60
DtEmptyFeatureSet< FeatureSet > Empty
Typedefs for various features system framework classes.
Definition: featureSet.h:168
DtFeatureSetTemplate FeatureSet
Feature set type.
Definition: featureSet.h:112
DtFeatureSetWrapper< FeatureSet, boost::shared_ptr > SharedWrapper
Wraps a boost::shared_ptr to a feature set.
Definition: featureSet.h:162
static FeatureSet * Wrap(const boost::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:221
DtFeatureSetList< FeatureSet > List
Typedefs for various features system framework classes.
Definition: featureSet.h:166
Load all features but try to do as little work in the calling thread as possible. Not all feature set...
Definition: featureSet.h:43
DtFeatureSetTemplate< F > * new_clone(const DtFeatureSetTemplate< F > &from)
Makes DtFeatureSetTemplate usable with boost pointer containers.
Definition: featureSet.h:456
Feature set object which will take another feature set, iterate over its contents asynchronously and ...
Definition: featureSetUtils.h:144
DetachScopeGuard(const DetachCallback &cb=DetachCallback())
Definition: featureSet.h:133
Represents a set of characeters a DtFeature object can have. DtQuery objects are the way to communica...
Definition: query.h:38
#define DT_DEFINE_OBJECT_DEBUGGER_NAME_TEMPLATE(type)
Definition: objectCounter.h:275
Definition: featureSet.h:432
Dummy feature set which contains no features.
Definition: featureSetUtils.h:103
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:465
DtLoadType
Used to indicate whether to load features. See DtFeatureSetTemplate::filter.
Definition: featureSet.h:36
DtFeatureSetTemplate< DtFeature > DtFeatureSet
Definition: featureSet.h:480
DetachCallback callback
Definition: featureSet.h:130
Source feature sets are used to create your own feature sets with your own features.
Definition: featureSetUtils.h:286
~DetachScopeGuard()
Definition: featureSet.h:135
Definition: featureSet.h:62
DtFeatureSetWrapper< FeatureSet, boost::scoped_ptr > ScopedWrapper
Wraps a boost::scoped_ptr to a feature set.
Definition: featureSet.h:159
Scope guard which will automatically call detach callback in destructor.
Definition: featureSet.h:128
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:156
static FeatureSet * Wrap(std::auto_ptr< FS > fs)
Wrap a compatible feature set type in the interface of this feature set type. The Wrap functions are ...
Definition: featureSet.h:203
static FeatureSet * Wrap(const boost::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:212
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:192
DtSinkFeatureSet< FeatureSet > Sink
Typedefs for various features system framework classes.
Definition: featureSet.h:169
Visitors allow feature sets which are implemented as compound structures of other feature sets to exp...
Definition: featureSet.h:425