diff options
Diffstat (limited to 'ACE/ace/RB_Tree.inl')
-rw-r--r-- | ACE/ace/RB_Tree.inl | 38 |
1 files changed, 2 insertions, 36 deletions
diff --git a/ACE/ace/RB_Tree.inl b/ACE/ace/RB_Tree.inl index 4e31894eb4d..1f9d1bdf420 100644 --- a/ACE/ace/RB_Tree.inl +++ b/ACE/ace/RB_Tree.inl @@ -10,7 +10,6 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL ///////////////////////////////////////////////////// // Key accessor. - template <class EXT_ID, class INT_ID> ACE_INLINE EXT_ID & ACE_RB_Tree_Node<EXT_ID, INT_ID>::key () @@ -19,9 +18,7 @@ ACE_RB_Tree_Node<EXT_ID, INT_ID>::key () return k_; } - // Item accessor. - template <class EXT_ID, class INT_ID> ACE_INLINE INT_ID & ACE_RB_Tree_Node<EXT_ID, INT_ID>::item () @@ -30,9 +27,7 @@ ACE_RB_Tree_Node<EXT_ID, INT_ID>::item () return t_; } - // Set color of the node. - template <class EXT_ID, class INT_ID> ACE_INLINE void ACE_RB_Tree_Node<EXT_ID, INT_ID>::color (ACE_RB_Tree_Node_Base::RB_Tree_Node_Color c) @@ -41,9 +36,7 @@ ACE_RB_Tree_Node<EXT_ID, INT_ID>::color (ACE_RB_Tree_Node_Base::RB_Tree_Node_Col color_ = c; } - // Get color of the node. - template <class EXT_ID, class INT_ID> ACE_INLINE ACE_RB_Tree_Node_Base::RB_Tree_Node_Color ACE_RB_Tree_Node<EXT_ID, INT_ID>::color () @@ -52,9 +45,7 @@ ACE_RB_Tree_Node<EXT_ID, INT_ID>::color () return color_; } - // Accessor for node's parent pointer. - template <class EXT_ID, class INT_ID> ACE_INLINE ACE_RB_Tree_Node<EXT_ID, INT_ID> * ACE_RB_Tree_Node<EXT_ID, INT_ID>::parent () @@ -63,9 +54,7 @@ ACE_RB_Tree_Node<EXT_ID, INT_ID>::parent () return parent_; } - // Mutator for node's parent pointer. - template <class EXT_ID, class INT_ID> ACE_INLINE void ACE_RB_Tree_Node<EXT_ID, INT_ID>::parent (ACE_RB_Tree_Node<EXT_ID, INT_ID> * p) @@ -74,10 +63,7 @@ ACE_RB_Tree_Node<EXT_ID, INT_ID>::parent (ACE_RB_Tree_Node<EXT_ID, INT_ID> * p) parent_ = p; } - - // Accessor for node's left child pointer. - template <class EXT_ID, class INT_ID> ACE_INLINE ACE_RB_Tree_Node<EXT_ID, INT_ID> * ACE_RB_Tree_Node<EXT_ID, INT_ID>::left () @@ -86,9 +72,7 @@ ACE_RB_Tree_Node<EXT_ID, INT_ID>::left () return left_; } - // Mutator for node's left child pointer. - template <class EXT_ID, class INT_ID> ACE_INLINE void ACE_RB_Tree_Node<EXT_ID, INT_ID>::left (ACE_RB_Tree_Node<EXT_ID, INT_ID> * l) @@ -97,9 +81,7 @@ ACE_RB_Tree_Node<EXT_ID, INT_ID>::left (ACE_RB_Tree_Node<EXT_ID, INT_ID> * l) left_ = l; } - // Accessor for node's right child pointer. - template <class EXT_ID, class INT_ID> ACE_INLINE ACE_RB_Tree_Node<EXT_ID, INT_ID> * ACE_RB_Tree_Node<EXT_ID, INT_ID>::right () @@ -108,9 +90,7 @@ ACE_RB_Tree_Node<EXT_ID, INT_ID>::right () return right_; } - // Mutator for node's right child pointer. - template <class EXT_ID, class INT_ID> ACE_INLINE void ACE_RB_Tree_Node<EXT_ID, INT_ID>::right (ACE_RB_Tree_Node<EXT_ID, INT_ID> * r) @@ -119,7 +99,6 @@ ACE_RB_Tree_Node<EXT_ID, INT_ID>::right (ACE_RB_Tree_Node<EXT_ID, INT_ID> * r) right_ = r; } - //////////////////////////////////////////////////////////////////////// // template class ACE_RB_Tree<EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK> // //////////////////////////////////////////////////////////////////////// @@ -151,7 +130,6 @@ ACE_RB_Tree<EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK>::open (ACE_Allocator *alloc) // Close down an RB_Tree and release dynamically allocated // resources. - template <class EXT_ID, class INT_ID, class COMPARE_KEYS, class ACE_LOCK> ACE_INLINE int ACE_RB_Tree<EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK>::close () @@ -162,12 +140,10 @@ ACE_RB_Tree<EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK>::close () return this->close_i (); } - // Associate <ext_id> with <int_id>. If <ext_id> is already in the // tree then the <ACE_RB_Tree_Node> is not changed. Returns 0 if a // new entry is bound successfully, returns 1 if an attempt is made // to bind an existing entry, and returns -1 if failures occur. - template <class EXT_ID, class INT_ID, class COMPARE_KEYS, class ACE_LOCK> ACE_INLINE int ACE_RB_Tree<EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK>::bind (const EXT_ID &ext_id, @@ -180,11 +156,9 @@ ACE_RB_Tree<EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK>::bind (const EXT_ID &ext_id, return this->insert_i (ext_id, int_id, entry); } - // Same as a normal bind, except the tree entry is also passed back // to the caller. The entry in this case will either be the newly // created entry, or the existing one. - template <class EXT_ID, class INT_ID, class COMPARE_KEYS, class ACE_LOCK> ACE_INLINE int ACE_RB_Tree<EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK>::bind (const EXT_ID &ext_id, @@ -197,13 +171,11 @@ ACE_RB_Tree<EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK>::bind (const EXT_ID &ext_id, return this->insert_i (ext_id, int_id, entry); } - // Associate <ext_id> with <int_id> if and only if <ext_id> is not // in the tree. If <ext_id> is already in the tree then the <int_id> // parameter is assigned the existing value in the tree. Returns 0 // if a new entry is bound successfully, returns 1 if an attempt is // made to bind an existing entry, and returns -1 if failures occur. - template <class EXT_ID, class INT_ID, class COMPARE_KEYS, class ACE_LOCK> ACE_INLINE int ACE_RB_Tree<EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK>::trybind (const EXT_ID &ext_id, @@ -223,11 +195,9 @@ ACE_RB_Tree<EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK>::trybind (const EXT_ID &ext_ return result; } - // Same as a normal trybind, except the tree entry is also passed // back to the caller. The entry in this case will either be the // newly created entry, or the existing one. - template <class EXT_ID, class INT_ID, class COMPARE_KEYS, class ACE_LOCK> ACE_INLINE int ACE_RB_Tree<EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK>::trybind (const EXT_ID &ext_id, @@ -237,7 +207,7 @@ ACE_RB_Tree<EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK>::trybind (const EXT_ID &ext_ ACE_TRACE ("ACE_RB_Tree::trybind (const EXT_ID &ext_id, INT_ID &int_id, ACE_RB_Tree_Node<EXT_ID, INT_ID> *&entry)"); ACE_WRITE_GUARD_RETURN (ACE_LOCK, ace_mon, this->lock_, -1); - int result = this->insert_i (ext_id, int_id, entry); + int const result = this->insert_i (ext_id, int_id, entry); if (result == 1) { @@ -248,7 +218,6 @@ ACE_RB_Tree<EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK>::trybind (const EXT_ID &ext_ return result; } - // Reassociate <ext_id> with <int_id>. If <ext_id> is not in the // tree then behaves just like <bind>. Returns 0 if a new entry is // bound successfully, returns 1 if an existing entry was rebound, @@ -274,11 +243,9 @@ ACE_RB_Tree<EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK>::rebind (const EXT_ID &ext_i return result; } - // Same as a normal rebind, except the tree entry is also passed back // to the caller. The entry in this case will either be the newly // created entry, or the existing one. - template <class EXT_ID, class INT_ID, class COMPARE_KEYS, class ACE_LOCK> ACE_INLINE int ACE_RB_Tree<EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK>::rebind (const EXT_ID &ext_id, @@ -288,7 +255,7 @@ ACE_RB_Tree<EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK>::rebind (const EXT_ID &ext_i ACE_TRACE ("ACE_RB_Tree::rebind (const EXT_ID &ext_id, const INT_ID &int_id, ACE_RB_Tree_Node<EXT_ID, INT_ID> *&entry)"); ACE_WRITE_GUARD_RETURN (ACE_LOCK, ace_mon, this->lock_, -1); - int result = this->insert_i (ext_id, int_id, entry); + int const result = this->insert_i (ext_id, int_id, entry); if (result == 1) { @@ -299,7 +266,6 @@ ACE_RB_Tree<EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK>::rebind (const EXT_ID &ext_i return result; } - // Associate <ext_id> with <int_id>. If <ext_id> is not in the tree // then behaves just like <bind>. Otherwise, store the old value of // <int_id> into the "out" parameter and rebind the new parameters. |