]> git.mxchange.org Git - simgear.git/blobdiff - simgear/props/PropertyBasedMgr.hxx
cppbind: automatic conversion of SGReferenced derived pointers.
[simgear.git] / simgear / props / PropertyBasedMgr.hxx
index bb189bbc31d9623105a542da37dbbe7f81af00ab..e719ca3374d0196793e3d53617049a02497c462d 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_
@@ -39,12 +39,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 +89,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