///////////////////////////////////////////////////////////////////////////////////////////////// Execute : Drives the DebugDb mode of tripwire, which will only be used for internal use. /////////////////////////////////////////////////////////////////////////////////////////////////
| 165 | // Drives the DebugDb mode of tripwire, which will only be used for internal use. |
| 166 | ////////////////////////////////////////////////////////////////////////////////////////////////////// |
| 167 | void cDbDebug::Execute(cFCODatabaseFileIter& dbIter, const TSTRING& dbFile) |
| 168 | { |
| 169 | |
| 170 | cDebug d("cDebugDb::Execute"); |
| 171 | cDbDebug DbDebug; |
| 172 | // |
| 173 | //A derived class with extra methods for obtaining blockfile information. |
| 174 | cDebugHierDb* db; |
| 175 | // |
| 176 | // Cast the database object that we have inherited from the "common" command line |
| 177 | // information to a cDebugHierDb. This will expose all the information that we |
| 178 | // need to debug the database. |
| 179 | // |
| 180 | db = static_cast<cDebugHierDb*>(&(dbIter.GetDb())); |
| 181 | |
| 182 | try |
| 183 | { |
| 184 | cDebugHierDbIter pIter(db); |
| 185 | |
| 186 | // |
| 187 | //First, map the state of the underlying quantyum database. Store this info. in |
| 188 | //the hierDbMap. |
| 189 | // |
| 190 | DbDebug.MapQuantumDatabase(*db); |
| 191 | |
| 192 | //DbDebug.DisplayDbMap(); //TODO : get rid of these display calls. |
| 193 | |
| 194 | // |
| 195 | // Uncomment ManipDb() to allow manipulation of the database |
| 196 | // This may be handy if one does not want to do a full update... |
| 197 | //DbDebug.ManipDb( dbIter ); |
| 198 | |
| 199 | // Next, traverse the hierarchical overlay and "tag" all entries in the map that |
| 200 | // we see: |
| 201 | ASSERT(pIter.AtRoot()); |
| 202 | // |
| 203 | // check to make sure we are at the root of the hierarchy, if so, map the root |
| 204 | // before calling the recursive traversal function. |
| 205 | // |
| 206 | util_MapHierRoot(DbDebug.GetHierDbMap()); |
| 207 | |
| 208 | DbDebug.TraverseHierarchy(pIter /*, db*/); |
| 209 | |
| 210 | //DbDebug.DisplayDbMap(); //TODO: get rid of these display calls. |
| 211 | // |
| 212 | // Finally, iterate over the map and see if there is any data that the hierarchy |
| 213 | // does not account for: |
| 214 | // |
| 215 | DbDebug.CongruencyTest(); |
| 216 | // |
| 217 | // Output the results |
| 218 | // |
| 219 | DbDebug.OutputResults(); |
| 220 | |
| 221 | } //try |
| 222 | |
| 223 | catch (eError& e) |
| 224 | { |