// 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_
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;
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