]> git.mxchange.org Git - flightgear.git/commitdiff
Used tied property list.
authorThorstenB <brehmt@gmail.com>
Wed, 9 Mar 2011 22:10:55 +0000 (23:10 +0100)
committerThorstenB <brehmt@gmail.com>
Wed, 9 Mar 2011 22:10:55 +0000 (23:10 +0100)
src/Instrumentation/mk_viii.cxx
src/Instrumentation/mk_viii.hxx

index 065dc232ddf40f22d128408f4c77764a84da0989..bafa5b0695043399b1f0e09992b4f1ffa2e3f4e8 100644 (file)
@@ -2137,17 +2137,6 @@ MK_VIII::IOHandler::set_present_status (bool value)
 // FGVoicePlayer //////////////////////////////////////////////////////////////
 ///////////////////////////////////////////////////////////////////////////////
 
-void
-FGVoicePlayer::PropertiesHandler::unbind ()
-{
-  vector<SGPropertyNode_ptr>::iterator iter;
-
-  for (iter = tied_properties.begin(); iter != tied_properties.end(); iter++)
-    (*iter)->untie();
-
-  tied_properties.clear();
-}
-
 void
 FGVoicePlayer::Speaker::bind (SGPropertyNode *node)
 {
index 053b53d051a4016ffdb69e4c1f3b343a572e0642..3dbd9ce04ce91b2a161ed08c8bc38e0fe3bc4015 100644 (file)
@@ -29,9 +29,9 @@
 #include <map>
 
 #include <simgear/props/props.hxx>
+#include <simgear/props/tiedpropertylist.hxx>
 #include <simgear/sound/sample_openal.hxx>
 #include <simgear/structure/subsystem_mgr.hxx>
-
 using std::vector;
 using std::deque;
 using std::map;
@@ -98,16 +98,14 @@ public:
       setter_t    _setter;
     };
     
-    class PropertiesHandler
+    class PropertiesHandler : public simgear::TiedPropertyList
     {
     public:
-        vector<SGPropertyNode_ptr> tied_properties;
 
       template <class T>
       inline void tie (SGPropertyNode *node, const SGRawValue<T> &raw_value)
       {
-        node->tie(raw_value);
-        tied_properties.push_back(node);
+          Tie(node,raw_value);
       }
 
       template <class T>
@@ -115,12 +113,12 @@ public:
                const char *relative_path,
                const SGRawValue<T> &raw_value)
       {
-        tie(node->getNode(relative_path, true), raw_value);
+        Tie(node->getNode(relative_path, true),raw_value);
       }
 
       PropertiesHandler() {};
 
-      void unbind ();
+      void unbind () {Untie();}
     };
 
   ///////////////////////////////////////////////////////////////////////////