[svn] commit: r3614 - /branches/trac397/src/bin/auth/rbt_datasrc.h
BIND 10 source code commits
bind10-changes at lists.isc.org
Tue Nov 23 03:22:05 UTC 2010
Author: hanfeng
Date: Tue Nov 23 03:22:05 2010
New Revision: 3614
Log:
provide mutable and immutable version for find
Modified:
branches/trac397/src/bin/auth/rbt_datasrc.h
Modified: branches/trac397/src/bin/auth/rbt_datasrc.h
==============================================================================
--- branches/trac397/src/bin/auth/rbt_datasrc.h (original)
+++ branches/trac397/src/bin/auth/rbt_datasrc.h Tue Nov 23 03:22:05 2010
@@ -231,6 +231,7 @@
/// NOTFOUND, if the return value is NOTFOUND, the value of node is
/// \c unknown
FindResult find(const Name& name, RBNode<T>** node) const;
+ FindResult find(const Name& name, const RBNode<T>** node) const;
/// \brief Get the total node count in the tree
/// the node count including the node created common suffix node
@@ -364,7 +365,16 @@
return (findHelper(name, &tree, node));
}
-
+template <typename T>
+typename RBTree<T>::FindResult
+RBTree<T>::find(const Name& name, const RBNode<T>** node) const {
+ const RBTree<T> *tree;
+ RBNode<T> *target_node;
+ RBTree<T>::FindResult ret = findHelper(name, &tree, &target_node);
+ if (ret != NOTFOUND)
+ *node = target_node;
+ return ret;
+}
template <typename T>
typename RBTree<T>::FindResult
More information about the bind10-changes
mailing list