[svn] commit: r3522 - in /branches/trac397/src/bin/auth: rbt_datasrc.cc rbt_datasrc.h
BIND 10 source code commits
bind10-changes at lists.isc.org
Mon Nov 15 02:15:46 UTC 2010
Author: chenzhengzhang
Date: Mon Nov 15 02:15:46 2010
New Revision: 3522
Log:
fix typo and blank
Modified:
branches/trac397/src/bin/auth/rbt_datasrc.cc
branches/trac397/src/bin/auth/rbt_datasrc.h
Modified: branches/trac397/src/bin/auth/rbt_datasrc.cc
==============================================================================
--- branches/trac397/src/bin/auth/rbt_datasrc.cc (original)
+++ branches/trac397/src/bin/auth/rbt_datasrc.cc Mon Nov 15 02:15:46 2010
@@ -21,7 +21,7 @@
using namespace isc::dns;
namespace {
/// helper function to remove the base domain from super domain
- /// the precondition of this function is thant super_name contains sub_name
+ /// the precondition of this function is the super_name contains the sub_name
Name operator-(const Name& super_name, const Name& sub_name) {
return (super_name.split(0, super_name.getLabelCount() - sub_name.getLabelCount()));
}
@@ -50,7 +50,7 @@
RBNode::successor() {
RBNode* current = this;
- /// if has right node, the successor is the most left node
+ /// if has right node, the successor is the left-most node
if (right_ != right_->right_) {
current = right_;
while (current->left_ != current->left_->left_)
@@ -58,7 +58,7 @@
return (current);
}
- /// otherwise return the parent without left child or
+ /// otherwise return the parent without left child or
/// current node isnot its right child
RBNode* s = current->parent_;
while (s != s->left_ && current == s->right_) {
@@ -169,7 +169,7 @@
}
else {
int common_label_count = compare_result.getCommonLabels();
- ///common label count equal one means, there is no common between two names
+ /// common label count equal one means, there is no common between two names
if (common_label_count == 1)
node = (compare_result.getOrder() < 0) ? node->left_ : node->right_;
else if (NameComparisonResult::SUBDOMAIN == relation) {
@@ -222,7 +222,7 @@
if (relation == NameComparisonResult::EQUAL) {
if (new_node)
*new_node = current;
- /// if the node is non-ternimal, it doesn't exist, so we return 0
+ /// if the node is non-ternimal, it doesnot exist, so we return 0
return (current->rrsets_.get() ? 1 : 0);
} else {
int common_label_count = compare_result.getCommonLabels();
@@ -258,7 +258,7 @@
return (0);
} else {
current->is_nonterminal_ = true;
- return (current->down_->insert(name - common_ancestor, new_node));
+ return (current->down_->insert(name - common_ancestor, new_node));
}
}
}
@@ -389,7 +389,7 @@
if (findHelper(name, &tree, &node) != RBTree::EXACTMATCH)
return (1);
- /// cann't delete non terminal
+ /// cannot delete non terminal
if (node->down_ != NULL)
return (1);
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 Mon Nov 15 02:15:46 2010
@@ -26,21 +26,21 @@
namespace isc {
namespace datasrc {
-/// \brief rbtree color define
+/// \brief Define rbtree color
enum RBTreeColor {BLACK = 1, RED};
class RBTree;
-/// \brief \c RBNode class represent one domain name in the domain space
-
-/// It has two roles, the first one is as one node in the \c RBTree the second one
+/// \brief \c RBNode class represents one domain name in the domain space
+
+/// It has two roles, the first one is as one node in the \c RBTree, the second one
/// is store the data related to DNS. As for the first role, it has left, right, parent and color memebers
-/// which used to keey the balance of the \c RBTree. As for the second role,
-// it stores the rrsets belongs to the domain name and a rbtree which includes all the subdomains of this node
-/// the name stored in the node is relative related to its parent node.
+/// which used to keep the balance of the \c RBTree. As for the second role,
+// it stores the rrsets belong to the domain name and a rbtree which includes all the subdomains of this node
+/// the name stored in the node is relative related to its parent node.
/// One special kind of node is non-terminal node
-/// which has subdomains with rrset but it self doesn't has any rrset
+/// which has subdomains with rrset but it self doesn't have any rrsets
///
-/// \b Note: \c RBNode should create or destroied only by \c RBTree so constructor and destructor function aren't exposed
+/// \b Note: \c RBNode should be created or destroyed only by \c RBTree so constructor and destructor function aren't exposed
class RBNode : public boost::noncopyable{
@@ -56,7 +56,7 @@
bool isDelegate() const { return is_delegate_;}
/// \brief return whether current domain name is non-terminal
- /// A non-terminal domain has no rrsets but at least one its descendant
+ /// A non-terminal domain has no rrsets but at least one of its descendant
/// domain has rrset
bool isNonterminal() const { return is_nonterminal_;}
@@ -75,7 +75,7 @@
/// \brief add the rrset to the node
/// \Note: there is no check whether the node already has the rrset or not
- /// and no check about whether the name of the rrset is same with the node or not
+ /// and no check about whether the name of the rrset is the same with the node or not
/// All of above is rely on interface user
int addRRset(RRsetPtr rrset);
//@}
@@ -88,15 +88,15 @@
RBNode(const Name& name, RRsetListPtr rrsets = RRsetListPtr(), RBNode* nullnode = NULL);
/// the class isn't left to be inherted
- ~RBNode();
- //@}
-
+ ~RBNode();
+ //@}
+
/// \brief copy the DNS related date to another node except the sub domain tree
void cloneDNSData(RBNode& node);
- /// \brief when copy the DNS data from one node to another, except the rrsets, name etc,
+ /// \brief when copy the DNS data from one node to another, except the rrsets, name etc,
/// also needs to maintain the down and up relationship, which includes set the down point of current
- /// node and up point of sub domain tree
+ /// node and up point of sub domain tree
void setDownTree(RBTree* down);
/// data to maintain the rbtree balance
@@ -113,13 +113,13 @@
bool is_nonterminal_;
};
-/// \brief \c RBTree class represent all the domains with same suffix, so it can be used to store
+/// \brief \c RBTree class represents all the domains with the same suffix, so it can be used to store
/// the domains in one zone
///
-/// \c RBTree is a generic red black tree, and contains all the node with same suffix, since each
+/// \c RBTree is a generic red black tree, and contains all the nodes with the same suffix, since each
/// name may have sub domain names so \c RBTree is a recursive data struct or tree in tree
-/// So for one zone, severl RBTrees are involved. But from outside, the sub tree is
-/// opaque for end user.
+/// So for one zone, several RBTrees are involved. But from outside, the sub tree is
+/// opaque for end users.
class RBTree : public boost::noncopyable{
friend class RBNode;
public:
@@ -138,19 +138,19 @@
/// \name Inquery methods
//@{
- /// \brief find the node with the name
+ /// \brief find the node with the name
/// \param name Target to be found
/// \param node Point to the node when the return vaule is \c not NOTFOUND, if
- /// if the return value is NOTFOUND, the value of node is \c unknown
+ /// the return value is NOTFOUND, the value of node is \c unknown
FindResult find(const Name& name, RBNode** node)const;
- /// \brief Get all the node count in the tree
+ /// \brief Get the total node count in the tree
int getNodeCount() const;
//@}
/// \name Debug function
//@{
- /// \brief print the node in the trees
+ /// \brief print the nodes in the trees
/// \todo is it better to return one string instead of print to the stdout?
void printTree(int depth = 0)const;
//@}
@@ -159,19 +159,19 @@
//@{
/// \brief insert the domain name into the tree
/// \param name The name want to be inserted into the tree
- /// \param inserted_node If no node with the name in the tree,
+ /// \param inserted_node If no node with the name in the tree,
/// new \c RBNode will be created, otherwise nothing will be done
/// anyway the pointer point to the node with the name will be assign to inserted_node
/// \return return 0 means no node exists in the tree with the name before insert
/// return 1 means already has the node with the given name
//
/// If want to add rrset into one node, but not sure whether the node already exist
- /// Instead of call \c find, call \c insert and then call the RBNode interface to
+ /// Instead of call \c find, call \c insert and then call the RBNode interface to
/// add rrset into the node is a better way
int insert(const Name& name, RBNode** inserted_node);
/// \brief erase the node with the domain name
- /// \return If no node with the name, return one otherwise return zero
+ /// \return If no node with the name, return 1 otherwise return 0
int erase(const Name& name);
//@}
@@ -186,7 +186,7 @@
/// \name Helper function
//@{
- /// All the public function has related recursive helper function
+ /// Each public function has related recursive helper function
void eraseNode(RBNode* node);
FindResult findHelper(const Name& name, RBTree** tree, RBNode** node)const;
int getNodeCountHelper(const RBNode* node) const;
@@ -198,7 +198,7 @@
RBNode* NULLNODE;
RBNode* up_;
/// the node count of current tree except the sub domain trees
- unsigned int node_count_;
+ unsigned int node_count_;
};
}
}
More information about the bind10-changes
mailing list