Browse Source

fix typo and blank

git-svn-id: svn://bind10.isc.org/svn/bind10/branches/trac397@3522 e5f2f494-b856-4b98-b285-d166d9295462
Jerry 14 years ago
parent
commit
3bcfc34b99
2 changed files with 34 additions and 34 deletions
  1. 7 7
      src/bin/auth/rbt_datasrc.cc
  2. 27 27
      src/bin/auth/rbt_datasrc.h

+ 7 - 7
src/bin/auth/rbt_datasrc.cc

@@ -21,7 +21,7 @@
 using namespace isc::dns;
 using namespace isc::dns;
 namespace {
 namespace {
     /// helper function to remove the base domain from super domain
     /// 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) {
     Name operator-(const Name& super_name, const Name& sub_name) {
         return (super_name.split(0, super_name.getLabelCount() - sub_name.getLabelCount()));
         return (super_name.split(0, super_name.getLabelCount() - sub_name.getLabelCount()));
     }
     }
@@ -50,7 +50,7 @@ RBNode*
 RBNode::successor() {
 RBNode::successor() {
     RBNode* current = this;
     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_) {
     if (right_ != right_->right_) {
         current = right_;
         current = right_;
         while (current->left_ != current->left_->left_)
         while (current->left_ != current->left_->left_)
@@ -58,7 +58,7 @@ RBNode::successor() {
         return (current);
         return (current);
     }
     }
 
 
-    /// otherwise return the parent without left child or 
+    /// otherwise return the parent without left child or
     /// current node isnot its right child
     /// current node isnot its right child
     RBNode* s = current->parent_;
     RBNode* s = current->parent_;
     while (s != s->left_ && current == s->right_) {
     while (s != s->left_ && current == s->right_) {
@@ -169,7 +169,7 @@ RBTree::findHelper(const Name& name, RBTree** tree, RBNode** ret) const {
         }
         }
         else {
         else {
             int common_label_count = compare_result.getCommonLabels();
             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)
             if (common_label_count == 1)
                 node = (compare_result.getOrder() < 0) ? node->left_ : node->right_;
                 node = (compare_result.getOrder() < 0) ? node->left_ : node->right_;
             else if (NameComparisonResult::SUBDOMAIN == relation) {
             else if (NameComparisonResult::SUBDOMAIN == relation) {
@@ -222,7 +222,7 @@ RBTree::insert(const Name& name, RBNode** new_node) {
         if (relation == NameComparisonResult::EQUAL) {
         if (relation == NameComparisonResult::EQUAL) {
             if (new_node)
             if (new_node)
                 *new_node = current;
                 *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);
             return (current->rrsets_.get() ? 1 : 0);
         } else {
         } else {
             int common_label_count = compare_result.getCommonLabels();
             int common_label_count = compare_result.getCommonLabels();
@@ -258,7 +258,7 @@ RBTree::insert(const Name& name, RBNode** new_node) {
                         return (0);
                         return (0);
                     } else {
                     } else {
                         current->is_nonterminal_ = true;
                         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 @@ RBTree::erase(const Name& name) {
     if (findHelper(name, &tree, &node) != RBTree::EXACTMATCH)
     if (findHelper(name, &tree, &node) != RBTree::EXACTMATCH)
         return (1);
         return (1);
 
 
-    /// cann't delete non terminal
+    /// cannot delete non terminal
     if (node->down_ != NULL)
     if (node->down_ != NULL)
         return (1);
         return (1);
 
 

+ 27 - 27
src/bin/auth/rbt_datasrc.h

@@ -26,21 +26,21 @@ using namespace isc::dns;
 namespace isc {
 namespace isc {
 namespace datasrc {
 namespace datasrc {
 
 
-/// \brief rbtree color define
+/// \brief Define rbtree color
 enum RBTreeColor {BLACK = 1, RED};
 enum RBTreeColor {BLACK = 1, RED};
 class RBTree;
 class RBTree;
 
 
-/// \brief \c RBNode class represent one domain name in the domain space
+/// \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
+/// 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
 /// 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
 /// 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{
 class RBNode : public boost::noncopyable{
@@ -56,7 +56,7 @@ class RBNode : public boost::noncopyable{
         bool isDelegate() const { return is_delegate_;}
         bool isDelegate() const { return is_delegate_;}
 
 
         /// \brief return whether current domain name is non-terminal
         /// \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
         /// domain has rrset
         bool isNonterminal() const { return is_nonterminal_;}
         bool isNonterminal() const { return is_nonterminal_;}
 
 
@@ -75,7 +75,7 @@ class RBNode : public boost::noncopyable{
 
 
         /// \brief add the rrset to the node
         /// \brief add the rrset to the node
         /// \Note: there is no check whether the node already has the rrset or not
         /// \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
         /// All of above is rely on interface user
         int addRRset(RRsetPtr rrset);
         int addRRset(RRsetPtr rrset);
         //@}
         //@}
@@ -88,15 +88,15 @@ class RBNode : public boost::noncopyable{
         RBNode(const Name& name, RRsetListPtr rrsets = RRsetListPtr(), RBNode* nullnode = NULL);
         RBNode(const Name& name, RRsetListPtr rrsets = RRsetListPtr(), RBNode* nullnode = NULL);
 
 
         /// the class isn't left to be inherted
         /// the class isn't left to be inherted
-        ~RBNode(); 
+        ~RBNode();
         //@}
         //@}
-        
+
 
 
         /// \brief copy the DNS related date to another node except the sub domain tree
         /// \brief copy the DNS related date to another node except the sub domain tree
         void cloneDNSData(RBNode& node);
         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
         /// 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);
         void setDownTree(RBTree* down);
 
 
         /// data to maintain the rbtree balance
         /// data to maintain the rbtree balance
@@ -113,13 +113,13 @@ class RBNode : public boost::noncopyable{
         bool      is_nonterminal_;
         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
 /// 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
 /// 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{
 class RBTree : public boost::noncopyable{
     friend class RBNode;
     friend class RBNode;
     public:
     public:
@@ -138,19 +138,19 @@ class RBTree : public boost::noncopyable{
 
 
         /// \name Inquery methods
         /// \name Inquery methods
         //@{
         //@{
-        /// \brief find the node with the name 
+        /// \brief find the node with the name
         /// \param name Target to be found
         /// \param name Target to be found
         /// \param node Point to the node when the return vaule is \c not NOTFOUND, if
         /// \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;
         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;
         int getNodeCount() const;
         //@}
         //@}
 
 
         /// \name Debug function
         /// \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?
         /// \todo is it better to return one string instead of print to the stdout?
         void printTree(int depth = 0)const;
         void printTree(int depth = 0)const;
         //@}
         //@}
@@ -159,19 +159,19 @@ class RBTree : public boost::noncopyable{
         //@{
         //@{
         /// \brief insert the domain name into the tree
         /// \brief insert the domain name into the tree
         /// \param name The name want to be inserted 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
         /// 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
         /// 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 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
         /// 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
         /// 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
         /// add rrset into the node is a better way
         int insert(const Name& name, RBNode** inserted_node);
         int insert(const Name& name, RBNode** inserted_node);
 
 
         /// \brief erase the node with the domain name
         /// \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);
         int erase(const Name& name);
         //@}
         //@}
 
 
@@ -186,7 +186,7 @@ class RBTree : public boost::noncopyable{
 
 
         /// \name Helper function
         /// \name Helper function
         //@{
         //@{
-        /// All the public function has related recursive helper function
+        /// Each public function has related recursive helper function
         void eraseNode(RBNode* node);
         void eraseNode(RBNode* node);
         FindResult findHelper(const Name& name, RBTree** tree, RBNode** node)const;
         FindResult findHelper(const Name& name, RBTree** tree, RBNode** node)const;
         int getNodeCountHelper(const RBNode* node) const;
         int getNodeCountHelper(const RBNode* node) const;
@@ -198,7 +198,7 @@ class RBTree : public boost::noncopyable{
         RBNode*  NULLNODE;
         RBNode*  NULLNODE;
         RBNode*  up_;
         RBNode*  up_;
         /// the node count of current tree except the sub domain trees
         /// the node count of current tree except the sub domain trees
-        unsigned int node_count_; 
+        unsigned int node_count_;
 };
 };
 }
 }
 }
 }