cpp, meta, C++


/* Module      ut/btree                           Btree.ic

   *****************************************************************************

   Authors     GRT

*/

#include for_spu.h
// Use ourIns() to insert any data w of type T:

#define ourIns( h,k,w,T )    StrIns( h, k, &w, sizeof(T), t_data )
// z.B.      rein:   tree.ourIns( 'i', k, store.take(xx), char* )
//           raus:                  *( char** )st.c

#define L_Btree_heap     4086    // such that sizeof( Btree_page )

#define Surr    int4

#define pageNr  int4

struct  Btree_descr


{ Btree_descr :: Btree_descr(); pageNr last ; // last page in file uint2 next ; // next free page Surr surr ; // last surrogate created uint2 anz ; // entries in the tree uint2 maxkeylen ; // int l_index ; // These constants are charaterize int l_data ; // the storage layout in the file - int l_page ; // check them in order to ensure that int h_descr ; // the compiler agrees to them. };

struct  Btree_page


{ Btree_page :: Btree_page(); // if ( t ) // then sequence of Btree_index // else sequence of Btree_data char c[ L_Btree_heap ] ; // storage (an erster Stelle !!) pageNr nr ; // number of page int2 dirty ; // new version not yet on disk int2 e ; // number of index or data nodes int2 h ; // heap = c[ h .. ] int2 t ; // t = 1 : this is an index page // t = 0 : this is a data page } // Rightmost in the heap is always c[ eoheap ] = spare. // Before this is k0 - the first key in the data page (a // key not in the tree from a user's point of view if and // only if different from k1). // Between k1 and k0 is the common prefix of all keys in // the page: spare = uchar( c[ eoheap ] ) bytes long. // // A key containing L bytes is stored as a sequence k of // chars such that k[0] = L - spare, and k[ 1 .. L- spare ] // the key's value without the common prefix.

struct  Btree_index


{ Btree_index :: Btree_index(); uint2 ak ; // key = Btree_page.c[ ak .. ] // = ( len, value ) pageNr son ; // son page.nr( to the keys <= key ) } // Choose the keys in index pages as small as possible: // They need not be elements of the tree in the user's view.

struct  Btree_data


{ Btree_data :: Btree_data(); uint2 ak ; // key = Btree_page.c[ ak .. ] // = ( len, value ) // uint2 ad ; // data = Btree_page.c[ ad .. ] // = ( len, type, value ) // Surr surr ; // surrogate = son.key[0..1], but // surr == 0 for dummies };

struct  Btree_pos


{ Btree_pos :: Btree_pos(); int m ; // see locate() int r ; // see locate() uchar epf ; // common[ 0 .. epf [ is a common // prefix of all keys in this page }; #define KVStore store_256

struct  store_256


{ store_256 :: store_256(); Surr at ; // surrogate of key uchar L ; // length of data ( only if <= 252 ) uchar t ; // type of data char c[ 1024 ] ; // data char k[ 256 ] ; // key (last part of it) uchar k_L ; // and its length uint c_L ; // length of LData in c } #define t_undef 0 // #define t_keep 1 // for 'e' = ensure only #define t_data 2 // #define t_file 3 // #define t_pointer 4 // #define t_LData 5 // pointer to LData // t_keep means: If in Tree, do not update its Data. If not in // Tree: insert it. // und letzter Aufruf war GetFirst oder Next // und letzter Aufruf war GetFirst oder Next

C++ . ALL . top . meta    

class Btree


: public EStandardServices /* _____________________________________________________________________________ R e u s e . f o r . ALL Btree utilities for extremely fast access to elements ( key, data ) in also larger sets of such pairs (Test done so far covered set up to 60.000 elements with keys of length up to 250). _ Purpose: To implement B-trees with nested transaction control (which is n o t yet present !!! ). INDEX node[ k0 k1 k2 ... | | | | | son[ k1 ... k2 [ ( = oben son of k1 ) | son[ k0 ... k1 [ ( = oben son of k0 ) k0 of the root is the key of length 0 (= "" ). spare = node.c[ eoheap ] = k0.surr is the length of a common prefix X of all keys in the node. This prefix is NOT stored with the keys - it is stored separately as node.c[ eoheap-spare .. eoheap ] Node trace will always show the keys including theis common prefix though this prefix is actually stored only once (more precisely: It is stored as described in trac1_node() - i.e. for DATA nodes following the first key, which is NOT an element if the tree: we may have k0 = k1). Both the prefix as well as Y may be empty. Because the last key in the left brother node must be smaller than XY, Y cannot always be empty. The first key in a DATA node - and therefore any key in an INDEX node - need not necessarily be an element of the Btree. cache[0] = page[0] = pointer to cached root page. Outside the cache no storage for pages to be allocated !!! No prefix (spare) extraced in Index Pages !!! Man beachte: page.nr und auch son Variables must be of type pageNr !!!!!! Die Methoden ''GetNext() und ''GetPrev() arbeiten nur so lange auf rein applikationslogischer Ebene, bis zum ersten Mal - eine der Methoden ''InsPath() aufgerufen wurde - oder mittels ''Ins() ein Key in den Btree geschrieben wurde, der aus mehr als 252 Zeichen besteht. Trat n„mlich eines dieser Ereignisse ein, so enth„lt der Btree Hilfs- knoten !!... bzw. !?..., die die applikationslogische Sicht nicht kennt. _____________________________________________________________________________ */ { public: char * BtreeName ; #undef BB #undef BBStr #undef bb #undef bbStr #define BB #define BBStr( x,y,z ) ; #define bb #define bbStr( x,y,z ) ; #ifndef procNestOn #undef BB #undef BBStr #undef bb #undef bbStr #undef LB_ #undef LE_ #undef LE_ret #undef ret #undef ret_ #undef __ #undef ___ #define BB if ( 1 < call_nr || errno ) #define bb if ( 1 < call_nr || errno ) #define BBStr( x,y,z ) { BB traceStr( x,y,z ); } #define bbStr( x,y,z ) { bb traceStr( x,y,z ); } #define __ { bb { printf( "\nLine %i", __LINE__ ); } } #define ___ #define ret_ { __ return ; } #define LE_ __ return ; } #define LE_ret( x ) __ return( x ); #define ret( x ) { __ return( x ); } #define LB_( x ) { bb printf( "\n-> %s", x ); safe_ut.showSysCalls = 1 ; #endif BOOL noTrace ; // set noTrace = false around error BOOL silent ; // do not show exists: ... BOOL alles ; // to tailor trace BOOL kurz ; // for faster GetNext BOOL ourtree ; // BOOL strPairs ; // true zum Test von Class StrPairs int treeID ; // wird durch die Anwendung gesetzt Surr do_at ; // Current root of !/ paths int errno_if_get_fails ; int max_k_L ; // wird nur in Ins() abgeprft, kann // also durch die Anwendung dynamisch // neu definiert werden Surr LastSurr() { return( descr -> surr ); } protected: BOOL stopTrace ; // BOOL errTrace ; // BOOL traceIndex ; // uint anzfalsch ; // uint traceAb ; // uint LocNr ; // to count locate() calls uint LDataNr ; uint kuerzer ; int maxDepth ; int2 root_e ; // for robustness Btree_page * pp ; // for debug Btree * LData ; // for debug private: // # define L_Bp 40 #define L_Bp 140 // # define L_Cp 1000 // wenigstens 3 * L_Bp (400 ein guter Wert) #define L_Cp 500 // wenigstens 3 * L_Bp (400 ein guter Wert) // # define L_Cp 120 // wenigstens 3 * L_Bp (400 ein guter Wert) #ifdef MANY_Btrees #define L_Bp 40 #define L_Cp 400 // wenigstens 3 * L_Bp (400 ein guter Wert) // # define L_Cp 800 // wenigstens 3 * L_Bp (400 ein guter Wert) // # define L_Cp 2800 // wenigstens 3 * L_Bp (400 ein guter Wert) // # define L_Cp 800 // wenigstens 3 * L_Bp (400 ein guter Wert) #endif

struct  Prefix


{ Prefix :: Prefix(); uchar a ; // length of data uchar e ; // type of data char c[ 256 ] ; // data } ; Prefix common ; // Btree_descr * descr ; // nur im Konstruktor gesetzt !! Btree_page * extra[ L_Bp * 3 ]; Btree_page * cache[ L_Cp ]; Btree_page * page [ L_Bp + 1 ]; // current path into Btree Btree_pos pos_m[ L_Bp ]; int cpos [ L_Bp ]; // see new_page() char s260 [ 2600 ]; // long accessNo ; // name of the Btree file path Bfn ; // name of the Btree file BOOL Volatile ; // if true, destroy after use BOOL read_only ; // Btree is open for reading int pos_descr ; // in root Btree_page int Bf ; // the open Btree file int at_surr ; // of last Ins() or Get() int deepest ; // int e_cache ; // cache = [ 0 .. e_cache [ int e_extra ; // extra = [ 0 .. e_extra [ int eoheap ; // end of heap = eoheap KVStore AL ; // Alias // exported methods: public: Btree :: Btree( /* ----------------------------------------------------------------------------- create Btree in memory ----------------------------------------------------------------------------- */ ) ; public: Btree :: Btree /* ----------------------------------------------------------------------------- Create or open Btree file and cache page[ 0 ] Deconstructor is to delete the tree on disk iff do_what < 0. ----------------------------------------------------------------------------- */ ( char * at , int do_what // 0 = create tree in memory // -1 or 1 = create or re-create // -2 or 2 = create // -3 or 3 = open for reading // -4 or 4 = open for update // -5 or 5 = create or open for update ) ; public: ~Btree( // ----------------------------------------------------------------------------- ) ; public: void Btree :: init /* ----------------------------------------------------------------------------- open Btree file and cache page[ 0 ] ----------------------------------------------------------------------------- */ ( char * at , int do_what // 0 = create tree in memory // 1 //create or re-create // 2 //create // 3 //open for reading // 4 //open for update // 5 //create or open for update ) ; public: void Btree :: show /* ----------------------------------------------------------------------------- trace Btree in a black box view ----------------------------------------------------------------------------- */ ( char * name , FILE * f // soll geschrieben werden nach ) ; public: void Btree :: traceAbs( char * name /* ----------------------------------------------------------------------------- Show on stdout all elements ( key, value ) in the Btree ----------------------------------------------------------------------------- */ ) ; public: void Btree :: traceAbs /* ----------------------------------------------------------------------------- Show all elements ( key, value ) in the Btree ----------------------------------------------------------------------------- */ ( char * name , FILE * f // soll geschrieben werden nach ) ; public: void Btree :: traceAt /* ----------------------------------------------------------------------------- Show all elements ( key, value ) in the Btree such that At( key, pre ) ----------------------------------------------------------------------------- */ ( char * name , char * pre // prefix, FILE * f // soll geschrieben werden nach ) ; public: void Btree :: trace_index ( FILE * f // ----------------------------------------------------------------------------- ) ; public: void Btree :: trace_data ( Btree_page & p // ----------------------------------------------------------------------------- ) ; public: void Btree :: trace_deepest ( // ----------------------------------------------------------------------------- ) ; public: void Btree :: trace_deepest ( FILE * f // ----------------------------------------------------------------------------- ) ; public: void Btree :: trace // ----------------------------------------------------------------------------- ( char * name , FILE * f // soll geschrieben werden nach ) ; public: char Btree :: StrIns /* ----------------------------------------------------------------------------- Der Aufrufer sagt: Ins( do_this, k, strlen( k ), d, n2, t ) ----------------------------------------------------------------------------- */ ( char * k ) ; public: char Btree :: StrIns /* ----------------------------------------------------------------------------- Der Aufrufer sagt: Ins( do_this, k, strlen( k ), d, n2, t ) ----------------------------------------------------------------------------- */ ( char do_this , char * k // key ) ; public: char Btree :: Update // ----------------------------------------------------------------------------- ( store_256 & st ) ; public: char Btree :: StrIns // ----------------------------------------------------------------------------- ( char do_this , int k // key, char * d // t_data that is a string ) ; public: char Btree :: StrIns // ----------------------------------------------------------------------------- ( char do_this , char * k // key, char * d // t_data that is a string ) ; public: char Btree :: StrIns /* ----------------------------------------------------------------------------- Der Aufrufer sagt: Ins( do_this, k, strlen( k ), d, n2, t ) ----------------------------------------------------------------------------- */ ( char do_this , char * k // key, void * d // data, int n2 // number of bytes in data, uchar t // type of data ) ; public: char Btree :: StrIns /* ----------------------------------------------------------------------------- = Ins( do_this, k, strlen( k )+1, d, strlen( d ), t ) ----------------------------------------------------------------------------- */ ( char do_this , char * k // key, void * d // data, uchar t // type of data ) ; public: char Btree :: InsAtSurr /* ----------------------------------------------------------------------------- Der Aufrufer sagt: f a l s c h !!!!! Wie Ins( 'u', k, k_L, d, d_L, t ), wo die Zielstelle k nun aber per Surrogat genannt ist. Die Funktion garantiert: fErr || ok || return 'n' && EN_not_found: You gave ( do_this == 'u' ), but the key is not in the tree. ----------------------------------------------------------------------------- */ ( Surr k , char * d // data, int d_L // number of bytes in data, uchar t // type of data ) ; public: Surr Btree :: ensure // ----------------------------------------------------------------------------- ( void * k // key, int k_L // number of bytes in key ) ; public: char Btree :: InsPath /* ----------------------------------------------------------------------------- Ein ''path in diesem Sinn hat die Form /n1/n2/... , wobei jeder der Namen n1, n2, ... auch leer sein darf (aber keine NULL ent- halten darf). ----------------------------------------------------------------------------- */ ( char do_this , char * k // key, char * d // data, int d_L // number of bytes in data, uchar t // type of data, Surr k_father // path ''k is to start from this father ) ; public: char Btree :: InsPath /* ----------------------------------------------------------------------------- Write into Btree (i.e. insert, update, or ensure) Here 'ensure' means 'update if entry exists, else insert'. Return 'i' or 'u' characterizing the action taken Die Funktion garantiert: fErr || ok || return 'n' && EN_exists: You gave ( do_this == 'i' ), but the key cannot be inserted because it is already in the tree. EN_not_found: You gave ( do_this == 'u' ), but the key is not in the tree. ----------------------------------------------------------------------------- */ ( char do_this , char * k // key, int k_L // number of bytes in key, char * d // data, int d_L // number of bytes in data, uchar t // type of data, Surr k_father // path ''k is to start from this father ) ; public: uint Btree :: Ins /* ----------------------------------------------------------------------------- Add Btree 'also to this Btree ----------------------------------------------------------------------------- */ ( Btree & also , char do_this // i, e, u, ? ) ; public: char Btree :: Ins /* ----------------------------------------------------------------------------- Write into Btree (i.e. insert, update, or ensure) Here 'ensure' means 'update if entry exists, else insert'. Return 'i' or 'u' characterizing the action taken Die Funktion garantiert: fErr || ok || return 'n' && EN_exists: You gave ( do_this == 'i' ), but the key cannot be inserted because it is already in the tree. EN_not_found: You gave ( do_this == 'u' ), but the key is not in the tree. ----------------------------------------------------------------------------- */ ( char do_this , char * k // key, char * d // data, int d_L // number of bytes in data, uchar t // type of data ) ; public: char Btree :: Ins /* ----------------------------------------------------------------------------- Write into Btree (i.e. insert, update, or ensure) Here 'ensure' means 'update if entry exists, else insert'. Return 'i' or 'u' characterizing the action taken Die Funktion garantiert: fErr || ok || return 'n' && EN_exists: You gave ( do_this == 'i' ), but the key cannot be inserted because it is already in the tree. EN_not_found: You gave ( do_this == 'u' ), but the key is not in the tree. ----------------------------------------------------------------------------- */ ( char do_this , char * k // key, int k_L // number of bytes in key, char * d // data, int d_L // number of bytes in data, uchar t // type of data ) ; public: uint Btree :: anz_pages( /* ----------------------------------------------------------------------------- return current number of pages ----------------------------------------------------------------------------- */ ) ; public: BOOL Btree :: cache_ok ( // ----------------------------------------------------------------------------- ) ; public: char * Btree :: retAlias ( char * nam // ----------------------------------------------------------------------------- ) ; public: Surr Btree :: retNr /* ----------------------------------------------------------------------------- ordnet jedem String eine unique Number zu ----------------------------------------------------------------------------- */ ( BOOL existiert , char * str ) ; public: Btree * Btree :: invers ( /* ----------------------------------------------------------------------------- Mache alle Paare ( st.k, st.c ) zu Paaren ( st.c, st.k ) ----------------------------------------------------------------------------- */ ) ; public: void Btree :: become_end_to_end_transitive ( Btree * invers /* ----------------------------------------------------------------------------- Create the transitive closure of a binary relation ~ given by records str1~str2 in this tree Then delete all pairs y~z for which there is a pair x~y. ----------------------------------------------------------------------------- */ ) ; public: void Btree :: check_Btree /* ----------------------------------------------------------------------------- needed for j2h.ic ----------------------------------------------------------------------------- */ ( uint Line , char * File ) ; public: uint Btree :: become_transitive ( /* ----------------------------------------------------------------------------- Create the transitive closure of a binary relation ~ given by records str1~str2 in this tree ----------------------------------------------------------------------------- */ ) ; public: uint Btree :: become_deep_transitive ( /* ----------------------------------------------------------------------------- Create the transitive closure of a binary relation ~ given by records str1~str2 in this tree Record also the depth of the transitive closure ----------------------------------------------------------------------------- */ ) ; public: void Btree :: count ( char * k // ----------------------------------------------------------------------------- ) ; public: void Btree :: to_file ( char * fn /* ----------------------------------------------------------------------------- write Btree to file in form of lines \n~Key~Value~ Btree_ut :: to_tree() can recash the tree. ----------------------------------------------------------------------------- */ ) ; public: void Btree :: commit( /* ----------------------------------------------------------------------------- write all changes to disk ----------------------------------------------------------------------------- */ ) ; public: Surr Btree :: GetPath // ----------------------------------------------------------------------------- ( char * k , store_256 & d // data, Surr k_father // starting point of path ''k ) ; public: Surr Btree :: GetPath /* ----------------------------------------------------------------------------- Read into 'd the data assigned to the key 'k by the Btree and assure d.c[ d.L ] == 0 . Return BOOL( key in tree ) ----------------------------------------------------------------------------- */ ( char * k , int k_L // number of bytes in key, store_256 & d // data, Surr k_father // starting point of path ''k ) ; public: Surr Btree :: Get // ----------------------------------------------------------------------------- ( int k // key, store_256 & d // data ) ; public: Surr Btree :: Get // ----------------------------------------------------------------------------- ( char * k , store_256 & d // data ) ; public: Surr Btree :: Get /* ----------------------------------------------------------------------------- Read into 'd the data assigned to the key 'k by the Btree and assure d.c[ d.L ] == 0 . Return BOOL( key in tree ) ----------------------------------------------------------------------------- */ ( char * k , int k_L // number of bytes in key, store_256 & d // data ) ; public: Surr Btree :: GetFirst /* ----------------------------------------------------------------------------- Return 0 if the Btree is empty, else return the surrogate of the smallest key ''k in this tree and describe in ''e the located pair ( key, data ). Assure e.c[ d.L ] == 0 . ----------------------------------------------------------------------------- */ ( store_256 & e ) ; public: Surr Btree :: GetLast /* ----------------------------------------------------------------------------- Return 0 if the Btree is empty, else return the surrogate of the highest key ''k in this tree and describe in ''e the located pair ( key, data ). Assure d.c[ d.L ] == 0 . ----------------------------------------------------------------------------- */ ( store_256 & e ) ; public: Surr Btree :: GetNext /* ----------------------------------------------------------------------------- This requires 'e to exist in the Btree - if 'e might not exist, use Getmin_GE() instead of GetNext(). Return the surrogate ''s of the successor of key ''e.k in this tree, and describe in ''e this successor and the associated data. Return 0 if there is no successor. Assure d.c[ d.L ] == 0 . ----------------------------------------------------------------------------- */ ( store_256 & e ) ; public: int Btree :: number_of_elements ( /* ----------------------------------------------------------------------------- Return number of elements in the tree ----------------------------------------------------------------------------- */ ) ; public: Surr Btree :: Next /* ----------------------------------------------------------------------------- This requires 'e to exist in the Btree - if 'e might not exist, use Getmin_GE() instead of GetNext(). Return the surrogate ''s of the successor of key ''e.k in this tree, and describe in ''e this successor and the associated data. Return 0 if there is no successor. Assure d.c[ d.L ] == 0 . ----------------------------------------------------------------------------- */ ( store_256 & e ) ; public: Surr Btree :: GetNext /* ----------------------------------------------------------------------------- This requires 'e to exist in the Btree - if 'e might not exist, use Getmin_GE() instead of GetNext(). Return the surrogate ''s of the successor of key ''k in this tree, and describe in ''e this successor and the associated data. Return 0 if there is no successor. Assure d.c[ d.L ] == 0 . ----------------------------------------------------------------------------- */ ( store_256 & e , char * k ) ; public: Surr Btree :: GetNext /* ----------------------------------------------------------------------------- This requires 'e to exist in the Btree - if 'e might not exist, use Getmin_GE() instead of GetNext(). Return the surrogate ''s of the successor of key ''k in this tree, and describe in ''e this successor and the associated data. Return 0 if there is no successor. Assure d.c[ d.L ] == 0 . ----------------------------------------------------------------------------- */ ( store_256 & e , char * k , int kL ) ; public: Surr Btree :: GetPrev /* ----------------------------------------------------------------------------- This requires 'e to exist in the Btree - if 'e might not exist, use Getmax_LE() instead of GetPrev(). Return the surrogate ''s of the predeccessor of key ''e.k in this tree, and describe in ''e this predeccessor and the associated data. Return 0 if there is no successor. Assure d.c[ d.L ] == 0 . ----------------------------------------------------------------------------- */ ( store_256 & e ) ; public: Surr Btree :: Prev /* ----------------------------------------------------------------------------- This requires 'e to exist in the Btree - if 'e might not exist, use Getmax_LE() instead of GetPrev(). Return the surrogate ''s of the predeccessor of key ''e.k in this tree, and describe in ''e this predeccessor and the associated data. Return 0 if there is no successor. Assure d.c[ d.L ] == 0 . ----------------------------------------------------------------------------- */ ( store_256 & e ) ; public: Surr Btree :: GetPrev /* ----------------------------------------------------------------------------- This requires 'e to exist in the Btree - if 'e might not exist, use Getmax_LE() instead of GetPrev(). Return the surrogate ''s of the predeccessor of key ''k in this tree, and describe in ''e this predeccessor and the associated data. Return 0 if there is no successor. Assure d.c[ d.L ] == 0 . ----------------------------------------------------------------------------- */ ( store_256 & e , char * k ) ; public: Surr Btree :: GetPrev /* ----------------------------------------------------------------------------- This requires 'e to exist in the Btree - if 'e might not exist, use Getmax_LE() instead of GetPrev(). Return the surrogate ''s of the predeccessor of key ''k in this tree, and describe in ''e this predeccessor and the associated data. Return 0 if there is no successor. Assure d.c[ d.L ] == 0 . ----------------------------------------------------------------------------- */ ( store_256 & e , char * k , int kL ) ; public: Surr Btree :: Getmax_prefix /* ----------------------------------------------------------------------------- Return the surrogate ''s of the largest key in this tree that is a prefix of the given key k. Return 0 if there is no such element, otherwise copy it to ''e. Assure e.c[ e.L ] == 0 . ----------------------------------------------------------------------------- */ ( store_256 & e , char * k ) ; public: Surr Btree :: Getmax_LE /* ----------------------------------------------------------------------------- Return the surrogate ''s of the largest key in this tree that is LESS or EQUAL the given key. Return 0 if there is no such element, otherwise copy it to ''e. Assure e.c[ e.L ] == 0 . ----------------------------------------------------------------------------- */ ( store_256 & e , char * k ) ; public: Surr Btree :: Getmax_LE /* ----------------------------------------------------------------------------- Return the surrogate ''s of the largest key in this tree that is LESS or EQUAL the given key. Return 0 if there is no such element, otherwise copy it to ''e. Assure e.c[ e.L ] == 0 . ----------------------------------------------------------------------------- */ ( store_256 & e , char * k , int kL ) ; public: Surr Btree :: Getmax_LS /* ----------------------------------------------------------------------------- Return the surrogate ''s of the largest key in this tree that is LESS than the given key. Return 0 if there is no such element, otherwise copy it to ''e. Assure e.c[ e.L ] == 0 . ----------------------------------------------------------------------------- */ ( store_256 & e , char * k , int kL ) ; public: Surr Btree :: Getmax_LS /* ----------------------------------------------------------------------------- Return the surrogate ''s of the smallest key in this tree that is LESS than the given key. Return 0 if there is no such element, otherwise copy it to ''e. Assure e.c[ e.L ] == 0 . ----------------------------------------------------------------------------- */ ( store_256 & e , char * k ) ; public: Surr Btree :: Getmin_At /* ----------------------------------------------------------------------------- Return the surrogate ''s of the smallest key in this tree that has k for a prefix. Return 0 if there is no such element, otherwise copy it to ''e. ----------------------------------------------------------------------------- */ ( store_256 & e , char * k ) ; public: Surr Btree :: Getmax_At /* ----------------------------------------------------------------------------- Return the surrogate ''s of the largest key in this tree that has k for a prefix. Return 0 if there is no such element, otherwise copy it to ''e. ----------------------------------------------------------------------------- */ ( store_256 & e , char * k ) ; public: Surr Btree :: Getmin_GE /* ----------------------------------------------------------------------------- Return the surrogate ''s of the smallest key in this tree that is GREATER or EQUAL the given key. Return 0 if there is no such element, otherwise copy it to ''e. Assure e.c[ e.L ] == 0 . ----------------------------------------------------------------------------- */ ( store_256 & e , char * k ) ; public: Surr Btree :: Getmin_GE /* ----------------------------------------------------------------------------- Return the surrogate ''s of the smallest key in this tree that is GREATER or EQUAL the given key. Return 0 if there is no such element, otherwise copy it to ''e. Assure e.c[ e.L ] == 0 . ----------------------------------------------------------------------------- */ ( store_256 & e , char * k , int kL ) ; public: Surr Btree :: Getmin_GR /* ----------------------------------------------------------------------------- Return the surrogate ''s of the smallest key in this tree that is GREATER than the given key. Return 0 if there is no such element, otherwise copy it to ''e. Assure e.c[ e.L ] == 0 . ----------------------------------------------------------------------------- */ ( store_256 & e , char * k ) ; public: Surr Btree :: Getmin_GR /* ----------------------------------------------------------------------------- Return the surrogate ''s of the smallest key in this tree that is GREATER than the given key. Return 0 if there is no such element, otherwise copy it to ''e. Assure e.c[ e.L ] == 0 . ----------------------------------------------------------------------------- */ ( store_256 & e , char * k , int kL ) ; public: Surr Btree :: contains( char * k // ----------------------------------------------------------------------------- ) ; public: Surr Btree :: contains ( KVStore & st // ----------------------------------------------------------------------------- ) ; public: Surr Btree :: contains /* ----------------------------------------------------------------------------- Return Surrogate of key ''k as an element in the BTree (or 0 if this key is n o t in the Tree). ----------------------------------------------------------------------------- */ ( char * k , int k_L ) ; public: Surr Btree :: containsPath // ----------------------------------------------------------------------------- ( char * k , Surr k_father // starting point of path ''k ) ; public: Surr Btree :: containsPath /* ----------------------------------------------------------------------------- Return Surrogate of Path ''k as an element in the BTree (or 0 if this path is n o t in the Tree). ----------------------------------------------------------------------------- */ ( char * k , int k_L , Surr k_father // starting point of path ''k ) ; public: Surr Btree :: RemPath // ----------------------------------------------------------------------------- ( char * k , Surr k_father ) ; public: Surr Btree :: RemPath /* ----------------------------------------------------------------------------- Der Aufrufer sagt: Delete entry k from the tree. Die Funktion garantiert: fErr || ok && return Surrogate of entry ----------------------------------------------------------------------------- */ ( char * k , int k_L // number of bytes in key, Surr k_father // starting point of path ''k ) ; public: int Btree :: Rem_GE_LE /* ----------------------------------------------------------------------------- Delete all keys k satisfying u <= k <= o , Return number of deleted items. ----------------------------------------------------------------------------- */ ( char * u , char * o ) ; public: Surr Btree :: Rem ( int n // ----------------------------------------------------------------------------- ) ; public: Surr Btree :: Rem ( char * k // ----------------------------------------------------------------------------- ) ; public: Surr Btree :: Rem ( KVStore & st // ----------------------------------------------------------------------------- ) ; public: Surr Btree :: postfix // ----------------------------------------------------------------------------- // augment the key's value by the given postfix // ----------------------------------------------------------------------------- ( char * k , char * postfix ) ; public: Surr Btree :: Rem /* ----------------------------------------------------------------------------- Der Aufrufer sagt: Delete entry k from the tree. Die Funktion garantiert: fErr || ok && return Surrogate of entry ----------------------------------------------------------------------------- */ ( char * k , int k_L // number of bytes in key ) ; #include btree.h3 : cpp } ; #endif
top . is_inc_for . C++
Include-structure of
todir / btree.h

.   for_spu.h
.   .   for_all.h
.   .   .   exec_ut.h
.   .   .   .   exec_ut.h3
.   .   .   .   macros_1.h
.   .   .   .   traceco.h
.   .   .   precomp.h
.   .   .   .   basis.h
.   .   .   .   .   compiler.h
.   .   .   .   .   dmlerr.h
.   .   .   .   en.h
.   .   .   .   .   en_lec.h
.   .   .   .   limits.h
.   .   .   .   mt.h
.   .   .   .   obsolete.h
.   .   .   .   ot.h
.   .   .   .   st.h
.   .   .   .   trace.h
.   .   .   standard.h
.   .   .   toscreen.h
.   .   spu.h
.   .   .   help_gen.h
.   .   .   .   help_gen.h3
.   .   .   rbuffer.h
.   .   .   .   rbuffer.h3
.   .   .   .   str_set.h
.   .   .   .   .   str_set.h3
.   .   .   safe_uts.h
.   .   .   .   safe_uts.h3
.   .   .   ut_repl.h
.   btree.h3

31 include files
top . is_inc_for . C++