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 loaded(
double timeout=0.0)
const
79 tbb::tick_count start = tbb::tick_count::now();
84 Mutex::scoped_lock lock(
myData->myMutex,
false);
87 double whatsleft = timeout - (tbb::tick_count::now() - start).seconds();
91 if (!i->second->loaded(whatsleft))
117 : func(func), query(query)
140 const boost::optional<DtFeatureGeometry>& geometry,
147 return myMainIndex->filter(combined, geometry, load);
165 DtWarn <<
"Query = " << query << std::endl;
167 DtWarn <<
"Combined = " << combined << std::endl;
173 Mutex::scoped_lock lock(
myData->myMutex,
true);
175 if (i !=
myData->myIndexMap.end())
177 DtInfo <<
"Using feature attribute index on key " << attr->key() << std::endl;
178 return i->second->filter(combined, geometry, load);
182 typedef typename AttributeIndex::Config AttributeConfig;
185 new AttributeConfig(
myInput->filter(
true,
LOAD), attr->key())));
187 DtInfo <<
"Creating feature attribute index on key " << attr->key() << std::endl;
188 std::auto_ptr<FS> ret(set->filter(combined, geometry, load));
190 myData->myIndexMap.insert(attr->key(),
set.release());
191 return ret.release();
194 return myMainIndex->filter(combined, geometry, load);
223 typedef tbb::queuing_rw_mutex
Mutex;
230 typedef boost::ptr_map<const DtFeature::Key, FS>
Map;