VR-Forces 5.0.2 Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
featureSetList.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>
13 
14 #include <vector>
15 
16 #include <tbb/spin_mutex.h>
17 
18 namespace MAKVRinTerra
19 {
25  template <typename FS, typename Inner>
27  : public FS
28 #ifdef DtObjectDebugger_Enable
29  , public DtObjectDebugger< DtFeatureSetList<FS,Inner> >
30 #endif
31  {
32  public:
33  using FS::filter;
34 
35  typedef FS FeatureSet;
36  typedef typename FeatureSet::ForEachFunction ForEachFunction;
37  typedef typename FeatureSet::LoadedCallback LoadedCallback;
38  typedef typename FeatureSet::DetachCallback DetachCallback;
39  typedef typename FS::Visitor Visitor;
40  typedef typename FS::ConstVisitor ConstVisitor;
41 
42  explicit DtFeatureSetList();
43  explicit DtFeatureSetList(size_t);
44 
46 
53  void add(Inner* fs);
54  void add(const Inner&);
55  void add(std::auto_ptr<Inner>);
56 
58  void addFront(Inner*);
59 
60  std::string label() const;
61  void forEachFeatureParallel(const ForEachFunction& func) const;
62  DetachCallback forEachFeatureAsync(const ForEachFunction& func) const;
63  FS* filter(const DtQuery&, const boost::optional<DtFeatureGeometry>&, DtLoadType) const;
64  DtFeatureSetList* clone() const;
65  bool loaded(double = 0.0) const;
66  DetachCallback addLoadedCallback(const LoadedCallback&) const;
67  unsigned numberOfFeatures() const;
68  bool elided() const;
69  bool empty() const;
70  bool isIndexed() const;
71  bool isCacheable(const boost::optional<DtFeatureGeometry>& area) const;
72  void cacheEstimate(double& time, double& size, const boost::optional<DtFeatureGeometry>& area) const;
73  void cacheData(
74  const boost::optional<DtFeatureGeometry>& area,
75  DtFeatureCacheProgressCallback* progress) const;
76 
77  void accept(Visitor&);
78  void accept(ConstVisitor&) const;
79 
80  protected:
81  struct ParallelIterator;
82  template <typename Function> struct ParallelAsyncIterator;
83  struct ParallelFilter;
84 
85  struct LoadDetacher;
86 
88  explicit DtFeatureSetList(const DtFeatureSetList&);
89 
90  typedef tbb::spin_mutex AddMutex;
92 
93  typedef std::vector<Inner*> PtrList;
95  };
96 
97  template <size_t N, typename FS, typename Inner>
99  : public FS
100 #ifdef DtObjectDebugger_Enable
101  , public DtObjectDebugger< DtFeatureSetArray<N,FS,Inner> >
102 #endif
103  {
104  public:
105  using FS::filter;
106 
107  typedef FS FeatureSet;
108  typedef typename FeatureSet::ForEachFunction ForEachFunction;
109  typedef typename FeatureSet::LoadedCallback LoadedCallback;
110  typedef typename FeatureSet::DetachCallback DetachCallback;
111  typedef typename FS::Visitor Visitor;
112  typedef typename FS::ConstVisitor ConstVisitor;
113 
115 
122  void set(size_t n, Inner* fs);
123  void set(size_t n, const Inner&);
124  void set(size_t n, std::auto_ptr<Inner>);
125 
126  std::string label() const;
127  void forEachFeatureParallel(const ForEachFunction& func) const;
128  DetachCallback forEachFeatureAsync(const ForEachFunction& func) const;
129  FS* filter(const DtQuery&, const boost::optional<DtFeatureGeometry>&, DtLoadType) const;
130  DtFeatureSetArray* clone() const;
131  bool loaded(double = 0.0) const;
132  DetachCallback addLoadedCallback(const LoadedCallback&) const;
133  unsigned numberOfFeatures() const;
134  bool elided() const;
135  bool empty() const;
136  bool isIndexed() const;
137  bool isCacheable(const boost::optional<DtFeatureGeometry>& area) const;
138  void cacheEstimate(double& time, double& size, const boost::optional<DtFeatureGeometry>& area) const;
139  void cacheData(
140  const boost::optional<DtFeatureGeometry>& area,
141  DtFeatureCacheProgressCallback* progress) const;
142 
143  void accept(Visitor&);
144  void accept(ConstVisitor&) const;
145 
146  protected:
147  struct ParallelIterator;
148  template <typename Function> struct ParallelAsyncIterator;
149  struct ParallelFilter;
150 
151  struct LoadDetacher;
152 
154  explicit DtFeatureSetArray(const DtFeatureSetArray&);
155 
156  typedef tbb::spin_mutex AddMutex;
158 
159  std::auto_ptr<Inner> myFeatures[N];
160  };
161 }
162 
164 //DT_DEFINE_OBJECT_DEBUGGER_NAME_TEMPLATE(MAKVRinTerra::DtFeatureSetArray);
#define DT_DLL_features
stop complaining about multiple independent base classes for boost::noncopyable this should probably ...
Definition: featuresDefines.h:41
Definition: featureSetList.h:98
AddMutex myAddMutex
Definition: featureSetList.h:91
PtrList myFeatures
Definition: featureSetList.h:94
AddMutex myAddMutex
Definition: featureSetList.h:157
tbb::spin_mutex AddMutex
Definition: featureSetList.h:156
FS::Visitor Visitor
Definition: featureSetList.h:39
voidpf void uLong size
Definition: ioapi.h:39
Default on in debug, off in release.
Definition: objectCounter.h:31
FS::Visitor Visitor
Definition: featureSetList.h:111
FS FeatureSet
Definition: featureSetList.h:35
FeatureSet::ForEachFunction ForEachFunction
Definition: featureSetList.h:108
FS FeatureSet
Definition: featureSetList.h:107
FS::ConstVisitor ConstVisitor
Definition: featureSetList.h:112
FeatureSet::ForEachFunction ForEachFunction
Definition: featureSetList.h:36
std::vector< Inner * > PtrList
Definition: featureSetList.h:93
FeatureSet::LoadedCallback LoadedCallback
Definition: featureSetList.h:37
class DT_DLL_features DtFeatureSetArray
Definition: featureSet.h:72
Represents a set of characeters a DtFeature object can have. DtQuery objects are the way to communica...
Definition: query.h:38
tbb::spin_mutex AddMutex
Definition: featureSetList.h:90
FeatureSet::DetachCallback DetachCallback
Definition: featureSetList.h:110
FS::ConstVisitor ConstVisitor
Definition: featureSetList.h:40
#define DT_DEFINE_OBJECT_DEBUGGER_NAME_TEMPLATE(type)
Definition: objectCounter.h:275
FeatureSet::DetachCallback DetachCallback
Definition: featureSetList.h:38
class DT_DLL_features DtFeatureSetList
Definition: featureSet.h:69
DtLoadType
Used to indicate whether to load features. See DtFeatureSetTemplate::filter.
Definition: featureSet.h:36
DtFeatureSet used to combine multiple feature sets into one. This class allows all feature set algori...
Definition: featureSetList.h:26
FeatureSet::LoadedCallback LoadedCallback
Definition: featureSetList.h:109

Document ID: Generated on Sun Dec 4 20:22:03 EST 2022 from SVN revision 249613
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)