projects
/
SXSI
/
XMLTree.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
9775b18
)
Documentation step 1: Properly document counting functions.
author
Kim Nguyễn
<kn@lri.fr>
Mon, 15 Oct 2012 16:40:22 +0000
(18:40 +0200)
committer
Kim Nguyễn
<kn@lri.fr>
Mon, 15 Oct 2012 16:40:22 +0000
(18:40 +0200)
xml-tree.hpp
patch
|
blob
|
history
diff --git
a/xml-tree.hpp
b/xml-tree.hpp
index
436e2f9
..
68e5f36
100644
(file)
--- a/
xml-tree.hpp
+++ b/
xml-tree.hpp
@@
-47,12
+47,50
@@
public:
~xml_tree();
//Counting functions
~xml_tree();
//Counting functions
+ /**
+ * [size()] returns the size of the tree (number of nodes)
+ * Runs in O(1)
+ */
inline uint32_t size() const;
inline uint32_t size() const;
+
+ /**
+ * [num_tags()] returns the number of distinct tags.
+ * Runs in O(1)
+ */
inline uint32_t num_tags() const;
inline uint32_t num_tags() const;
+
+ /**
+ * [subtree_size(n)] returns the size of the subtree (number of nodes)
+ * rooted at n.
+ * Runs in O(1)
+ */
inline uint32_t subtree_size(node_t) const;
inline uint32_t subtree_size(node_t) const;
+
+ /**
+ * [subtree_tags(n, t)] returns the number of occurences of tag [t] in the
+ * subtree rooted at [n]
+ * Runs in O(1)
+ */
inline uint32_t subtree_tags(node_t, tag_t) const;
inline uint32_t subtree_tags(node_t, tag_t) const;
+
+ /**
+ * [subtree_elements(n)] returns the number of element nodes below [n]
+ * Runs in O(attribute_ids->size()+3)
+ */
inline uint32_t subtree_elements(node_t) const;
inline uint32_t subtree_elements(node_t) const;
+
+ /**
+ * [num_children(n)] returns the number of child nodes of [n]
+ * (both text and elements, and including a fake <@> node if
+ * present).
+ * Runs in O(1) (?)
+ */
uint32_t num_children(node_t) const;
uint32_t num_children(node_t) const;
+
+ /**
+ * [child_pos(n)] returns the position of [n] amongst its siblings
+ * Runs in O(1) (?)
+ */
uint32_t child_pos(node_t) const;
uint32_t child_pos(node_t) const;