diff options
Diffstat (limited to 'experimental/tqtinterface/qt4/src/tools/tqmap.h')
-rw-r--r-- | experimental/tqtinterface/qt4/src/tools/tqmap.h | 60 |
1 files changed, 30 insertions, 30 deletions
diff --git a/experimental/tqtinterface/qt4/src/tools/tqmap.h b/experimental/tqtinterface/qt4/src/tools/tqmap.h index 006f49037..cb280fcc9 100644 --- a/experimental/tqtinterface/qt4/src/tools/tqmap.h +++ b/experimental/tqtinterface/qt4/src/tools/tqmap.h @@ -71,7 +71,7 @@ struct TQ_EXPORT TQMapNodeBase TQMapNodeBase* left; TQMapNodeBase* right; - TQMapNodeBase* tqparent; + TQMapNodeBase* parent; Color color; @@ -183,10 +183,10 @@ TQ_INLINE_TEMPLATES int TQMapIterator<K,T>::inc() while ( tmp->left ) tmp = tmp->left; } else { - TQMapNodeBase* y = tmp->tqparent; + TQMapNodeBase* y = tmp->parent; while (tmp == y->right) { tmp = y; - y = y->tqparent; + y = y->parent; } if (tmp->right != y) tmp = y; @@ -200,7 +200,7 @@ TQ_INLINE_TEMPLATES int TQMapIterator<K,T>::dec() { TQMapNodeBase* tmp = node; if (tmp->color == TQMapNodeBase::Red && - tmp->tqparent->tqparent == tmp ) { + tmp->parent->parent == tmp ) { tmp = tmp->right; } else if (tmp->left != 0) { TQMapNodeBase* y = tmp->left; @@ -208,10 +208,10 @@ TQ_INLINE_TEMPLATES int TQMapIterator<K,T>::dec() y = y->right; tmp = y; } else { - TQMapNodeBase* y = tmp->tqparent; + TQMapNodeBase* y = tmp->parent; while (tmp == y->left) { tmp = y; - y = y->tqparent; + y = y->parent; } tmp = y; } @@ -299,10 +299,10 @@ TQ_INLINE_TEMPLATES int TQMapConstIterator<K,T>::inc() while ( tmp->left ) tmp = tmp->left; } else { - TQMapNodeBase* y = tmp->tqparent; + TQMapNodeBase* y = tmp->parent; while (tmp == y->right) { tmp = y; - y = y->tqparent; + y = y->parent; } if (tmp->right != y) tmp = y; @@ -316,7 +316,7 @@ TQ_INLINE_TEMPLATES int TQMapConstIterator<K,T>::dec() { TQMapNodeBase* tmp = node; if (tmp->color == TQMapNodeBase::Red && - tmp->tqparent->tqparent == tmp ) { + tmp->parent->parent == tmp ) { tmp = tmp->right; } else if (tmp->left != 0) { TQMapNodeBase* y = tmp->left; @@ -324,10 +324,10 @@ TQ_INLINE_TEMPLATES int TQMapConstIterator<K,T>::dec() y = y->right; tmp = y; } else { - TQMapNodeBase* y = tmp->tqparent; + TQMapNodeBase* y = tmp->parent; while (tmp == y->left) { tmp = y; - y = y->tqparent; + y = y->parent; } tmp = y; } @@ -394,7 +394,7 @@ public: ConstIterator find(const Key& k) const; void remove( Iterator it ) { - NodePtr del = (NodePtr) removeAndRebalance( it.node, header->tqparent, header->left, header->right ); + NodePtr del = (NodePtr) removeAndRebalance( it.node, header->parent, header->left, header->right ); delete del; --node_count; } @@ -402,7 +402,7 @@ public: #ifdef TQT_TQMAP_DEBUG void inorder( TQMapNodeBase* x = 0, int level = 0 ){ if ( !x ) - x = header->tqparent; + x = header->parent; if ( x->left ) inorder( x->left, level + 1 ); //cout << level << " Key=" << key(x) << " Value=" << ((NodePtr)x)->data << endl; @@ -414,7 +414,7 @@ public: #if 0 Iterator insertMulti(const Key& v){ TQMapNodeBase* y = header; - TQMapNodeBase* x = header->tqparent; + TQMapNodeBase* x = header->parent; while (x != 0){ y = x; x = ( v < key(x) ) ? x->left : x->right; @@ -443,21 +443,21 @@ template <class Key, class T> TQ_INLINE_TEMPLATES TQMapPrivate<Key,T>::TQMapPrivate() { header = new Node; header->color = TQMapNodeBase::Red; // Mark the header - header->tqparent = 0; + header->parent = 0; header->left = header->right = header; } template <class Key, class T> TQ_INLINE_TEMPLATES TQMapPrivate<Key,T>::TQMapPrivate( const TQMapPrivate< Key, T >* _map ) : TQMapPrivateBase( _map ) { header = new Node; header->color = TQMapNodeBase::Red; // Mark the header - if ( _map->header->tqparent == 0 ) { - header->tqparent = 0; + if ( _map->header->parent == 0 ) { + header->parent = 0; header->left = header->right = header; } else { - header->tqparent = copy( (NodePtr)(_map->header->tqparent) ); - header->tqparent->tqparent = header; - header->left = header->tqparent->minimum(); - header->right = header->tqparent->maximum(); + header->parent = copy( (NodePtr)(_map->header->parent) ); + header->parent->parent = header; + header->left = header->parent->minimum(); + header->right = header->parent->maximum(); } } @@ -470,13 +470,13 @@ TQ_INLINE_TEMPLATES TQ_TYPENAME TQMapPrivate<Key,T>::NodePtr TQMapPrivate<Key,T> n->color = p->color; if ( p->left ) { n->left = copy( (NodePtr)(p->left) ); - n->left->tqparent = n; + n->left->parent = n; } else { n->left = 0; } if ( p->right ) { n->right = copy( (NodePtr)(p->right) ); - n->right->tqparent = n; + n->right->parent = n; } else { n->right = 0; } @@ -486,9 +486,9 @@ TQ_INLINE_TEMPLATES TQ_TYPENAME TQMapPrivate<Key,T>::NodePtr TQMapPrivate<Key,T> template <class Key, class T> TQ_INLINE_TEMPLATES void TQMapPrivate<Key,T>::clear() { - clear( (NodePtr)(header->tqparent) ); + clear( (NodePtr)(header->parent) ); header->color = TQMapNodeBase::Red; - header->tqparent = 0; + header->parent = 0; header->left = header->right = header; node_count = 0; } @@ -508,7 +508,7 @@ template <class Key, class T> TQ_INLINE_TEMPLATES TQ_TYPENAME TQMapPrivate<Key,T>::ConstIterator TQMapPrivate<Key,T>::find(const Key& k) const { TQMapNodeBase* y = header; // Last node - TQMapNodeBase* x = header->tqparent; // Root node. + TQMapNodeBase* x = header->parent; // Root node. while ( x != 0 ) { // If as k <= key(x) go left @@ -532,7 +532,7 @@ TQ_INLINE_TEMPLATES TQ_TYPENAME TQMapPrivate<Key,T>::Iterator TQMapPrivate<Key,T { // Search correct position in the tree TQMapNodeBase* y = header; - TQMapNodeBase* x = header->tqparent; + TQMapNodeBase* x = header->parent; bool result = TRUE; while ( x != 0 ) { result = ( k < key(x) ); @@ -565,7 +565,7 @@ TQ_INLINE_TEMPLATES TQ_TYPENAME TQMapPrivate<Key,T>::Iterator TQMapPrivate<Key,T if (y == header || x != 0 || k < key(y) ) { y->left = z; // also makes leftmost = z when y == header if ( y == header ) { - header->tqparent = z; + header->parent = z; header->right = z; } else if ( y == header->left ) header->left = z; // maintain leftmost pointing to min node @@ -574,10 +574,10 @@ TQ_INLINE_TEMPLATES TQ_TYPENAME TQMapPrivate<Key,T>::Iterator TQMapPrivate<Key,T if ( y == header->right ) header->right = z; // maintain rightmost pointing to max node } - z->tqparent = y; + z->parent = y; z->left = 0; z->right = 0; - rebalance( z, header->tqparent ); + rebalance( z, header->parent ); ++node_count; return Iterator(z); } |