VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
featureSetWrappers.h
Go to the documentation of this file.
1 /******************************************************************************
2  * Copyright (c) 2020 MAK Technologies, Inc.
3  * All rights reserved.
4  ******************************************************************************/
5 
9 
10 #pragma once
11 
12 #include <features/featureSet.h>
14 
15 #include <vrfutil/objectCounter.h>
16 
17 #include <boost/scoped_ptr.hpp>
18 #include <boost/shared_ptr.hpp>
19 #include <boost/weak_ptr.hpp>
20 #include <boost/foreach.hpp>
21 #include <boost/signals2.hpp>
22 
23 #include <tbb/spin_mutex.h>
24 #include <tbb/spin_rw_mutex.h>
25 #include <tbb/null_rw_mutex.h>
26 
29 
32 
35 
36 namespace MAKVRinTerra
37 {
39  template <
40  typename Derived,
41  typename FS,
42  typename Inner = FS>
43  class DtFeatureSetWrapperTemplate : public FS
44  {
45  protected:
46  Derived* This() { return static_cast<Derived*>(this); }
47  const Derived* This() const { return static_cast<const Derived*>(this); }
48 
51  {
52  }
53 
54  public:
55  typedef FS FeatureSet;
56  typedef typename FeatureSet::Feature Feature;
57  typedef typename FeatureSet::ForEachFunction ForEachFunction;
58  typedef typename FeatureSet::DetachCallback DetachCallback;
59  typedef typename FeatureSet::LoadedCallback LoadedCallback;
60 
61  typedef boost::shared_ptr<Inner> Ptr;
62  typedef boost::shared_ptr<const Inner> CPtr;
63 
64  template <typename Function=ForEachFunction>
66 
67  std::string label() const
68  {
69  CPtr handle(This()->getPtr());
70  if (handle)
71  return handle->label();
72 
73  return "empty feature set wrapper";
74  }
75 
76 
77  unsigned numberOfFeatures() const
78  {
79  CPtr handle(This()->getPtr());
80  if (handle)
81  return handle->numberOfFeatures();
82 
83  return 0;
84  }
85 
86  bool elided() const
87  {
88  CPtr handle(This()->getPtr());
89  if (handle)
90  return handle->elided();
91 
92  return FS::elided();
93  }
94 
95  bool empty() const
96  {
97  CPtr handle(This()->getPtr());
98  if (handle)
99  return handle->empty();
100 
101  return FS::empty();
102  }
103 
104  bool isIndexed() const
105  {
106  CPtr handle(This()->getPtr());
107  if (handle)
108  return handle->isIndexed();
109 
110  return FS::isIndexed();
111  }
112 
113  bool isCacheable(const boost::optional<DtFeatureGeometry>& area) const
114  {
115  CPtr handle(This()->getPtr());
116  if (handle)
117  return handle->isCacheable(area);
118  else
119  return FS::isCacheable(area);
120  }
121 
122  void cacheEstimate(double& time, double& size, const boost::optional<DtFeatureGeometry>& area) const
123  {
124  CPtr handle(This()->getPtr());
125  if (handle)
126  handle->cacheEstimate(time, size, area);
127  else
128  return FS::cacheEstimate(time, size, area);
129  }
130 
131  void cacheData(
132  const boost::optional<DtFeatureGeometry>& area,
133  DtFeatureCacheProgressCallback* progress) const
134  {
135  CPtr handle(This()->getPtr());
136  if (handle)
137  handle->cacheData(area, progress);
138  else
139  FS::cacheData(area, progress);
140  }
141 
142  bool loaded(double timeout=0.0) const
143  {
144  CPtr handle(This()->getPtr());
145  if (handle)
146  return handle->loaded(timeout);
147 
148  return false;
149  }
150 
151  virtual bool loadedThrowIfNotSet(double timeout=0.0) const
152  {
153  CPtr handle(This()->getPtr());
154  if (handle)
155  return handle->loaded(timeout);
156 
158  }
159 
161 #ifdef DtObjectDebugger_Enable
162  : public DtObjectDebugger<LoadedCounter>
163 #endif
164  {
166  explicit LoadedCounter(const LoadedCallback& cb) : callback(cb) { }
167  void operator()() const { callback(); }
168  };
169 
171  {
172  if (!cb)
173  DetachCallback();
174 
175  //boost::signals2::connection conn = myLoadedSignal->connect(cb);
176  boost::signals2::connection conn = myLoadedSignal->connect(LoadedCounter(cb));
177 
178  try
179  {
180  return boost::bind(&boost::signals2::connection::disconnect, conn);
181  }
182  catch (...)
183  {
184  conn.disconnect();
185  throw;
186  }
187  }
188 
189  void forEachFeatureParallel(const ForEachFunction& func) const
190  {
191  CPtr handle(This()->getPtr());
192  if (handle)
193  handle->forEachFeatureParallel(func);
194  }
195 
197  {
198  typedef CallbackRecord<ForEachFunction> Record;
199  typedef typename Record::Ptr RecordPtr;
200 
201  DetachCallback detacher;
202 
204  CPtr handle(This()->getPtr());
205  if (handle)
206  detacher = handle->forEachFeatureAsync(func);
207 
209  try
210  {
211  typename CallbackMutex::scoped_lock headLock(myCallbackMutex);
212  RecordPtr newHead(Record::Make(func, myHead, detacher));
213  const_cast<RecordPtr&>(myHead) = newHead;
214  return typename Record::Detacher(newHead);
215  }
216  catch (...)
217  {
218  if (detacher)
219  detacher();
220 
221  throw;
222  }
223  }
224 
226  const DtQuery& query,
227  const boost::optional<DtFeatureGeometry>& geometry,
228  DtLoadType load) const
229  {
230  CPtr handle(This()->getPtr());
231  if (handle)
232  return this->Wrap(handle->filter(query, geometry, load));
233 
235  assert(false);
236  DtTHROW_NEW(DtException, "filtered empty feature set wrapper");
237  }
238 
239  FeatureSet* filter(const DtQuery& query, DtLoadType load) const
240  {
241  return FS::filter(query, load);
242  }
243 
244  FeatureSet* filter(const boost::optional<DtFeatureGeometry>& geometry, DtLoadType load) const
245  {
246  return FS::filter(geometry, load);
247  }
248 
249  public:
250  template <typename Function>
251  class CallbackRecord
252 #ifdef DtObjectDebugger_Enable
253  : public DtObjectDebugger<DtFeatureSetWrapperCallbackRecordTag>
254 #endif
255  {
256  public:
257  typedef boost::shared_ptr<CallbackRecord> Ptr;
258  typedef boost::weak_ptr<CallbackRecord> WPtr;
259 
260  struct Detacher
261 #ifdef DtObjectDebugger_Enable
262  : public DtObjectDebugger<DtFeatureSetWrapperCallbackRecordDetacherTag>
263 #endif
264  {
265  void operator()() const
266  {
267  boost::shared_ptr<CallbackRecord> callback(callbackWptr.lock());
268  if (callback)
269  callback->detach();
270  }
271 
272  explicit Detacher(const boost::shared_ptr<CallbackRecord>& rec)
273  : callbackWptr(rec) { }
274 
275  boost::weak_ptr<CallbackRecord> callbackWptr;
276  };
277 
278  static Ptr Make(const Function& func, const Ptr& curHead, const DetachCallback& detach)
279  {
280  Ptr newRec(new CallbackRecord(func, curHead, detach));
281  while (newRec->next)
282  {
283  Mutex::scoped_lock lock(newRec->next->mutex);
284  if (newRec->next->func)
285  break;
286 
287  newRec->next = newRec->next->next;
288  }
289 
290  return newRec;
291  }
292 
295  void addCallbacksTo(const CPtr& fs)
296  {
297  Mutex::scoped_lock lock(mutex);
298 
301  if (detacher)
302  {
303  detacher();
305  }
306 
308  if (func && fs)
309  {
310  Function f(func);
311 
312  lock.release();
313  DetachCallback d = fs->forEachFeatureAsync(f);
314  lock.acquire(mutex);
315 
316  if (func)
317  detacher = d;
318  else if (d)
319  d();
320  }
321 
322  Ptr ne = next;
323  lock.release();
324 
325  if (ne)
326  {
327  try
328  {
329  ne->addCallbacksTo(fs);
330  }
331  catch (...)
332  {
333  lock.acquire(mutex);
334  if (detacher)
335  {
336  detacher();
338  }
339 
340  throw;
341  }
342  }
343  }
344 
345  void detach()
346  {
347  Mutex::scoped_lock lock(mutex);
348 
349  if (!func)
350  return;
351 
352  func = Function();
353 
354  if (detacher)
355  {
356  detacher();
358  }
359 
360  Ptr pr = prev.lock();
361  Ptr ne = next;
362 
363  while (pr)
364  {
365  lock.release();
366  lock.acquire(pr->mutex);
367 
368  if (pr->func)
369  break;
370 
371  pr = pr->prev.lock();
372  }
373 
374  while (ne)
375  {
376  Mutex::scoped_lock endLock(ne->mutex);
377  if (ne->func)
378  {
379  if (pr)
380  pr->next = ne;
381 
382  return;
383  }
384 
385  ne = ne->next;
386  }
387 
388  if (pr)
389  pr->next = ne;
390  }
391 
393  {
394  if (detacher)
395  detacher();
396  }
397 
398  typedef tbb::spin_mutex Mutex;
399 
400  private:
401  explicit CallbackRecord(
402  const Function& func,
403  const Ptr& next,
404  const DetachCallback& detach)
405  : func(func)
406  , next(next)
407  , detacher(detach)
408  {
409  }
410 
411  mutable Mutex mutex;
412  Function func;
416  };
417 
418 protected:
419  void setupCallbacks(const CPtr& fs)
420  {
421  typename CallbackMutex::scoped_lock lock(myCallbackMutex);
422 
423  myLoadedSignalDetacher.reset();
424 
425  if (myHead)
426  myHead->addCallbacksTo(fs);
427 
428  if (fs)
429  {
430  myLoadedSignalDetacher.reset(fs->addLoadedCallback(LoadedCaller(myLoadedSignal)));
431 
432  try
433  {
434  if (fs->loaded(0.0))
435  (*myLoadedSignal)();
436  }
437  catch (DtFeatureSetLoadingException&) { }
438  }
439  }
440 
441  private:
442  typedef tbb::spin_mutex CallbackMutex;
443  typedef boost::signals2::signal_type<
444  void (),
445  boost::signals2::keywords::mutex_type<tbb::spin_mutex> >::type LoadedSignal;
446 
447  struct LoadedCaller
448 #ifdef DtObjectDebugger_Enable
449  : public DtObjectDebugger<DtFeatureSetWrapperLoadedCallerTag>
450 #endif
451  {
452  boost::weak_ptr<LoadedSignal> sig;
453  explicit LoadedCaller(const boost::shared_ptr<LoadedSignal>& sig)
454  : sig(sig) { }
455 
456  void operator()() const
457  {
458  boost::shared_ptr<LoadedSignal> signal(sig.lock());
459  if (signal)
460  (*signal)();
461  }
462  };
463 
465  typename CallbackRecord<>::Ptr myHead;
466  boost::shared_ptr<LoadedSignal> myLoadedSignal;
467  typename FeatureSet::DetachScopeGuard myLoadedSignalDetacher;
468  };
469 
470  template <
471  typename FS,
472  template <typename> class PtrTemplate,
473  typename Inner>
474  class DtFeatureSetWrapper;
475 
476  template <typename FS, typename Inner>
477  class DtFeatureSetWrapper<FS,boost::scoped_ptr,Inner> : public FS
478  {
479  public:
480  typedef typename FS::Feature Feature;
481  typedef typename FS::ForEachFunction ForEachFunction;
482  typedef typename FS::LoadedCallback LoadedCallback;
483  typedef typename FS::DetachCallback DetachCallback;
484 
485  explicit DtFeatureSetWrapper(Inner* fs) : mySet(fs)
486  {
487  assert(mySet);
488  }
489 
490  template <typename OtherFS>
491  explicit DtFeatureSetWrapper(std::auto_ptr<OtherFS> fs)
492  : mySet(fs.release())
493  {
494  assert(mySet);
495  }
496 
497  Inner* getPtr() { return mySet.get(); }
498  const Inner* getPtr() const { return mySet.get(); }
499 
500  std::string label() const
501  {
502  return mySet->label();
503  }
504 
505  unsigned numberOfFeatures() const
506  {
507  return mySet->numberOfFeatures();
508  }
509 
510  bool elided() const
511  {
512  return mySet->elided();
513  }
514 
515  bool empty() const
516  {
517  return mySet->empty();
518  }
519 
520  bool isIndexed() const
521  {
522  return mySet->isIndexed();
523  }
524 
525  bool isCacheable(const boost::optional<DtFeatureGeometry>& area) const
526  {
527  return mySet->isCacheable(area);
528  }
529 
530  void cacheEstimate(double& time, double& size, const boost::optional<DtFeatureGeometry>& area) const
531  {
532  mySet->cacheEstimate(time, size, area);
533  }
534 
535  void cacheData(
536  const boost::optional<DtFeatureGeometry>& area,
537  DtFeatureCacheProgressCallback* progress) const
538  {
539  mySet->cacheData(area, progress);
540  }
541 
542  bool loaded(double timeout=0.0) const
543  {
544  return mySet->loaded(timeout);
545  }
546 
548  {
549  return mySet->addLoadedCallback(cb);
550  }
551 
552  void forEachFeatureParallel(const ForEachFunction& func) const
553  {
554  mySet->forEachFeatureParallel(func);
555  }
556 
558  {
559  return mySet->forEachFeatureAsync(func);
560  }
561 
562  FS* filter(
563  const DtQuery& query,
564  const boost::optional<DtFeatureGeometry>& geometry,
565  DtLoadType load) const
566  {
567  return this->Wrap(mySet->filter(query, geometry, load));
568  }
569 
570  FS* clone() const
571  {
572  return this->Wrap(mySet->clone());
573  }
574 
575  private:
576  const boost::scoped_ptr<Inner> mySet;
577  };
578 
579  template <typename FS, typename Inner>
580  class DtFeatureSetWrapper<FS,boost::shared_ptr,Inner>
582  DtFeatureSetWrapper<FS,boost::shared_ptr,Inner>,
583  FS,
584  Inner>
585  {
586  public:
588  {
589  }
590 
591  explicit DtFeatureSetWrapper(Inner* fs)
592  {
593  assert(fs);
594  setPtr(boost::shared_ptr<Inner>(fs));
595  }
596 
597  template <typename OtherFS>
598  explicit DtFeatureSetWrapper(std::auto_ptr<OtherFS> fs)
599  {
600  assert(fs.get());
601  setPtr(boost::shared_ptr<Inner>(fs.release()));
602  }
603 
604  template <typename OtherFS>
605  explicit DtFeatureSetWrapper(const boost::shared_ptr<OtherFS>& fs)
606  {
607  assert(fs.get());
608  setPtr(fs);
609  }
610 
611  boost::shared_ptr<Inner> getPtr()
612  {
613  Mutex::scoped_lock lock(myMutex, false);
614  return mySet;
615  }
616 
617  boost::shared_ptr<const Inner> getPtr() const
618  {
619  Mutex::scoped_lock lock(myMutex, false);
620  return mySet;
621  }
622 
623  boost::shared_ptr<Inner> setPtr(const boost::shared_ptr<Inner>& p)
624  {
625  Mutex::scoped_lock lock(myMutex, false);
626  if (mySet && p)
627  return mySet;
628 
629  if (!lock.upgrade_to_writer() && mySet && p)
630  return mySet;
631 
632  mySet = p;
633 
634  lock.downgrade_to_reader();
635  this->setupCallbacks(p);
636 
637  return mySet;
638  }
639 
640  boost::shared_ptr<Inner> setPtr(Inner* set)
641  {
642  boost::shared_ptr<Inner> fs(set);
643  return setPtr(fs);
644  }
645 
646  FS* clone() const
647  {
648  return this->Wrap(getPtr());
649  }
650 
651  protected:
652  typedef tbb::spin_rw_mutex Mutex;
653  mutable Mutex myMutex;
654 
655  boost::shared_ptr<Inner> mySet;
656  };
657 
658  template <typename FS, typename Inner>
659  class DtFeatureSetWrapper<FS,boost::weak_ptr,Inner>
661  DtFeatureSetWrapper<FS,boost::weak_ptr,Inner>,
662  FS,
663  Inner>
664  {
665  public:
666  typedef typename FS::Feature Feature;
667  typedef typename FS::ForEachFunction ForEachFunction;
668  typedef typename FS::DetachCallback DetachCallback;
669 
671  : mySet() { }
672 
673  template <typename T>
674  explicit DtFeatureSetWrapper(const boost::weak_ptr<T>& fs)
675  {
676  setPtr(fs.lock());
677  }
678 
679  template <typename T>
680  explicit DtFeatureSetWrapper(const boost::shared_ptr<T>& fs)
681  {
682  assert(fs);
683  setPtr(fs);
684  }
685 
686  boost::shared_ptr<Inner> getPtr()
687  {
688  Mutex::scoped_lock lock(myMutex, false);
689  return mySet.lock();
690  }
691 
692  boost::shared_ptr<const Inner> getPtr() const
693  {
694  Mutex::scoped_lock lock(myMutex, false);
695  return mySet.lock();
696  }
697 
698  boost::shared_ptr<Inner> getMutablePtr() const
699  {
700  return const_cast<DtFeatureSetWrapper*>(this)->getPtr();
701  }
702 
703  boost::shared_ptr<Inner> setPtr(const boost::shared_ptr<Inner>& p)
704  {
705  Mutex::scoped_lock lock(myMutex, false);
706  if (p)
707  {
708  boost::shared_ptr<Inner> s(mySet.lock());
709  if (s)
710  return s;
711  }
712 
713  if (!lock.upgrade_to_writer() && p)
714  {
715  boost::shared_ptr<Inner> s(mySet.lock());
716  if (s)
717  return s;
718  }
719 
720  mySet = p;
721 
722  lock.downgrade_to_reader();
723  this->setupCallbacks(p);
724 
725  return p;
726  }
727 
728  FS* clone() const
729  {
730  Mutex::scoped_lock lock(myMutex, false);
731  return this->Wrap(mySet);
732  }
733 
734  private:
735  typedef tbb::spin_rw_mutex Mutex;
736  mutable Mutex myMutex;
737 
738  boost::weak_ptr<Inner> mySet;
739  };
740 }
FS::DetachCallback DetachCallback
Definition: featureSetWrappers.h:668
const Inner * getPtr() const
Definition: featureSetWrappers.h:498
boost::shared_ptr< Inner > Ptr
Definition: featureSetWrappers.h:61
FeatureSet::Feature Feature
Definition: featureSetWrappers.h:56
CallbackRecord::Ptr myHead
Definition: featureSetWrappers.h:465
tbb::spin_mutex CallbackMutex
Definition: featureSetWrappers.h:442
boost::weak_ptr< Inner > mySet
Definition: featureSetWrappers.h:738
const LoadedCallback callback
Definition: featureSetWrappers.h:165
FeatureSet::ForEachFunction ForEachFunction
Definition: featureSetWrappers.h:57
Inner * getPtr()
Definition: featureSetWrappers.h:497
bool isCacheable(const boost::optional< DtFeatureGeometry > &area) const
Definition: featureSetWrappers.h:525
DtFeatureSetWrapper(std::auto_ptr< OtherFS > fs)
Definition: featureSetWrappers.h:491
void cacheEstimate(double &time, double &size, const boost::optional< DtFeatureGeometry > &area) const
Definition: featureSetWrappers.h:530
boost::shared_ptr< Inner > getPtr()
Definition: featureSetWrappers.h:611
tbb::spin_rw_mutex Mutex
Definition: featureSetWrappers.h:652
FS::LoadedCallback LoadedCallback
Definition: featureSetWrappers.h:482
FS::DetachCallback DetachCallback
Definition: featureSetWrappers.h:483
FeatureSet::DetachCallback DetachCallback
Definition: featureSetWrappers.h:58
DtFeatureSetWrapper()
Definition: featureSetWrappers.h:670
voidpf void uLong size
Definition: ioapi.h:39
WPtr prev
Definition: featureSetWrappers.h:413
Wrapper which transforms feature set types.
Definition: featureSetWrappers.h:43
Ptr next
Definition: featureSetWrappers.h:414
FeatureSet * filter(const boost::optional< DtFeatureGeometry > &geometry, DtLoadType load) const
Definition: featureSetWrappers.h:244
unsigned numberOfFeatures() const
Definition: featureSetWrappers.h:505
bool elided() const
Definition: featureSetWrappers.h:86
#define DT_DEFINE_OBJECT_DEBUGGER_NAME(type)
Definition: objectCounter.h:31
Mutex mutex
Definition: featureSetWrappers.h:411
Detacher(const boost::shared_ptr< CallbackRecord > &rec)
Definition: featureSetWrappers.h:272
Default on in debug, off in release.
Definition: objectCounter.h:27
boost::shared_ptr< LoadedSignal > myLoadedSignal
Definition: featureSetWrappers.h:466
Definition: featureSet.h:60
DtFeatureSetWrapper(std::auto_ptr< OtherFS > fs)
Definition: featureSetWrappers.h:598
void cacheData(const boost::optional< DtFeatureGeometry > &area, DtFeatureCacheProgressCallback *progress) const
Definition: featureSetWrappers.h:131
LoadedCounter(const LoadedCallback &cb)
Definition: featureSetWrappers.h:166
boost::shared_ptr< const Inner > CPtr
Definition: featureSetWrappers.h:62
FS * clone() const
Definition: featureSetWrappers.h:728
boost::shared_ptr< Inner > setPtr(const boost::shared_ptr< Inner > &p)
Definition: featureSetWrappers.h:703
void operator()() const
Definition: featureSetWrappers.h:265
boost::shared_ptr< Inner > setPtr(Inner *set)
Definition: featureSetWrappers.h:640
unsigned numberOfFeatures() const
Definition: featureSetWrappers.h:77
DetachCallback addLoadedCallback(const LoadedCallback &cb) const
Definition: featureSetWrappers.h:547
std::string label() const
Definition: featureSetWrappers.h:500
DtFeatureSetWrapperTemplate()
Definition: featureSetWrappers.h:49
const boost::scoped_ptr< Inner > mySet
Definition: featureSetWrappers.h:576
virtual bool loadedThrowIfNotSet(double timeout=0.0) const
Definition: featureSetWrappers.h:151
boost::weak_ptr< CallbackRecord > callbackWptr
Definition: featureSetWrappers.h:275
Represents a set of characeters a DtFeature object can have. DtQuery objects are the way to communica...
Definition: query.h:38
static Ptr Make(const Function &func, const Ptr &curHead, const DetachCallback &detach)
Definition: featureSetWrappers.h:278
binderNoArgs< _Fn > bind(const _Fn &_Func, const _Ty &_Left)
Definition: DtSTLUtilities.h:76
boost::weak_ptr< CallbackRecord > WPtr
Definition: featureSetWrappers.h:258
boost::shared_ptr< Inner > getPtr()
Definition: featureSetWrappers.h:686
bool elided() const
Definition: featureSetWrappers.h:510
FeatureSet::LoadedCallback LoadedCallback
Definition: featureSetWrappers.h:59
boost::shared_ptr< const Inner > getPtr() const
Definition: featureSetWrappers.h:617
Function func
Definition: featureSetWrappers.h:412
Definition: featureSetWrappers.h:30
tbb::spin_mutex Mutex
Definition: featureSetWrappers.h:398
DtFeatureSetWrapper(Inner *fs)
Definition: featureSetWrappers.h:591
FS * clone() const
Definition: featureSetWrappers.h:646
bool loaded(double timeout=0.0) const
Definition: featureSetWrappers.h:142
~CallbackRecord()
Definition: featureSetWrappers.h:392
FS::ForEachFunction ForEachFunction
Definition: featureSetWrappers.h:667
Definition: featureSetWrappers.h:27
boost::shared_ptr< Inner > setPtr(const boost::shared_ptr< Inner > &p)
Definition: featureSetWrappers.h:623
DtFeatureSetWrapper(const boost::weak_ptr< T > &fs)
Definition: featureSetWrappers.h:674
CallbackMutex myCallbackMutex
Definition: featureSetWrappers.h:464
DetachCallback addLoadedCallback(const LoadedCallback &cb) const
Definition: featureSetWrappers.h:170
Mutex myMutex
Definition: featureSetWrappers.h:736
DtFeatureSetWrapper(const boost::shared_ptr< T > &fs)
Definition: featureSetWrappers.h:680
bool empty() const
Definition: featureSetWrappers.h:95
std::string label() const
Definition: featureSetWrappers.h:67
void addCallbacksTo(const CPtr &fs)
called by setPtr when a wrapper has it&#39;s wrapped feature set we must call all the saved callbacks on ...
Definition: featureSetWrappers.h:295
DetachCallback forEachFeatureAsync(const ForEachFunction &func) const
Definition: featureSetWrappers.h:196
DetachCallback forEachFeatureAsync(const ForEachFunction &func) const
Definition: featureSetWrappers.h:557
boost::shared_ptr< const Inner > getPtr() const
Definition: featureSetWrappers.h:692
FS::ForEachFunction ForEachFunction
Definition: featureSetWrappers.h:481
DtLoadType
Used to indicate whether to load features. See DtFeatureSetTemplate::filter.
Definition: featureSet.h:36
const Derived * This() const
Definition: featureSetWrappers.h:47
DetachCallback detacher
Definition: featureSetWrappers.h:415
boost::signals2::signal_type< void(), boost::signals2::keywords::mutex_type< tbb::spin_mutex > >::type LoadedSignal
Definition: featureSetWrappers.h:445
bool isIndexed() const
Definition: featureSetWrappers.h:520
Derived * This()
Definition: featureSetWrappers.h:46
DtFeatureSetWrapper(const boost::shared_ptr< OtherFS > &fs)
Definition: featureSetWrappers.h:605
DtFeatureSetWrapper(Inner *fs)
Definition: featureSetWrappers.h:485
void operator()() const
Definition: featureSetWrappers.h:456
void cacheData(const boost::optional< DtFeatureGeometry > &area, DtFeatureCacheProgressCallback *progress) const
Definition: featureSetWrappers.h:535
FS::Feature Feature
Definition: featureSetWrappers.h:666
Definition: featureSetWrappers.h:33
void setupCallbacks(const CPtr &fs)
Definition: featureSetWrappers.h:419
FS FeatureSet
Definition: featureSetWrappers.h:55
FS::Feature Feature
Definition: featureSetWrappers.h:480
boost::weak_ptr< LoadedSignal > sig
Definition: featureSetWrappers.h:452
FeatureSet::DetachScopeGuard myLoadedSignalDetacher
Definition: featureSetWrappers.h:467
FS * filter(const DtQuery &query, const boost::optional< DtFeatureGeometry > &geometry, DtLoadType load) const
Definition: featureSetWrappers.h:562
LoadedCaller(const boost::shared_ptr< LoadedSignal > &sig)
Definition: featureSetWrappers.h:453
bool empty() const
Definition: featureSetWrappers.h:515
void operator()() const
Definition: featureSetWrappers.h:167
FS * clone() const
Definition: featureSetWrappers.h:570
void forEachFeatureParallel(const ForEachFunction &func) const
Definition: featureSetWrappers.h:189
FeatureSet * filter(const DtQuery &query, DtLoadType load) const
Definition: featureSetWrappers.h:239
void cacheEstimate(double &time, double &size, const boost::optional< DtFeatureGeometry > &area) const
Definition: featureSetWrappers.h:122
void detach()
Definition: featureSetWrappers.h:345
FeatureSet * filter(const DtQuery &query, const boost::optional< DtFeatureGeometry > &geometry, DtLoadType load) const
Definition: featureSetWrappers.h:225
bool loaded(double timeout=0.0) const
Definition: featureSetWrappers.h:542
bool isCacheable(const boost::optional< DtFeatureGeometry > &area) const
Definition: featureSetWrappers.h:113
CallbackRecord(const Function &func, const Ptr &next, const DetachCallback &detach)
Definition: featureSetWrappers.h:401
bool isIndexed() const
Definition: featureSetWrappers.h:104
void forEachFeatureParallel(const ForEachFunction &func) const
Definition: featureSetWrappers.h:552
tbb::spin_rw_mutex Mutex
Definition: featureSetWrappers.h:735
boost::shared_ptr< CallbackRecord > Ptr
Definition: featureSetWrappers.h:257
boost::shared_ptr< Inner > getMutablePtr() const
Definition: featureSetWrappers.h:698
boost::shared_ptr< Inner > mySet
Definition: featureSetWrappers.h:655

Document ID: Generated on Tue Sep 24 19:28:17 EDT 2024 from SVN revision 269799
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)