15 namespace MAKVRinTerra
17 template <
typename FS>
26 typedef boost::shared_ptr<DtIndexChooserFeatureSet>
Ptr;
28 static FS*
Make(FS* input, FS* mainIndex)
33 std::string
label()
const {
return myInput->label() +
" index chooser"; }
39 Mutex::scoped_lock lock(
myData->myMutex,
false);
41 tot += i->second->numberOfFeatures();
51 Mutex::scoped_lock lock(
myData->myMutex,
false);
53 if (!i->second->elided())
64 Mutex::scoped_lock lock(
myData->myMutex,
false);
66 if (!i->second->empty())
77 bool isCacheable(
const boost::optional<DtFeatureGeometry>& area)
const
82 void cacheEstimate(
double& time,
double&
size,
const boost::optional<DtFeatureGeometry>& area)
const
88 const boost::optional<DtFeatureGeometry>& area,
94 bool loaded(
double timeout=0.0)
const
96 tbb::tick_count start = tbb::tick_count::now();
101 Mutex::scoped_lock lock(
myData->myMutex,
false);
104 double whatsleft = timeout - (tbb::tick_count::now() - start).seconds();
108 if (!i->second->loaded(whatsleft))
134 : func(func), query(query)
157 const boost::optional<DtFeatureGeometry>& geometry,
164 return myMainIndex->filter(combined, geometry, load);
182 DtWarn <<
"Query = " << query << std::endl;
184 DtWarn <<
"Combined = " << combined << std::endl;
190 Mutex::scoped_lock lock(
myData->myMutex,
true);
192 if (i !=
myData->myIndexMap.end())
194 DtInfo <<
"Using feature attribute index on key " << attr->key() << std::endl;
195 return i->second->filter(combined, geometry, load);
199 typedef typename AttributeIndex::Config AttributeConfig;
202 new AttributeConfig(
myInput->filter(
true,
LOAD), attr->key())));
204 DtInfo <<
"Creating feature attribute index on key " << attr->key() << std::endl;
205 std::auto_ptr<FS> ret(set->filter(combined, geometry, load));
207 myData->myIndexMap.insert(attr->key(),
set.release());
208 return ret.release();
211 return myMainIndex->filter(combined, geometry, load);
240 typedef tbb::queuing_rw_mutex
Mutex;
247 typedef boost::ptr_map<const DtFeature::Key, FS>
Map;