]> git.mxchange.org Git - simgear.git/blobdiff - simgear/props/tiedpropertylist.hxx
Fixed a crash: the singleton needs to be instantiated the first time SGCommandMgr...
[simgear.git] / simgear / props / tiedpropertylist.hxx
index 7fb354c4da043bd7a7e4743c0abe32ec0d83008d..39461afd5f836499478f4cd0a8d81cb0b32b3194 100644 (file)
@@ -37,11 +37,11 @@ public:
     virtual ~TiedPropertyList()
     { 
         _root = 0;
-        if (size()>0)
+        if (! empty())
         {
             SG_LOG(SG_GENERAL, SG_ALERT, "Detected properties with dangling ties. Use 'Untie' before removing a TiedPropertyList.");
             // running debug mode: go, fix it!
-            assert(size() == 0);
+            assert(empty());
         }
     }
 
@@ -51,7 +51,7 @@ public:
     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_DEBUG, "Tied " << node->getPath() );
+            SG_LOG( SG_GENERAL, SG_DEBUG, "Tied " << node->getPath() );
             push_back( node );
         } else {
 #if PROPS_STANDALONE
@@ -124,12 +124,18 @@ public:
     }
 
     void Untie() {
-        while( size() > 0 ) {
-            SG_LOG( SG_ALL, SG_DEBUG, "untie of " << back()->getPath() );
+        while( ! empty() ) {
+            SG_LOG( SG_GENERAL, SG_DEBUG, "untie of " << back()->getPath() );
             back()->untie();
             pop_back();
         }
     }
+
+    void setAttribute (SGPropertyNode::Attribute attr, bool state)
+    {
+        for (std::vector<SGPropertyNode_ptr>::iterator it=begin() ; it < end(); it++ )
+           (*it)->setAttribute(attr, state);
+    }
 private:
     SGPropertyNode_ptr _root;
 };