sx360::sxIndex Class Reference

#include <sxindex.h>

List of all members.


Public Member Functions

  sxIndex ()
  sxIndex (int s, int x, int e, sxIterator *i)
void  write (string filename)
void  read (string filename)
off_t  find (unsigned long i)

sxIndex builds an index for quick retreival of sxRecords. This is especially important in large files. To build an index, there needs to be a unique integer value that represents a series of numeric punches across columns for every sxRecord. In a voting system, this might be a voter id, etc.


Constructor & Destructor Documentation

sx360::sxIndex::sxIndex (
 )  [inline]

sx360::sxIndex::sxIndex ( int  s,


int  x,


int  e,


sxIterator i  

)

[inline]

Constructor to build a an index.

Parameters:

s = the card where the index starts

x = the column in each record where the index starts

e = the ending column where the record ends

i = the sxIterator that will traverse the records

such as:

sxIndex idx( 1, 1, 5, i );

will create an index starting on card 1, column 1, ending on column 5, using the iterator assumed here to be 'i'.


Member Function Documentation

void sx360::sxIndex::write ( string  filename  )  [inline]

Writes the index to the file in filename

void sx360::sxIndex::read ( string  filename  )  [inline]

Reads the index file from filename

off_t sx360::sxIndex::find ( unsigned long  i  )  [inline]

Returns the 0 based index of the record specified or -1 if not found.


Generated on Tue Nov 27 02:17:32 2007 for sx360 by  doxygen 1.5.2