+
+/**
+ * Utility function for creation of a child property node.
+ */
+inline SGPropertyNode* makeChild(SGPropertyNode* parent, const char* name,
+ int index = 0)
+{
+ return parent->getChild(name, index, true);
+}
+
+/**
+ * Utility function for creation of a child property node using a
+ * relative path.
+ */
+namespace simgear
+{
+template<typename StringType>
+inline SGPropertyNode* makeNode(SGPropertyNode* parent, const StringType& name)
+{
+ return parent->getNode(name, true);
+}
+}
+
+// For boost::hash
+size_t hash_value(const SGPropertyNode& node);
+
+// Helper comparison and hash functions for common cases
+
+namespace simgear
+{
+namespace props
+{
+struct Compare
+{
+ bool operator()(const SGPropertyNode* lhs, const SGPropertyNode* rhs) const
+ {
+ return SGPropertyNode::compare(*lhs, *rhs);
+ }
+ bool operator()(SGPropertyNode_ptr lhs, const SGPropertyNode* rhs) const
+ {
+ return SGPropertyNode::compare(*lhs, *rhs);
+ }
+ bool operator()(const SGPropertyNode* lhs, SGPropertyNode_ptr rhs) const
+ {
+ return SGPropertyNode::compare(*lhs, *rhs);
+ }
+ bool operator()(SGPropertyNode_ptr lhs, SGPropertyNode_ptr rhs) const
+ {
+ return SGPropertyNode::compare(*lhs, *rhs);
+ }
+};
+
+struct Hash
+{
+ size_t operator()(const SGPropertyNode* node) const
+ {
+ return hash_value(*node);
+ }
+ size_t operator()(SGPropertyNode_ptr node) const
+ {
+ return hash_value(*node);
+ }
+};
+}
+}