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

Document ID: Generated on Thu Oct 23 22:29:17 EDT 2025 from SVN revision 280951
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)