]> git.mxchange.org Git - flightgear.git/blobdiff - src/FDM/JSBSim/FGPropertyManager.h
Encapsulate the interpolstion version of FGEnvironment and fix some bugs
[flightgear.git] / src / FDM / JSBSim / FGPropertyManager.h
index 06eea8498e7679a16af0015e84ec91d34948bf0e..5e2ee49453abcc92ce99c472cfd255bef8f12740 100644 (file)
@@ -36,7 +36,7 @@ INCLUDES
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
 #include <string>
-#include <simgear/misc/props.hxx>
+#include <simgear/props/props.hxx>
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 DEFINITIONS
@@ -50,20 +50,14 @@ FORWARD DECLARATIONS
 
 using namespace std;
 
-/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-COMMENTS, REFERENCES, and NOTES [use "class documentation" below for API docs]
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+namespace JSBSim {
 
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 CLASS DOCUMENTATION
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
 /** Class wrapper for property handling.
     @author David Megginson, Tony Peden
-    @see <a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/jsbsim/JSBSim/FGPropertyManager.h?rev=HEAD&content-type=text/vnd.viewcvs-markup">
-         Header File </a>
-    @see <a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/jsbsim/JSBSim/FGPropertyManager.cpp?rev=HEAD&content-type=text/vnd.viewcvs-markup">
-         Source File </a>
   */
   
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -111,6 +105,12 @@ class FGPropertyManager : public SGPropertyNode {
      * Get the name of a node
      */
     string GetName( void );
+    
+    /**
+     * Get the fully qualified name of a node
+     * This function is very slow, so is probably useful for debugging only.
+     */
+    string GetFullyQualifiedName(void);
 
     /**
      * Get a bool value for a property.
@@ -374,7 +374,7 @@ class FGPropertyManager : public SGPropertyNode {
     void Untie (const string &name);
 
 
-                                   // Templates cause ambiguity here
+        // Templates cause ambiguity here
 
     /**
      * Tie a property to an external bool variable.
@@ -500,9 +500,11 @@ class FGPropertyManager : public SGPropertyNode {
                                               bool useDefault = true)
     {
       if (!tie(name.c_str(), SGRawValueFunctions<V>(getter, setter),
-                                    useDefault))
+         useDefault))
+      {
         cout <<
-              "Failed to tie property " << name << " to functions" << endl;
+         "Failed to tie property " << name << " to functions" << endl;
+      }
     }
 
 
@@ -529,12 +531,11 @@ class FGPropertyManager : public SGPropertyNode {
            void (*setter)(int, V) = 0, bool useDefault = true)
     {
       if (!tie(name.c_str(),
-                                    SGRawValueFunctionsIndexed<V>(index,
-                                                                  getter,
-                                                                  setter),
-                                    useDefault))
+           SGRawValueFunctionsIndexed<V>(index, getter, setter), useDefault))
+      {
         cout <<
-              "Failed to tie property " << name << " to indexed functions" << endl;
+         "Failed to tie property " << name << " to indexed functions" << endl;
+      }
     }
 
 
@@ -562,10 +563,11 @@ class FGPropertyManager : public SGPropertyNode {
            void (T::*setter)(V) = 0, bool useDefault = true)
     {
       if (!tie(name.c_str(),
-                                SGRawValueMethods<T,V>(*obj, getter, setter),
-                                useDefault))
+             SGRawValueMethods<T,V>(*obj, getter, setter), useDefault))
+      {
         cout <<
-          "Failed to tie property " << name << " to object methods" << endl;
+         "Failed to tie property " << name << " to object methods" << endl;
+      }
     }
     
     /**
@@ -593,15 +595,13 @@ class FGPropertyManager : public SGPropertyNode {
                                               bool useDefault = true)
     {
       if (!tie(name.c_str(),
-                                SGRawValueMethodsIndexed<T,V>(*obj,
-                                                              index,
-                                                              getter,
-                                                              setter),
-                                useDefault))
+          SGRawValueMethodsIndexed<T,V>(*obj, index, getter, setter), useDefault))
+      {
         cout <<
-          "Failed to tie property " << name << " to indexed object methods" << endl;
+         "Failed to tie property " << name << " to indexed object methods" << endl;
+      }
    }
 };                                                                                       
-
+}
 #endif // FGPROPERTYMANAGER_H