From 5cf0267c7bcc89e021c895970f329f585cdf7197 Mon Sep 17 00:00:00 2001 From: nvalimak Date: Fri, 9 Jan 2009 13:13:57 +0000 Subject: [PATCH 1/1] Not needed. git-svn-id: svn+ssh://idea.nguyen.vg/svn/sxsi/trunk/TextCollection@43 3cdefd35-fc62-479d-8e8d-bae585ffb9ca --- handle.h | 134 ------------------------------------------------------- 1 file changed, 134 deletions(-) delete mode 100644 handle.h diff --git a/handle.h b/handle.h deleted file mode 100644 index dbe2fc4..0000000 --- a/handle.h +++ /dev/null @@ -1,134 +0,0 @@ - -/*************************************************************************** - * Copyright (C) 2006 by Wolfgang Gerlach * - * No object matches key 'wgerlach'. * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ - - -#ifndef Handle -#define Handle Handle - -#ifndef uchar -#define uchar unsigned char -#endif -#ifndef ulong -#define ulong unsigned long -#endif - -#include "rbtree.h" -#include "pos.h" - - -class Pos; -class PosNode; - -void callHandleUpdateCounters(RBNode *n, RBTree *T); -void callHandleUpdateCountersOnPathToRoot(RBNode *n, RBTree *T); - - -class HandleNode : public RBNode { - public: - ulong key; //maximum for internal nodes - ulong subtreeSize; - ulong maxkey; - PosNode *posNode; - - HandleNode() - : RBNode(this), key(0), subtreeSize(0), maxkey(0){ - } - - - HandleNode(HandleNode *n, ulong key) - : RBNode(n), key(key), subtreeSize(1), maxkey(key){ - } - - - HandleNode* getParent(){ - return ((HandleNode*) ((RBNode*) this)->parent); - } - - HandleNode* getLeft(){ - return ((HandleNode*) ((RBNode*) this)->left); - } - - HandleNode* getRight(){ - return ((HandleNode*) ((RBNode*) this)->right); - } - - void setParent(HandleNode* n){ - ((RBNode*) this)->parent=(RBNode*)n; - } - - void setLeft(HandleNode* n){ - ((RBNode*) this)->left=(RBNode*)n; - } - - void setRight(HandleNode* n){ - ((RBNode*) this)->right=(RBNode*)n; - } - -}; - -class Handle : public RBTree{ - public: - Pos *pos; - - Handle(){ - setNil(new HandleNode()); - setRoot(getNil()); - } - - - void setRoot(HandleNode* n){ - ((RBTree*) this)->root=(RBNode*)n; - } - - HandleNode* getRoot(){ - return ((HandleNode*) ((RBTree*) this)->root); - } - - void setNil(HandleNode* n){ - ((RBTree*) this)->nil=(RBNode*)n; - } - - HandleNode* getNil(){ - return ((HandleNode*) ((RBTree*) this)->nil); - } - - - ulong getSize(){ - return (getRoot()!=getNil())?getRoot()->subtreeSize:0; - } - - ulong* getKeys(); - - ulong getPos(ulong key); - ulong* getEndPositions(); - - HandleNode* getKey(ulong key); - void deleteKey(ulong key); - void updateCountersOnPathToRoot(HandleNode *n); - void updateCounters(HandleNode *n); - - HandleNode* getNewKey(); - - - -}; - -#endif -- 2.17.1