VR-Forces 4.3 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
featureSetList.h
Go to the documentation of this file.
1 
2 
3 
4 
5 #pragma once
6 
7 #include <features/featureSet.h>
8 
9 #include <vector>
10 
11 #include <tbb/spin_mutex.h>
12 
13 namespace MAKVRinTerra
14 {
20  template <typename FS, typename Inner>
22  : public FS
23  , public DtObjectDebugger< DtFeatureSetList<FS,Inner> >
24  {
25  public:
26  using FS::filter;
27 
28  typedef FS FeatureSet;
29  typedef typename FeatureSet::ForEachFunction ForEachFunction;
30  typedef typename FeatureSet::LoadedCallback LoadedCallback;
31  typedef typename FeatureSet::DetachCallback DetachCallback;
32  typedef typename FS::Visitor Visitor;
33  typedef typename FS::ConstVisitor ConstVisitor;
34 
35  explicit DtFeatureSetList();
36  explicit DtFeatureSetList(size_t);
37 
39 
46  void add(Inner* fs);
47  void add(const Inner&);
48  void add(std::auto_ptr<Inner>);
49 
51  void addFront(Inner*);
52 
53  std::string label() const;
54  void forEachFeatureParallel(const ForEachFunction& func) const;
55  DetachCallback forEachFeatureAsync(const ForEachFunction& func) const;
56  FS* filter(const DtQuery&, const boost::optional<DtFeatureGeometry>&, DtLoadType) const;
57  DtFeatureSetList* clone() const;
58  bool loaded(double = 0.0) const;
59  DetachCallback addLoadedCallback(const LoadedCallback&) const;
60  unsigned numberOfFeatures() const;
61  bool empty() const;
62  bool isIndexed() const;
63 
64  void accept(Visitor&);
65  void accept(ConstVisitor&) const;
66 
67  protected:
68  struct ParallelIterator;
69  template <typename Function> struct ParallelAsyncIterator;
70  struct ParallelFilter;
71 
72  struct LoadDetacher;
73 
75  explicit DtFeatureSetList(const DtFeatureSetList&);
76 
77  typedef tbb::spin_mutex AddMutex;
79 
80  typedef std::vector<Inner*> PtrList;
82  };
83 
84  template <size_t N, typename FS, typename Inner>
86  : public FS
87  , public DtObjectDebugger< DtFeatureSetArray<N,FS,Inner> >
88  {
89  public:
90  using FS::filter;
91 
92  typedef FS FeatureSet;
93  typedef typename FeatureSet::ForEachFunction ForEachFunction;
94  typedef typename FeatureSet::LoadedCallback LoadedCallback;
95  typedef typename FeatureSet::DetachCallback DetachCallback;
96  typedef typename FS::Visitor Visitor;
97  typedef typename FS::ConstVisitor ConstVisitor;
98 
100 
107  void set(size_t n, Inner* fs);
108  void set(size_t n, const Inner&);
109  void set(size_t n, std::auto_ptr<Inner>);
110 
111  std::string label() const;
112  void forEachFeatureParallel(const ForEachFunction& func) const;
113  DetachCallback forEachFeatureAsync(const ForEachFunction& func) const;
114  FS* filter(const DtQuery&, const boost::optional<DtFeatureGeometry>&, DtLoadType) const;
115  DtFeatureSetArray* clone() const;
116  bool loaded(double = 0.0) const;
117  DetachCallback addLoadedCallback(const LoadedCallback&) const;
118  unsigned numberOfFeatures() const;
119  bool empty() const;
120  bool isIndexed() const;
121 
122  void accept(Visitor&);
123  void accept(ConstVisitor&) const;
124 
125  protected:
126  struct ParallelIterator;
127  template <typename Function> struct ParallelAsyncIterator;
128  struct ParallelFilter;
129 
130  struct LoadDetacher;
131 
133  explicit DtFeatureSetArray(const DtFeatureSetArray&);
134 
135  typedef tbb::spin_mutex AddMutex;
137 
138  std::auto_ptr<Inner> myFeatures[N];
139  };
140 }
141 
143 //DT_DEFINE_OBJECT_DEBUGGER_NAME_TEMPLATE(MAKVRinTerra::DtFeatureSetArray);

Document ID: Generated on Wed Mar 11 21:20:57 EDT 2015 from SVN revision 150940
Copyright © 2005-2014 VT MÄK. All Rights Reserved (www.mak.com)