]> git.mxchange.org Git - flightgear.git/blobdiff - src/FDM/JSBSim/FGPropertyManager.h
Updated to match changes in radiostack.[ch]xx
[flightgear.git] / src / FDM / JSBSim / FGPropertyManager.h
index c98011d8a7dcd5e71a8fe9bcb3866bcf8289d65d..95001a307935a950f3399c28fbdcdaa451025326 100644 (file)
@@ -1,23 +1,81 @@
-// FGPropertyManager.h
-// Class wrapper for property handling.
-// based on FlightGear source src/Main/fg_props.hxx 
-// Originally written by David Megginson, started 2000.
-//
-// This file is in the Public Domain, and comes with no warranty.
+/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+ Header:       FGPropertyManager.h
+ Author:       Tony Peden
+               Based on work originally by David Megginson
+ Date:         2/2002
+ ------------- Copyright (C) 2002 -------------
+ This program is free software; you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free Software
+ Foundation; either version 2 of the License, or (at your option) any later
+ version.
+ This program is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+ details.
+ You should have received a copy of the GNU General Public License along with
+ this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+ Place - Suite 330, Boston, MA  02111-1307, USA.
+
+ Further information about the GNU General Public License can also be found on
+ the world wide web at http://www.gnu.org.
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+SENTRY
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
 #ifndef FGPROPERTYMANAGER_H
 #define FGPROPERTYMANAGER_H
 
+/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+INCLUDES
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
+
 #include <simgear/misc/props.hxx>
 
+/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+DEFINITIONS
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
+
+#define ID_PROPERTYMANAGER "$Id$"
+
+/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+FORWARD DECLARATIONS
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
+
 using namespace std;
 
+/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+COMMENTS, REFERENCES, and NOTES [use "class documentation" below for API docs]
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+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>
+  */
+  
+/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+CLASS DECLARATION
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
+
 class FGPropertyManager:public SGPropertyNode {
   public:
+    /// Constructor
     FGPropertyManager(void) {
       
     }
-    
+    /// Destructor
     ~FGPropertyManager(void) {
       
     }   
@@ -57,6 +115,13 @@ class FGPropertyManager:public SGPropertyNode {
       return (GetNode(path, false) != 0);
     }
 
+    /**
+     * Get the name of a node
+     */
+    inline string
+    GetName( void ) {
+      return string( getName() );
+    }  
 
     /**
      * Get a bool value for a property.
@@ -292,7 +357,6 @@ class FGPropertyManager:public SGPropertyNode {
     }
 
 
-    \f
     ////////////////////////////////////////////////////////////////////////
     // Convenience functions for setting property attributes.
     ////////////////////////////////////////////////////////////////////////
@@ -317,7 +381,7 @@ class FGPropertyManager:public SGPropertyNode {
       if (node == 0)
         cout <<
               "Attempt to set archive flag for non-existant property "
-              << name;
+              << name << endl;
       else
         node->setAttribute(SGPropertyNode::ARCHIVE, state);
     }
@@ -342,7 +406,7 @@ class FGPropertyManager:public SGPropertyNode {
       if (node == 0)
         cout <<
               "Attempt to set read flag for non-existant property "
-              << name;
+              << name << endl;
       else
         node->setAttribute(SGPropertyNode::READ, state);
     }
@@ -367,13 +431,12 @@ class FGPropertyManager:public SGPropertyNode {
       if (node == 0)
         cout <<
               "Attempt to set write flag for non-existant property "
-              << name;
+              << name << endl;
       else
         node->setAttribute(SGPropertyNode::WRITE, state);
     }
 
 
-    \f
     ////////////////////////////////////////////////////////////////////////
     // Convenience functions for tying properties, with logging.
     ////////////////////////////////////////////////////////////////////////
@@ -389,7 +452,7 @@ class FGPropertyManager:public SGPropertyNode {
     Untie (const string &name)
     {
       if (!untie(name.c_str()))
-        cout << "Failed to untie property " << name;
+        cout << "Failed to untie property " << name << endl;
     }
 
 
@@ -413,7 +476,7 @@ class FGPropertyManager:public SGPropertyNode {
       if (!tie(name.c_str(), SGRawValuePointer<bool>(pointer),
                                     useDefault))
         cout <<
-              "Failed to tie property " << name << " to a pointer";
+              "Failed to tie property " << name << " to a pointer" << endl;
     }
 
 
@@ -435,7 +498,7 @@ class FGPropertyManager:public SGPropertyNode {
       if (!tie(name.c_str(), SGRawValuePointer<int>(pointer),
                                     useDefault))
         cout <<
-              "Failed to tie property " << name << " to a pointer";
+              "Failed to tie property " << name << " to a pointer" << endl;
     }
 
 
@@ -457,7 +520,7 @@ class FGPropertyManager:public SGPropertyNode {
       if (!tie(name.c_str(), SGRawValuePointer<long>(pointer),
                                     useDefault))
         cout <<
-              "Failed to tie property " << name << " to a pointer";
+              "Failed to tie property " << name << " to a pointer" << endl;
     }
 
 
@@ -479,7 +542,7 @@ class FGPropertyManager:public SGPropertyNode {
       if (!tie(name.c_str(), SGRawValuePointer<float>(pointer),
                                     useDefault))
         cout <<
-              "Failed to tie property " << name << " to a pointer";
+              "Failed to tie property " << name << " to a pointer" << endl;
     }
 
 
@@ -501,23 +564,23 @@ class FGPropertyManager:public SGPropertyNode {
       if (!tie(name.c_str(), SGRawValuePointer<double>(pointer),
                                     useDefault))
         cout <<
-              "Failed to tie property " << name << " to a pointer";
+              "Failed to tie property " << name << " to a pointer" << endl;
     }
 
     /* template <class V> void
-    FGPropertyManager::Tie (const string &name, V (*getter)(), void (*setter)(V) = 0,
+    Tie (const string &name, V (*getter)(), void (*setter)(V) = 0,
            bool useDefault = true);
     
     template <class V> void
-    FGPropertyManager::Tie (const string &name, int index, V (*getter)(int),
+    Tie (const string &name, int index, V (*getter)(int),
            void (*setter)(int, V) = 0, bool useDefault = true);
     
     template <class T, class V> void
-    FGPropertyManager::Tie (const string &name, T * obj, V (T::*getter)() const,
+    Tie (const string &name, T * obj, V (T::*getter)() const,
            void (T::*setter)(V) = 0, bool useDefault = true);
 
     template <class T, class V> void 
-    FGPropertyManager::Tie (const string &name, T * obj, int index,
+    Tie (const string &name, T * obj, int index,
            V (T::*getter)(int) const, void (T::*setter)(int, V) = 0,
            bool useDefault = true); */
 
@@ -539,13 +602,13 @@ class FGPropertyManager:public SGPropertyNode {
      */
     template <class V>
     inline void
-    FGPropertyManager::Tie (const string &name, V (*getter)(), void (*setter)(V) = 0,
+    Tie (const string &name, V (*getter)(), void (*setter)(V) = 0,
            bool useDefault = true)
     {
       if (!tie(name.c_str(), SGRawValueFunctions<V>(getter, setter),
                                     useDefault))
         cout <<
-              "Failed to tie property " << name << " to functions";
+              "Failed to tie property " << name << " to functions" << endl;
     }
 
 
@@ -569,7 +632,7 @@ class FGPropertyManager:public SGPropertyNode {
      */
     template <class V>
     inline void
-    FGPropertyManager::Tie (const string &name, int index, V (*getter)(int),
+    Tie (const string &name, int index, V (*getter)(int),
            void (*setter)(int, V) = 0, bool useDefault = true)
     {
       if (!tie(name.c_str(),
@@ -578,7 +641,7 @@ class FGPropertyManager:public SGPropertyNode {
                                                                   setter),
                                     useDefault))
         cout <<
-              "Failed to tie property " << name << " to indexed functions";
+              "Failed to tie property " << name << " to indexed functions" << endl;
     }
 
 
@@ -603,14 +666,14 @@ class FGPropertyManager:public SGPropertyNode {
      */
     template <class T, class V>
     inline void
-    FGPropertyManager::Tie (const string &name, T * obj, V (T::*getter)() const,
+    Tie (const string &name, T * obj, V (T::*getter)() const,
            void (T::*setter)(V) = 0, bool useDefault = true)
     {
       if (!tie(name.c_str(),
                                     SGRawValueMethods<T,V>(*obj, getter, setter),
                                     useDefault))
         cout <<
-              "Failed to tie property " << name << " to object methods";
+              "Failed to tie property " << name << " to object methods" << endl;
     }
 
 
@@ -635,7 +698,7 @@ class FGPropertyManager:public SGPropertyNode {
      */
     template <class T, class V>
     inline void 
-    FGPropertyManager::Tie (const string &name, T * obj, int index,
+    Tie (const string &name, T * obj, int index,
            V (T::*getter)(int) const, void (T::*setter)(int, V) = 0,
            bool useDefault = true)
     {
@@ -646,11 +709,10 @@ class FGPropertyManager:public SGPropertyNode {
                                                                   setter),
                                     useDefault))
         cout <<
-              "Failed to tie property " << name << " to indexed object methods";
+              "Failed to tie property " << name << " to indexed object methods" << endl;
     }
 
 };        
 
-
 #endif // FGPROPERTYMANAGER_H