VR-Forces 4.5 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
dynamicFeatureSet.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2015 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
9 
10 #pragma once
11 
13 #include "features/featureSet.h"
15 
16 #include "vrfutil/objectCounter.h"
17 
18 #include <boost/signals2.hpp>
19 
20 namespace MAKVRinTerra
21 {
23  template <typename F>
25  : public DtFeatureSetTemplate<F>::Source
26  , public DtObjectDebugger< DtDynamicFeatureSetTemplate<F> >
27  {
29 
30  public:
33  typedef typename Base::FeaturePtr FeaturePtr;
34  typedef typename Base::Feature Feature;
35 
36  typedef boost::shared_ptr<DtDynamicFeatureSetTemplate> Ptr;
37  typedef boost::shared_ptr<const DtDynamicFeatureSetTemplate> CPtr;
38 
40  {
41  return boost::static_pointer_cast<DtDynamicFeatureSetTemplate>(Base::shared_from_this());
42  }
43 
44  std::string label() const
45  {
46  return "dynamic feature set";
47  }
48 
50  const DtQuery& query,
51  const boost::optional<DtFeatureGeometry>& geometry,
52  DtLoadType load) const
53  {
54  return new typename Base::Filtered(this->clone(), query, geometry);
55  }
56 
58  {
59  if (!callback)
60  return DetachCallback();
61 
62  typedef boost::signals2::connection Connection;
63 
64  Connection conn = myLoadedSignal.connect(callback);
65 
66  try
67  {
68  return boost::bind(&Connection::disconnect, conn);
69  }
70  catch (...)
71  {
72  conn.disconnect();
73  throw;
74  }
75  }
76 
78  {
79  FeaturePtr f = Base::addFeaturePtr(feature);
81  return f;
82  }
83 
84  protected:
85  typedef boost::signals2::signal<void ()> LoadedSignal;
87  };
88 
90 }
91 
93 

Document ID: Generated on Thu Mar 23 18:54:12 EDT 2017 from SVN revision 174804
Copyright © 2005-2017 VT MÄK. All Rights Reserved (www.mak.com)