15namespace layer2_discreta {
20#define WRITE_INFO_ONLY_AT_END
22#define MAX_ROOT_BUF 20
55 int f_v = (verbose_level >= 1);
56 int f_vv = (verbose_level >= 2);
60 cout <<
"database_init()" << endl;
67 cout <<
"database_init() sizeof(ItemTyp)=" <<
sizeof(
ItemTyp) << endl;
68 cout <<
"database_init() sizeof(PageTyp)=" <<
sizeof(
PageTyp) << endl;
69 cout <<
"database_init() sizeof(Buffer)=" <<
sizeof(
Buffer) << endl;
70 cout <<
"database_init() sizeof(int_4)=" <<
sizeof(
int_4) << endl;
75 cout <<
"database_init() no memory for RootBF" << endl;
94 cout <<
"database_init() done" << endl;
100 int verbose_level = 0;
117 cout <<
"fstream_table_get_free_entry() table full, "
118 "too many open files" << endl;
134 cout <<
"root_buf_alloc() no free root buffer" << endl;
141 cout <<
"root_buf_free()|i illegal" << endl;
161 cout <<
"btree::copy constructor for object: "
169 cout <<
"btree::operator = (copy assignment)" << endl;
203 cout <<
"btree::copyobject_to()\n";
204 print_as_vector(cout);
216 ost <<
"BTREE: Root = " <<
Root() <<
" FreeRec = " <<
FreeRec()
217 <<
" AllocRec = " <<
AllocRec() << endl;
277 int f_v = (verbose_level >= 1);
278 int f_vv = (verbose_level >= 2);
282 cout <<
"btree::create" << endl;
285 cout <<
"btree::create() already open" << endl;
303 cout <<
"before page_table_alloc" << endl;
313 int f_v = (verbose_level >= 1);
314 int f_vv = (verbose_level >= 2);
318 cout <<
"btree::open verbose_level=" << verbose_level << endl;
321 cout <<
"btree::open() already open" << endl;
333 cout <<
"before page_table_alloc" << endl;
345 cout <<
"reading root page " <<
Root() << endl;
358 int f_v = (verbose_level >= 1);
361 cout <<
"btree::close" << endl;
379#ifdef WRITE_INFO_ONLY_AT_END
390 int f_v = (verbose_level >= 1);
391 int f_vv = (verbose_level >= 2);
394 cout <<
"btree::ReadInfo" << endl;
398 cout <<
"reading page 0" << endl;
410 cout <<
"FreeRec()" <<
FreeRec() << endl;
411 cout <<
"AllocRec()" <<
AllocRec() << endl;
412 cout <<
"Root()" <<
Root() << endl;
422 int f_v = (verbose_level >= 1);
423 int f_vv = (verbose_level >= 2);
428 cout <<
"btree::WriteInfo" << endl;
431 cout <<
"btree::WriteInfo() file not open" << endl;
441 cout <<
"btree::WriteInfo writing page 0" << endl;
442 cout <<
"FreeRec()" <<
FreeRec() << endl;
443 cout <<
"AllocRec()" <<
AllocRec() << endl;
444 cout <<
"Root()" <<
Root() << endl;
456 int f_v = (verbose_level >= 1);
457 int f_vv = (verbose_level >= 2);
462 cout <<
"btree::AllocateRec" << endl;
465 cout <<
"btree::AllocateRec() not open\n";
470#ifdef WRITE_INFO_ONLY_AT_END
485 cout <<
"btree::AllocateRec FreeRec() > 0 not yet implemented" << endl;
492 FreeRec() = BF->Page.NextFreeRec;
493#ifdef WRITE_INFO_ONLY_AT_END
499 cout <<
"btree::AllocateRec() x = " << x << endl;
514 cout <<
"btree::ReleaseRec() not open\n";
517 size = (int)
sizeof(
Buffer);
523#ifdef WRITE_INFO_ONLY_AT_END
528 cout <<
"btree::ReleaseRec not yet implemented" << endl;
540 int f_v = (verbose_level >= 1);
545 cout <<
"btree::LoadPage x=" << x << endl;
548 cout <<
"btree::LoadPage() not open" << endl;
564 cout <<
"btree::LoadPage loading page " << x <<
" from file" << endl;
573 cout <<
"saving page " << x <<
" to page tables" << endl;
590 int f_v = (verbose_level >= 1);
593 cout <<
"btree::SavePage" << endl;
596 cout <<
"btree::SavePage() not open" << endl;
623 char *p_key = the_key.
c;
628 cout <<
"btree::search_string() bt_key not of type string" << endl;
634 return search(&the_key, NULL, &pos, 1, verbose_level);
638 int& first,
int &len,
int verbose_level)
640 int f_v = (verbose_level >= 1);
642 char *p_key_min = key_min.
c;
643 char *p_key_max = key_max.
c;
645 I_min.
m_i(i_min - 1);
647 int idx_min, idx_max;
648 int f_found_min, f_found_max;
653 cout <<
"search_interval_int4 I_min=" << I_min <<
" I_max=" << I_max << endl;
656 f_found_min =
search(&key_min, NULL, &idx_min, 1, verbose_level);
657 f_found_max =
search(&key_max, NULL, &idx_max, 1, verbose_level);
659 cout <<
"search_interval_int4 f_found_min=" << f_found_min <<
" idx_min=" << idx_min << endl;
660 cout <<
"search_interval_int4 f_found_max=" << f_found_max <<
" idx_max=" << idx_max << endl;
663 len = idx_max - idx_min;
667 int l1,
int u1,
int& first,
int &len,
int verbose_level)
669 int f_v = (verbose_level >= 1);
672 cout <<
"btree::search_interval_int4_int4 low=(" << l0 <<
"," << l1 <<
") high=(" << u0 <<
"," << u1 <<
")" << endl;
675 char *p_key_min = key_min.
c;
676 char *p_key_max = key_max.
c;
678 int idx_min, idx_max;
679 int f_found_min, f_found_max;
692 f_found_min =
search(&key_min, NULL, &idx_min, 2, verbose_level);
693 f_found_max =
search(&key_max, NULL, &idx_max, 2, verbose_level);
695 cout <<
"search_interval_int4_int4() f_found_min=" << f_found_min <<
" idx_min=" << idx_min << endl;
696 cout <<
"search_interval_int4_int4() f_found_max=" << f_found_max <<
" idx_max=" << idx_max << endl;
699 len = idx_max - idx_min;
703 int l1,
int u1,
int l2,
int u2,
704 int& first,
int &len,
int verbose_level)
706 int f_v = (verbose_level >= 1);
708 char *p_key_min = key_min.
c;
709 char *p_key_max = key_max.
c;
711 int idx_min, idx_max;
712 int f_found_min, f_found_max;
730 f_found_min =
search(&key_min, NULL, &idx_min, 3, verbose_level);
731 f_found_max =
search(&key_max, NULL, &idx_max, 3, verbose_level);
733 cout <<
"search_interval_int4_int4_int4() f_found_min=" << f_found_min <<
" idx_min=" << idx_min << endl;
734 cout <<
"search_interval_int4_int4_int4() f_found_max=" << f_found_max <<
" idx_max=" << idx_max << endl;
737 len = idx_max - idx_min;
741 int l1,
int u1,
int l2,
int u2,
742 int l3,
int u3,
int& first,
int &len,
int verbose_level)
744 int f_v = (verbose_level >= 1);
746 char *p_key_min = key_min.
c;
747 char *p_key_max = key_max.
c;
749 int idx_min, idx_max;
750 int f_found_min, f_found_max;
773 f_found_min =
search(&key_min, NULL, &idx_min, 4, verbose_level);
774 f_found_max =
search(&key_max, NULL, &idx_max, 4, verbose_level);
776 cout <<
"search_interval_int4_int4_int4_int4() f_found_min=" << f_found_min <<
" idx_min=" << idx_min << endl;
777 cout <<
"search_interval_int4_int4_int4_int4() f_found_max=" << f_found_max <<
" idx_max=" << idx_max << endl;
780 len = idx_max - idx_min;
785 int f_v = (verbose_level >= 1);
788 cout <<
"btree::search_int4_int4 data=(" << data1 <<
"," << data2 <<
")" << endl;
802 f_found =
search(&
key, NULL, &idx, 2, verbose_level);
804 cout <<
"search_int4_int4() f_found=" << f_found <<
" idx=" << idx << endl;
817 cout <<
"btree::search_unique_int4() WARNING: element is not unique, returning -1" << endl;
827 int i2,
int i3,
int verbose_level)
831 int f_v = (verbose_level >= 1);
839 first, len, verbose_level);
843 cout <<
"key=[" << i0 <<
", " << i1 <<
", " << i2 <<
", " << i3 <<
"]" << endl;
844 cout <<
"first=" << first <<
" len=" << len << endl;
849 cout <<
"btree::search_unique_int4_int4_int4_int4() WARNING: element is not unique, returning -1" << endl;
850 cout <<
"key=[" << i0 <<
", " << i1 <<
", " << i2 <<
", " << i3 <<
"]" << endl;
851 cout <<
"first=" << first <<
" len=" << len << endl;
864 cout <<
"btree::search_unique_int4() no == -1, cannot determine element" << endl;
870 ith(no, &
key, &data, verbose_level - 1);
883 ith(no, &
key, &data, verbose_level - 1);
895 int verbose_level = 0;
897 len =
length(verbose_level);
901 ith(len - 1, &
key, &data, verbose_level);
915 int verbose_level = 0;
918 for (
int i = 0; i < len; i++) {
919 ith(first + i, &
key, &data, verbose_level);
943 int f_v = (verbose_level >= 1);
948 cout <<
"btree::search Root()=" <<
Root() << endl;
951 cout <<
"btree::search() not open" << endl;
963 cout <<
"btree::search done, f_found=" << f_found << endl;
970 Buffer *Buf,
int *idx,
int key_depth,
982 int f_v = (verbose_level >= 1);
983 int f_vv = (verbose_level >= 2);
984 int x, f_found, f_found1, idx1;
987 cout <<
"btree::SearchBtree page=" << page << endl;
993 LoadPage(Buf, page, verbose_level - 1);
995 cout <<
"calling SearchPage" << endl;
1003 cout <<
"SearchPage returns " << f_found <<
" with x=" << x << endl;
1014 Buf, idx, key_depth,
1016 if (!f_found && f_found1) {
1018 LoadPage(Buf, page, verbose_level - 1);
1027 *FKpData = FKBF->Page.Item[x].Data;
1032 FKBF->Page.Item[x].Ref,
1033 idx, f_found) != OK) {
1034 return error(
"SearchBtree() error in SearchBtree()");
1040 cout <<
"btree::SearchBtree page=" << page <<
" done, f_found=" << f_found << endl;
1046 void *pSearchKey,
DATATYPE *pSearchData,
1047 int *cur,
int *x,
int key_depth,
1088 int f_v = (verbose_level >= 1);
1089 int f_vv = (verbose_level >= 2);
1095 int f_found =
FALSE;
1098 cout <<
"btree::SearchPage" << endl;
1101 cout <<
"page:" << endl;
1104 if (pSearchData != NULL) {
1105 searchdatref = pSearchData->
datref;
1110 *x = ((l + r) >> 1);
1114 cout <<
"btree::SearchPage()|l = " << l <<
" *x = " << *x <<
" r = " << r << endl;
1119 (
char *) pSearchKey,
1126 if (pSearchData != NULL) {
1145 cout <<
"SearchPage() not ascending" << endl;
1154 for (i = 0; i < *x; i++) {
1160 cout <<
"btree::SearchPage done, f_found=" << f_found << endl;
1167 int f_v = (verbose_level >= 1);
1174 cout <<
"btree::length" << endl;
1177 cout <<
"btree::length() not open" << endl;
1183 pagelen = Root_BF->Page.NumItems;
1185 for (j = 0; j <= pagelen; j++) {
1186 l += Root_BF->Page.Item[j].Childs;
1193 cout <<
"loading root page " <<
Root() << endl;
1199 for (j = 0; j <= pagelen; j++) {
1215 int f_v = (verbose_level >= 1);
1221 cout <<
"btree::ith searching for entry " << l << endl;
1224 cout <<
"btree::ith() not open" << endl;
1235 cout <<
"btree::ith loaded page = " << page << endl;
1243 cout <<
"found in " << i << endl;
1250 cout <<
"not found" << endl;
1254 cout <<
"btree::ith ref == 0" << endl;
1261 cout <<
"btree::ith() done" << endl;
1271 int f_v = (verbose_level >= 1);
1276 cout <<
"btree::page_i_th looking for entry " << l << endl;
1279 for (j = 0; j <= page_len; j++) {
1281 if (*cur + childs > l) {
1285 if (*cur + childs == l) {
1286 if (j == page_len) {
1287 cout <<
"btree::page_i_th() j == page_len" << endl;
1298 cout <<
"btree::page_i_th() not found" << endl;
1308static int f_keyadded;
1311 DATATYPE *pData,
int verbose_level)
1319 int f_v = (verbose_level >= 1);
1324 int NewNeighbourChilds, new_page_num;
1327 cout <<
"btree::insert_key key=";
1332 cout <<
"btree::insert_key() file not open" << endl;
1345 cout <<
"btree::insert_key: calling Update() Root=" <<
Root() << endl;
1351 &NewNeighbourChilds,
1356 cout <<
"btree::insert_key RootSplit" << endl;
1359 cout <<
"btree::insert_key not RootSplit" << endl;
1364 cout <<
"btree::insert_key RootSplit Item[1]=";
1371 cout <<
"btree::insert_key: RootSplit, NewRoot->PageNum = " << NewRoot->
PageNum << endl;
1381 cout <<
"btree::insert_key Root=" <<
Root() << endl;
1387 cout <<
"saving the new root" << endl;
1389 SavePage(NewRoot, verbose_level - 1);
1392#ifdef WRITE_INFO_ONLY_AT_END
1401 cout <<
"btree::insert_key done" << endl;
1406 ItemTyp *RisenItem,
int *RisenNeighbourChilds,
1411 int f_v = (verbose_level >= 1);
1415 cout <<
"Update() in page " << Node << endl;
1423 *RisenNeighbourChilds = 0;
1425 RisenItem->
Key = *IKpKey;
1426 RisenItem->
Data = *IKpData;
1433 cout <<
"Update() loading page " << Node << endl;
1435 LoadPage(IKBF, Node, verbose_level);
1438 cout <<
"Update() searching in page " << Node << endl;
1441 (
void *)IKpKey, IKpData,
1446 cout <<
"key found at x=" << x << endl;
1449 cout <<
"key not found, x=" << x << endl;
1454 cout <<
"duplicate keys not allowed, we simply overwrite the Data" << endl;
1465 cout <<
"Update() in page " << Node <<
" calling update in branch x=" << x << endl;
1469 RisenItem, RisenNeighbourChilds,
1472 cout <<
"Update() loading page " << Node << endl;
1476 LoadPage(IKBF, Node, verbose_level - 1);
1482 cout <<
"Update() in page " << Node <<
" IKRisen Item[" << x <<
"]=";
1498 bt_item_copy(RisenItem, &IKBF->
Page.
Item[x + 1]);
1504 cout <<
"btree::Update() page is full, calling Split(), x = " << x << endl;
1506 *RisenNeighbourChilds = 0;
1510 RisenNeighbourChilds,
1522 cout <<
"btree::Update() saving old page " << IKBF->
PageNum << endl;
1529 int x,
int *RisenNeighbourChilds,
1544 int f_v = (verbose_level >= 1);
1552 cout <<
"Split page=" << BF->
PageNum <<
" at x=" << x << endl;
1555 cout <<
"btree::Split() original page:" << endl;
1562 cout <<
"Split new page=" << new_page_num << endl;
1601 cout <<
"btree::Split() after split:" << endl;
1602 cout <<
"original page: " << BF->
PageNum << endl;
1604 cout <<
"new page: " << SplitBF->
PageNum << endl;
1609 cout <<
"btree::Split() saving new page:" << endl;
1611 SavePage(SplitBF, verbose_level - 1);
1613 *RisenNeighbourChilds = sum1;
1615 cout <<
"SplitItem:";
1624static int DKidx, DKcur;
1626static int f_keydeleted;
1633 int f_v = (verbose_level >= 1);
1640 cout <<
"btree::delete_ith idx=" << idx << endl;
1643 cout <<
"btree::delete_ith() file not open" << endl;
1652 f_keydeleted =
FALSE;
1660 cout <<
"loading root page " <<
Root() << endl;
1668#ifdef WRITE_INFO_ONLY_AT_END
1674 LoadPage(Root_BF, z2, verbose_level - 1);
1679#ifdef WRITE_INFO_ONLY_AT_END
1685 cout <<
"btree::delete_ith done" << endl;
1691 int f_v = (verbose_level >= 1);
1696 cout <<
"btree::Delete Node=" << Node << endl;
1704 LoadPage(DKBF, Node, verbose_level - 1);
1708 DKFound =
page_i_th(DKidx, DKBF, &DKcur, &x, verbose_level);
1718 f_keydeleted =
TRUE;
1722 Underflow, DKBF, x, verbose_level);
1740 Delete(y, Underflow, verbose_level);
1743 LoadPage(DKBF, Node, verbose_level - 1);
1757 cout <<
"btree::Delete done" << endl;
1762 int& Underflow,
Buffer *DKBF,
int x,
1765 int f_v = (verbose_level >= 1);
1772 cout <<
"btree::FindGreatest Node1=" << Node1 <<
" x=" << x << endl;
1776 LoadPage(buf, Node1, verbose_level - 1);
1780 FindGreatest(Node2, Underflow, DKBF, x, verbose_level);
1782 LoadPage(buf, Node1, verbose_level - 1);
1795 f_keydeleted =
TRUE;
1807 cout <<
"btree::FindGreatest done" << endl;
1812 int Node,
int Path,
int& Underflow,
1815 int f_v = (verbose_level >= 1);
1825 cout <<
"btree::Compensate Precedent=" << Precedent <<
" Node=" << Node << endl;
1833 LoadPage(BF1, Node, verbose_level - 1);
1834 LoadPage(BF3, Precedent, verbose_level - 1);
1837 cout <<
"Path=" << Path << endl;
1838 cout <<
"NumBF3=" << NumBF3 << endl;
1840 if (Path < NumBF3) {
1842 cout <<
"rightmost leave with neighbor to the right" << endl;
1843 cout <<
"Path=" << Path << endl;
1844 cout <<
"NumBF3=" << NumBF3 << endl;
1849 LoadPage(BF2, Neighbour, verbose_level - 1);
1858 cout <<
"case I with x=" << x << endl;
1861 for (z = 1; z <= x - 1; z++) {
1872 NumBF2 = NumBF2 - x;
1873 for (z = 1; z <= NumBF2; z++) {
1885 cout <<
"case II with x=" << x << endl;
1892 for (z = Path + 1; z <= NumBF3 - 1; z++) {
1905 cout <<
"rightmost leave with neighbor to the left" << endl;
1909 LoadPage(BF2, Neighbour, verbose_level - 1);
1914 cout <<
"case III with x=" << x << endl;
1924 NumBF2 = NumBF2 - x;
1928 for (z = x - 1; z >= 1; z--) {
1946 cout <<
"case IV with x=" << x << endl;
1970 cout <<
"btree::Compensate done" << endl;
1976 int verbose_level = 0;
1978 int bt_len =
length(verbose_level);
1988 int verbose_level = 0;
1990 bt_len =
length(verbose_level);
1991 for (i = 0; i < len; i++) {
1999 ith(j, &
key, &data, verbose_level);
2010 int verbose_level = 0;
2016 ost <<
"page " << x <<
":\n";
2028 ost <<
"PageNum = " << BF->
PageNum << endl;
2030 ost <<
"BF->Page.NumItems = " << len << endl;
2031 for (i = 0; i <= len; i++) {
2041 ost <<
"item " << i <<
": Childs=" << childs <<
" Ref=" << ref;
2045 ost <<
" (" << datref <<
"/" << data_size <<
"): ";
2059 int childs, ref, datref, data_size;
2064 ost << setw(3) << i <<
": ";
2071 ost <<
" (" << setw(10) << datref
2072 <<
"/" << setw(6) << data_size <<
"): ";
2078 ost <<
"_{" << setw(8) << childs
2079 <<
"," << setw(8) << ref <<
"}" << endl; }
2090 fstream *f =
new fstream(
filename().s(), ios::in | ios::out | ios::binary);
2108 fstream *f =
new fstream(
filename().s(), ios::out | ios::binary);
2110 cout <<
"btree::file_create() file " <<
filename().
s() <<
" could not be created" << endl;
2116 fstream *f =
new fstream(
filename().s(), ios::in | ios::out | ios::binary);
2118 cout <<
"btree::file_create() file " <<
filename().
s() <<
" could not be opened" << endl;
2130 int idx = (int)
stream();
2132 cout <<
"btree::file_close() !fstream_table_used[idx]" << endl;
2133 cout <<
"idx=" << idx << endl;
2146 cout <<
"btree::file_write() file not open" << endl;
2149 int idx = (int)
stream();
2152 cout <<
"btree::file_write() !fstream_table_used[idx]" << endl;
2153 cout <<
"idx=" << idx << endl;
2162 cout <<
"btree::file_read() file not open" << endl;
2165 int idx = (int)
stream();
2168 cout <<
"btree::file_read() !fstream_table_used[idx]" << endl;
2169 cout <<
"idx=" << idx << endl;
2181 cout <<
"btree::file_seek() file not open" << endl;
2184 offset = page_no * (int)
sizeof(
PageTyp);
2185 int idx = (int)
stream();
2187 cout <<
"btree::file_seek() !fstream_table_used[idx]" << endl;
2188 cout <<
"idx=" << idx << endl;
2199 char *pca = (
char *)a;
2200 char *pcb = (
char *)b;
2203 for (i = 0; i < len; i++)
DISCRETA vector class for vectors of DISCRETA objects.
Vector & append(discreta_base &x)
void copyobject_to(discreta_base &x)
DISCRETA class for databases.
void init_string(int output_size, int field1, int field2)
void init_int2(int field1, int field2)
enum bt_key_kind & type()
void init_int4(int field1, int field2)
DISCRETA class for a database.
void file_read(PageTyp *page, const char *message)
void page_print(Buffer *BF, std::ostream &ost)
void search_interval_int4_int4(int l0, int u0, int l1, int u1, int &first, int &len, int verbose_level)
void Update(int Node, int *Rise, ItemTyp *RisenItem, int *RisenNeighbourChilds, int f_v)
void add_key_int4(int field1, int field2)
void init(const char *file_name, int f_duplicatekeys, int btree_idx)
int search(void *pSearchKey, DATATYPE *pData, int *idx, int key_depth, int verbose_level)
btree & operator=(const discreta_base &x)
int search_int4_int4(int data1, int data2, int &idx, int verbose_level)
int search_datref_of_unique_int4(int i, int verbose_level)
void print_all(std::ostream &ost)
void open(int verbose_level)
int search_datref_of_unique_int4_if_there(int i, int verbose_level)
void file_write(PageTyp *page, const char *message)
void ReadInfo(int verbose_level)
void print_page(int x, std::ostream &ost)
void add_key_string(int output_size, int field1, int field2)
int page_i_th(int l, Buffer *buffer, int *cur, int *i, int verbose_level)
void search_interval_int4_int4_int4(int l0, int u0, int l1, int u1, int l2, int u2, int &first, int &len, int verbose_level)
void key_print(char *the_key, std::ostream &ost)
int length(int verbose_level)
int SearchPage(Buffer *buffer, void *pSearchKey, DATATYPE *pSearchData, int *cur, int *x, int key_depth, int verbose_level)
void item_print(ItemTyp *item, int i, std::ostream &ost)
void create(int verbose_level)
void close(int verbose_level)
void SavePage(Buffer *BF, int verbose_level)
void add_key_int2(int field1, int field2)
void search_interval_int4_int4_int4_int4(int l0, int u0, int l1, int u1, int l2, int u2, int l3, int u3, int &first, int &len, int verbose_level)
void Compensate(int Precedent, int Node, int Path, int &Underflow, int verbose_level)
void Split(Buffer *BF, ItemTyp *Item, int x, int *RisenNeighbourChilds, int verbose_level)
void delete_ith(int idx, int verbose_level)
void Delete(int Node, int &Underflow, int verbose_level)
void insert_key(KEYTYPE *pKey, DATATYPE *pData, int verbose_level)
int search_unique_int4_int4_int4_int4(int i0, int i1, int i2, int i3, int verbose_level)
std::ostream & print(std::ostream &)
void get_datrefs(int first, int len, Vector &datrefs)
void copyobject_to(discreta_base &x)
int search_string(discreta_base &key_op, int &pos, int verbose_level)
void key_fill_in(char *the_key, Vector &the_object)
void ith(int l, KEYTYPE *key, DATATYPE *data, int verbose_level)
void FindGreatest(int Node1, int &Underflow, Buffer *DKBF, int x, int verbose_level)
void LoadPage(Buffer *BF, int x, int verbose_level)
void file_seek(int page_no)
int AllocateRec(int verbose_level)
void search_interval_int4(int i_min, int i_max, int &first, int &len, int verbose_level)
void WriteInfo(int verbose_level)
int SearchBtree(int page, void *pSearchKey, DATATYPE *pData, Buffer *Buf, int *idx, int key_depth, int verbose_level)
void print_range(int first, int len, std::ostream &ost)
int search_unique_int4(int i, int verbose_level)
DISCRETA base class. All DISCRETA classes are derived from this class.
void copyobject(discreta_base &x)
hollerith & change_to_hollerith()
Vector & change_to_vector()
void append(const char *p)
DISCRETA class for bulk storage.
void allocate_rec(Buffer *BF, int buf_idx, int x, int verbose_level)
void save_page(Buffer *BF, int buf_idx, int verbose_level)
int load_page(Buffer *BF, int x, int buf_idx, int verbose_level)
void write_pages_to_file(btree *B, int buf_idx, int verbose_level)
#define MAX_FSTREAM_TABLE
#define BTREE_PAGE_LENGTH_LOG
#define BTREEHALFPAGESIZE
void fill_char(void *v, int cnt, int c)
fstream * fstream_table[MAX_FSTREAM_TABLE]
void database_init(int verbose_level)
struct orbiter::layer2_discreta::buffer Buffer
DISCRETA auxiliary class related to the class database.
void page_table_exit(int verbose_level)
int page_table_alloc(int verbose_level)
void page_table_free(int idx, int verbose_level)
void bt_key_fill_in(char *key, Vector &V, Vector &the_object)
struct orbiter::layer2_discreta::pagetyp PageTyp
DISCRETA auxiliary class related to the class database.
int f_RootBF_free[MAX_ROOT_BUF]
page_table * page_table_pointer(int slot)
void root_buf_free(int i)
void bt_key_fill_in_int4(char **p_key, discreta_base &key_op)
void bt_key_fill_in_string(char **p_key, int output_size, discreta_base &key_op)
void page_table_init(int verbose_level)
int fstream_table_used[MAX_FSTREAM_TABLE]
void bt_key_get_int4(char **key, int_4 &i)
void bt_key_print(char *key, Vector &V, ostream &ost)
int bt_key_compare(char *key1, char *key2, Vector &V, int depth)
int fstream_table_get_free_entry()
struct orbiter::layer2_discreta::itemtyp ItemTyp
DISCRETA auxiliary class related to the class database.
the orbiter library for the classification of combinatorial objects
DISCRETA auxiliary class related to the class database.
DISCRETA auxiliary class related to the class database.
DISCRETA auxiliary class related to the class database.
DISCRETA auxiliary class related to the class database.
DISCRETA auxiliary class related to the class database.
ItemTyp Item[BTREEMAXPAGESIZE+1]