From 59f2328551f03d7bd60fc55ed3e6b73f3e9798d2 Mon Sep 17 00:00:00 2001 From: ThorstenB Date: Wed, 9 Mar 2011 23:10:55 +0100 Subject: [PATCH] Used tied property list. --- src/Instrumentation/mk_viii.cxx | 11 ----------- src/Instrumentation/mk_viii.hxx | 12 +++++------- 2 files changed, 5 insertions(+), 18 deletions(-) diff --git a/src/Instrumentation/mk_viii.cxx b/src/Instrumentation/mk_viii.cxx index 065dc232d..bafa5b069 100644 --- a/src/Instrumentation/mk_viii.cxx +++ b/src/Instrumentation/mk_viii.cxx @@ -2137,17 +2137,6 @@ MK_VIII::IOHandler::set_present_status (bool value) // FGVoicePlayer ////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////// -void -FGVoicePlayer::PropertiesHandler::unbind () -{ - vector::iterator iter; - - for (iter = tied_properties.begin(); iter != tied_properties.end(); iter++) - (*iter)->untie(); - - tied_properties.clear(); -} - void FGVoicePlayer::Speaker::bind (SGPropertyNode *node) { diff --git a/src/Instrumentation/mk_viii.hxx b/src/Instrumentation/mk_viii.hxx index 053b53d05..3dbd9ce04 100644 --- a/src/Instrumentation/mk_viii.hxx +++ b/src/Instrumentation/mk_viii.hxx @@ -29,9 +29,9 @@ #include #include +#include #include #include - 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 tied_properties; template inline void tie (SGPropertyNode *node, const SGRawValue &raw_value) { - node->tie(raw_value); - tied_properties.push_back(node); + Tie(node,raw_value); } template @@ -115,12 +113,12 @@ public: const char *relative_path, const SGRawValue &raw_value) { - tie(node->getNode(relative_path, true), raw_value); + Tie(node->getNode(relative_path, true),raw_value); } PropertiesHandler() {}; - void unbind (); + void unbind () {Untie();} }; /////////////////////////////////////////////////////////////////////////// -- 2.39.5