10 #include <boost/function.hpp>
14 namespace MAKVRinTerra
40 template <
typename>
class PtrTemplate = boost::scoped_ptr,
41 typename InnerFS =
FS>
42 class DtFeatureSetWrapper;
44 template <
typename FS,
typename InnerFS = FS>
45 class DtSharedFeatureSetWrapper;
47 template <
typename FS>
50 template <
typename FS>
53 template <
typename FS>
56 template <
typename FS>
94 template <
typename FS>
98 return new Wrapper(fs);
110 virtual std::string label()
const = 0;
115 virtual void forEachFeature(ForEachFunction func,
DtWaitType wait)
const = 0;
119 virtual void forEachFeatureParallel(ForEachFunction func,
DtWaitType wait)
const;
145 virtual bool loaded(
double timeout=0.0)
const = 0;
154 virtual bool empty()
const;
157 virtual bool isIndexed()
const;
165 virtual unsigned numberOfFeatures()
const;
196 template <
typename F>
203 template <
typename FS>
215 void setLabel(std::string);
221 void add(std::auto_ptr<FS>);
223 std::string label()
const;
228 bool loaded(
double = 0.0)
const;
229 unsigned numberOfFeatures()
const;
231 bool isIndexed()
const;
247 template <
typename FS>
262 const FS& filteredFeatureSet()
const;
265 std::string label()
const;
270 bool loaded(
double = 0.0)
const;
271 unsigned numberOfFeatures()
const;
273 bool isIndexed()
const;
285 template <
typename FS>
292 std::string label()
const;
296 bool loaded(
double = 0.0)
const;
297 unsigned numberOfFeatures()
const;
301 template <
typename FS>
316 std::string label()
const;
320 bool loaded(
double = 0.0)
const;
321 unsigned numberOfFeatures()
const;
322 bool empty()
const {
return myFeatures->empty(); }
324 void addFeature(
const Feature& feature);
328 struct ParallelCaller;
337 template <
typename FS,
template <
typename>
class PtrTemplate,
typename InnerFS>
362 void set(InnerFS* fs)
367 template <
typename PtrType>
375 return mySet->label();
380 mySet->forEachFeature(func,wait);
385 mySet->forEachFeatureParallel(func,wait);
390 return FeatureSet::Wrap(
mySet->filter(query,load));
400 return mySet->loaded(timeout);
405 return mySet->numberOfFeatures();
410 return mySet->empty();
415 return mySet->isIndexed();
422 template <
typename FS,
template <
typename>
class PtrTemplate>
452 template <
typename PtrType>
460 return mySet->label();
465 mySet->forEachFeature(func,wait);
470 mySet->forEachFeatureParallel(func,wait);
475 return mySet->filter(query,load);
481 return mySet->clone();
486 return mySet->loaded(timeout);
491 return mySet->numberOfFeatures();
496 return mySet->empty();
501 return mySet->isIndexed();
508 template <
typename FS,
typename InnerFS>
528 assert(this->
mySet.get());