int TDBTBL::Cardinality(PGLOBAL g) { if (!g) return 0; // Cannot make the table list else if (Cardinal < 0) { int tsz; if (!Tablist && InitTableList(g)) return 0; // Cannot be calculated at this stage Cardinal = 0; for (PTABLE tabp = Tablist; tabp; tabp = tabp->GetNext()) { if ((tsz = tabp->GetTo_Tdb()->Cardinality(g)) < 0) { Cardinal = -1; return tsz; } // endif mxsz Cardinal += tsz; } // endfor i } // endif Cardinal return Cardinal; } // end of Cardinality
void TDBTBM::ResetDB(void) { for (PCOL colp = Columns; colp; colp = colp->GetNext()) if (colp->GetAmType() == TYPE_AM_TABID) colp->COLBLK::Reset(); for (PTABLE tabp = Tablist; tabp; tabp = tabp->GetNext()) ((PTDBASE)tabp->GetTo_Tdb())->ResetDB(); Tdbp = (Tablist) ? (PTDBASE)Tablist->GetTo_Tdb() : NULL; Crp = 0; } // end of ResetDB
int TDBTBL::GetMaxSize(PGLOBAL g) { if (MaxSize < 0) { int mxsz; if (!Tablist && InitTableList(g)) return 0; // Cannot be calculated at this stage MaxSize = 0; for (PTABLE tabp = Tablist; tabp; tabp = tabp->GetNext()) { if ((mxsz = tabp->GetTo_Tdb()->GetMaxSize(g)) < 0) { MaxSize = -1; return mxsz; } // endif mxsz MaxSize += mxsz; } // endfor i } // endif MaxSize return MaxSize; } // end of GetMaxSize