]> git.mxchange.org Git - simgear.git/blobdiff - simgear/props/PropertyBasedMgr.hxx
Update doxgen config and some comments.
[simgear.git] / simgear / props / PropertyBasedMgr.hxx
index bb189bbc31d9623105a542da37dbbe7f81af00ab..15205038db55be77cda63529f77ad27e769b450a 100644 (file)
@@ -12,9 +12,9 @@
 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 // Library 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., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+// You should have received a copy of the GNU Library General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301, USA
 
 #ifndef SG_PROPERTY_BASED_MGR_HXX_
 #define SG_PROPERTY_BASED_MGR_HXX_
@@ -22,7 +22,6 @@
 #include "PropertyBasedElement.hxx"
 #include <simgear/structure/subsystem_mgr.hxx>
 
-#include <boost/shared_ptr.hpp>
 #include <boost/function.hpp>
 #include <vector>
 
@@ -39,12 +38,26 @@ namespace simgear
 
       virtual void update (double delta_time_sec);
 
-      virtual void childAdded( SGPropertyNode * parent,
-                               SGPropertyNode * child );
-      virtual void childRemoved( SGPropertyNode * parent,
-                                 SGPropertyNode * child );
+      /**
+       * Create a new PropertyBasedElement
+       *
+       * @param name    Name of the new element
+       */
+      PropertyBasedElementPtr createElement(const std::string& name = "");
 
-      virtual void elementCreated(PropertyBasedElementPtr element) {}
+      /**
+       * Get an existing PropertyBasedElement by its index
+       *
+       * @param index   Index of element node in property tree
+       */
+      PropertyBasedElementPtr getElement(size_t index) const;
+
+      /**
+       * Get an existing PropertyBasedElement by its name
+       *
+       * @param name    Name (value of child node "name" will be matched)
+       */
+      PropertyBasedElementPtr getElement(const std::string& name) const;
 
       virtual const SGPropertyNode* getPropertyRoot() const;
 
@@ -75,6 +88,13 @@ namespace simgear
                         ElementFactory element_factory );
       virtual ~PropertyBasedMgr() = 0;
 
+      virtual void childAdded( SGPropertyNode * parent,
+                               SGPropertyNode * child );
+      virtual void childRemoved( SGPropertyNode * parent,
+                                 SGPropertyNode * child );
+
+      virtual void elementCreated(PropertyBasedElementPtr element) {}
+
   };
 
 } // namespace simgear