![]() |
![]() An Information Portal to Biological Macromolecular Structures |
|
PDB Home |
Contact Us ![]() |
![]() |
Software Tools Home | Dictionary Home | PDBML Home |
![]() |
#include "ISTable.h"
#include "FileNavigator.h"
int ISTable::WriteObject(FileNavigator * fnav);
#include "ISTable.h"
#include "FileNavigator.h"
const int MAX_TABLES = 50;
const char * NAV_FILE = "table.odb";
ISTable * pTable = new ISTable[MAX_TABLES];
int * table_loc = new int[MAX_TABLES];
FileNavigator * f = new FileNavigator();
f->OpenFile(NAV_FILE, WRITE_MODE);
f->ReadFileHeader();
... // do table construction/maniputation
// Write out all the tables...
Word list_loc = 0, place = 0;
f->WriteWord(0, list_loc);
for (int i = 0; i < MAX_TABLES; i++) {
table_loc[i] = pTable[i].WriteObject(f);
}
f->WriteWords((Word *) table_locs, MAX_TABLES, place);
f->UpdateWord(place, list_loc, list_loc);
f->CloseFile();
WriteObject dumps out the object to a persistent storage file.
fnav | A pointer to the FileNavigator object responsible for writing the persistent storage file. |
A negative value indicates an error or warning.
A non-negative value indicates the index of the object, needed for reconstruction.
See also: | GetObject |
---|