RCSB PDB Protein Data Bank A Member of the wwPDB
An Information Portal to Biological Macromolecular Structures
PDB Home | Contact Us
next up previous contents
Next: General Methods Up: Persistence Methods Previous: WriteObject

GetObject

NAME GetObject

PROTOTYPE

#include "ISTable.h"
#include "FileNavigator.h" // defines Word (4-byte integer)

int ISTable::GetObject(Word index, FileNavigator * fnav);

EXAMPLE

#include "ISTable.h"
#include "FileNavigator.h"

const char * NAV_FILE = "table.odb";
FileNavigator * f = new FileNavigator();
f->OpenFile(NAV_FILE, READ_MODE);
f->ReadFileHeader();
ISTable * pTable = NULL;
Word where = 0, errCode = 0;

where = f->GetWord(0, errCode); // the location of the list
if (errCode < 0) f->PrintError(errCode);
uWord numT = 0;
int * table_loc = (int *) f->GetWords(where, numT, errCode);
pTable = new ISTable[numT];

for (int i = 0; i < numT; i++) {
  pTable[i].GetObject(table_loc[i], f);
}

f->CloseFile();
PURPOSE

GetObject loads the table object from a persistent storage file.

RECEIVES

index The index of the object (i.e. its location in the file).
fnav A pointer to the FileNavigator object responsible for reading the persistent storage file.

RETURN VALUE

A negative value indicates an error or warning.

REMARKS

See also: WriteObject



Olivera Tosic
6/12/2002

 

© RCSB PDB