]> git.mxchange.org Git - flightgear.git/commitdiff
Move tiedpropertylist from flightgear to simgear
authorTorsten Dreyer <Torsten@t3r.de>
Sun, 6 Feb 2011 14:44:09 +0000 (15:44 +0100)
committerTorsten Dreyer <Torsten@t3r.de>
Sun, 6 Feb 2011 14:44:09 +0000 (15:44 +0100)
src/Environment/environment.hxx
src/Environment/environment_ctrl.cxx
src/Environment/environment_mgr.hxx
src/Environment/metarairportfilter.hxx
src/Environment/metarproperties.hxx
src/Environment/realwx_ctrl.cxx
src/Environment/terrainsampler.cxx
src/Environment/tiedpropertylist.hxx [deleted file]

index 048b17992885e77182bba414b6c7e13bf58bb950..c1da680376b699501de5a25721178a843afc2c5e 100644 (file)
@@ -25,7 +25,7 @@
 #include <simgear/compiler.h>
 
 #include <cmath>
-#include "tiedpropertylist.hxx"
+#include <simgear/props/tiedpropertylist.hxx>
 
 /**
  * Model the natural environment.
@@ -146,7 +146,7 @@ private:
   double wind_from_down_fps;
 
   bool     live_update;
-  TiedPropertyList _tiedProperties;
+  simgear::TiedPropertyList _tiedProperties;
 
 };
 
index d4ebbf595fae872dbac50e7a0b9b1ee364b5f5f4..c182f06250cf250e62993e3b77f726c02e9b3992 100644 (file)
@@ -123,7 +123,7 @@ private:
     LayerTable _aloft_table;
 
     FGEnvironment _environment;
-    TiedPropertyList _tiedProperties;
+    simgear::TiedPropertyList _tiedProperties;
 };
 
 //////////////////////////////////////////////////////////////////////////////
index d9c7703197dc96d980138eb8107f3f8a91eca46b..e6041f81361b55068066356addd88c67d715db93 100644 (file)
@@ -25,7 +25,7 @@
 #include <simgear/compiler.h>
 #include <simgear/structure/subsystem_mgr.hxx>
 #include <simgear/math/SGMath.hxx>
-#include "tiedpropertylist.hxx"
+#include <simgear/props/tiedpropertylist.hxx>
 
 #ifdef SG_HAVE_STD_INCLUDES
 #  include <cmath>
@@ -96,7 +96,7 @@ private:
   FGClouds *fgClouds;
   SGPropertyNode_ptr _altitudeNode;
   bool _cloudLayersDirty;
-  TiedPropertyList _tiedProperties;
+  simgear::TiedPropertyList _tiedProperties;
 };
 
 #endif // _ENVIRONMENT_MGR_HXX
index 568a28b950cd77b3908bbe6ca2d01076398b3868..f31eb64f558f61f30cd6063427608cb8e2620df6 100644 (file)
@@ -24,7 +24,6 @@
 
 #include <Airports/simple.hxx>
 #include <simgear/props/props.hxx>
-#include "tiedpropertylist.hxx"
 
 namespace Environment {
 
index 0e157169eb9f23036228c2f6642b04f42b459d70..7d108100defbf7f0d338197c6ca55c4571225d19 100644 (file)
@@ -25,7 +25,7 @@
 
 #include <Airports/simple.hxx>
 #include <simgear/props/props.hxx>
-#include "tiedpropertylist.hxx"
+#include <simgear/props/tiedpropertylist.hxx>
 
 namespace Environment {
 
@@ -89,7 +89,7 @@ private:
     bool _snow_cover;
     std::string _decoded;
 protected:
-    TiedPropertyList _tiedProperties;
+    simgear::TiedPropertyList _tiedProperties;
     MagneticVariation * _magneticVariation;
 };
 
index 98fe6ed3b71b8ba4f30ba858a6e3a38b20ed638c..197f4cf5260baa23083e56aaeeeaf11eaa875ad2 100644 (file)
@@ -25,7 +25,6 @@
 #endif
 
 #include "realwx_ctrl.hxx"
-#include "tiedpropertylist.hxx"
 #include "metarproperties.hxx"
 #include "metarairportfilter.hxx"
 #include "fgmetar.hxx"
@@ -34,6 +33,7 @@
 
 #include <simgear/structure/exception.hxx>
 #include <simgear/misc/strutils.hxx>
+#include <simgear/props/tiedpropertylist.hxx>
 #include <algorithm>
 #if defined(ENABLE_THREADS)
 #include <OpenThreads/Thread>
@@ -105,7 +105,7 @@ protected:
 
     bool _enabled;
     bool __enabled;
-    TiedPropertyList _tiedProperties;
+    simgear::TiedPropertyList _tiedProperties;
  ;   typedef std::vector<LiveMetarProperties_ptr> MetarPropertiesList;
     MetarPropertiesList _metarProperties;
 };
index 276c8ffb1e1ece01b502b7d1d894aad36daedda7..0d08af84e2d6031d03d5e5d87f5f89334653f05e 100644 (file)
@@ -32,7 +32,7 @@
 #include "terrainsampler.hxx"
 using simgear::PropertyList;
 
-#include "tiedpropertylist.hxx"
+#include <simgear/props/tiedpropertylist.hxx>
 
 namespace Environment {
 /**
@@ -93,7 +93,7 @@ private:
     SGPropertyNode_ptr _positionLongitudeNode;
 
     deque<double> _elevations;
-    TiedPropertyList _tiedProperties;
+    simgear::TiedPropertyList _tiedProperties;
 };
 
 AreaSampler::AreaSampler( SGPropertyNode_ptr rootNode ) :
@@ -329,7 +329,7 @@ private:
 
     SGPropertyNode_ptr _rootNode;
     bool _enabled;
-    TiedPropertyList _tiedProperties;
+    simgear::TiedPropertyList _tiedProperties;
 };
 
 TerrainSamplerImplementation::TerrainSamplerImplementation( SGPropertyNode_ptr rootNode ) :
diff --git a/src/Environment/tiedpropertylist.hxx b/src/Environment/tiedpropertylist.hxx
deleted file mode 100644 (file)
index cfdd57c..0000000
+++ /dev/null
@@ -1,80 +0,0 @@
-#ifndef __TIEDPROPERTYLIST_HXX
-#define  __TIEDPROPERTYLIST_HXX
-#include <simgear/props/props.hxx>
-using simgear::PropertyList;
-
-// Maybe this goes into SimGear's props.hxx later?
-class TiedPropertyList : PropertyList {
-public:
-    TiedPropertyList() {}
-    TiedPropertyList( SGPropertyNode_ptr root ) : _root(root) {}
-
-    void setRoot( SGPropertyNode_ptr root ) { _root = root; }
-    SGPropertyNode_ptr getRoot() const { return _root; }
-
-    template<typename T> SGPropertyNode_ptr Tie( SGPropertyNode_ptr node, const SGRawValue<T> &rawValue, bool useDefault = true  ) {
-        bool success = node->tie( rawValue, useDefault );
-        if( success ) {
-            SG_LOG( SG_ALL, SG_INFO, "Tied " << node->getPath() );
-            push_back( node );
-        } else {
-#if PROPS_STANDALONE
-            cerr << "Failed to tie property " << node->getPath() << endl;
-#else
-            SG_LOG(SG_GENERAL, SG_WARN, "Failed to tie property " << node->getPath() );
-#endif
-        }
-        return node;
-    }
-
-    template <class V> SGPropertyNode_ptr Tie( SGPropertyNode_ptr node, V * value, bool useDefault = true ) {
-        return Tie( node, SGRawValuePointer<V>(value), useDefault );
-    }
-
-    template <class V> SGPropertyNode_ptr Tie( const char * relative_path, V * value, bool useDefault = true ) {
-        return Tie( _root->getNode(relative_path,true), SGRawValuePointer<V>(value), useDefault );
-    }
-
-    template <class V> SGPropertyNode_ptr Tie( SGPropertyNode_ptr node, V (*getter)(), void (*setter)(V) = 0, bool useDefault = true ) {
-        return Tie(node, SGRawValueFunctions<V>(getter, setter), useDefault );
-    }
-
-    template <class V> SGPropertyNode_ptr Tie( const char * relative_path, V (*getter)(), void (*setter)(V) = 0, bool useDefault = true ) {
-        return Tie(_root->getNode(relative_path, true), SGRawValueFunctions<V>(getter, setter), useDefault );
-    }
-
-    template <class V> SGPropertyNode_ptr Tie( SGPropertyNode_ptr node, int index, V (*getter)(int), void (*setter)(int, V) = 0, bool useDefault = true) {
-        return Tie( node, SGRawValueFunctionsIndexed<V>(index, getter, setter), useDefault );
-    }
-
-    template <class V> SGPropertyNode_ptr Tie( const char * relative_path, int index, V (*getter)(int), void (*setter)(int, V) = 0, bool useDefault = true) {
-        return Tie( _root->getNode( relative_path, true ), SGRawValueFunctionsIndexed<V>(index, getter, setter), useDefault );
-    }
-
-    template <class T, class V> SGPropertyNode_ptr Tie( SGPropertyNode_ptr node, T * obj, V (T::*getter)() const, void (T::*setter)(V) = 0, bool useDefault = true) {
-        return Tie( node, SGRawValueMethods<T,V>(*obj, getter, setter), useDefault );
-    }
-
-    template <class T, class V> SGPropertyNode_ptr Tie( const char * relative_path, T * obj, V (T::*getter)() const, void (T::*setter)(V) = 0, bool useDefault = true) {
-        return Tie( _root->getNode( relative_path, true), SGRawValueMethods<T,V>(*obj, getter, setter), useDefault );
-    }
-
-    template <class T, class V> SGPropertyNode_ptr Tie( SGPropertyNode_ptr node, T * obj, int index, V (T::*getter)(int) const, void (T::*setter)(int, V) = 0, bool useDefault = true) {
-        return Tie( node, SGRawValueMethodsIndexed<T,V>(*obj, index, getter, setter), useDefault);
-    }
-
-    template <class T, class V> SGPropertyNode_ptr Tie( const char * relative_path, T * obj, int index, V (T::*getter)(int) const, void (T::*setter)(int, V) = 0, bool useDefault = true) {
-        return Tie( _root->getNode( relative_path, true ), SGRawValueMethodsIndexed<T,V>(*obj, index, getter, setter), useDefault);
-    }
-
-    void Untie() {
-        while( size() > 0 ) {
-            SG_LOG( SG_ALL, SG_INFO, "untie of " << back()->getPath() );
-            back()->untie();
-            pop_back();
-        }
-    }
-private:
-    SGPropertyNode_ptr _root;
-};
-#endif