casa
$Rev:20696$
|
SDDIndex is the index of an SDDFile, a set of SDDIndexReps. More...
#include <SDDIndex.h>
Public Member Functions | |
SDDIndex (const SDDBootStrap &bs) | |
construct index from an SDDbootStrap - reads from file if present | |
SDDIndex (const SDDIndex &other) | |
copy constructor | |
~SDDIndex () | |
clean up the pointers | |
SDDIndex & | operator= (const SDDIndex &other) |
assignment operator, true copy | |
Bool | fullUpdate () |
For both types of update, if the boostrap block is the same, nothing actually changes in the index. | |
Bool | incrementalUpdate () |
do an incremental update : assumes that the file has mearly grown Attempts to verify that assumption by checking the values of the last 8 known index entries with their counterparts on disk and verifying that they are still the same. | |
void | attach (const SDDBootStrap &bs) |
attach to a new file via an SDDBooStrap | |
void | write () |
write the full index to the attached file | |
void | write (uInt firstEntry, uInt nEntries=1) |
write nEntries entries starting with firstEntry | |
SDDIndexRep & | operator() (uInt entry) |
Return a reference to SDDIndexRep. | |
const SDDIndexRep & | operator() (uInt entry) const |
const SDDBootStrap & | bootstrap () const |
Return a reference to the Bootstrap. | |
SDDBootStrap & | bootstrap () |
Fallible< uInt > | maxEntryInUse () const |
max entry in use, invalid if non in use | |
uInt | nrEntry () const |
number of available entries | |
Bool | inUse (uInt entry) const |
check if an entry is in use (non-zero scan number) | |
void | clear (uInt entry) |
set everything in an entry to 0 | |
void | setVersion (SDDBootStrap::SDD_VERSION newVersion) |
switch version | |
Private Types | |
enum | ShortFields { OLD_FIRST, OLD_LAST, OLD_MAGIC, OLD_POSCODE, OBSMODE, RECORD_PHASE, NEW_POSCODE } |
enum | IntFields { NEW_FIRST, NEW_LAST } |
enum | FloatFields { HCOORD, VCOORD, SCAN_NUMBER, FRES_SLEWRATE, LST, UTDATE } |
enum | DoubleFields { RESTF_INTTIME } |
enum | CharFields { SOURCE } |
Private Member Functions | |
void | flush () |
void | readEntry (SDDIndexRep &rep, uInt entry) |
void | writeEntry (SDDIndexRep &rep, uInt entry) |
Char & | valueRef (CharFields field, uInt entry, uInt position) |
const Char & | valueRef (CharFields field, uInt entry, uInt position) const |
Short & | valueRef (ShortFields field, uInt entry) |
const Short & | valueRef (ShortFields field, uInt entry) const |
Int & | valueRef (IntFields field, uInt entry) |
const Int & | valueRef (IntFields field, uInt entry) const |
float & | valueRef (FloatFields field, uInt entry) |
const float & | valueRef (FloatFields field, uInt entry) const |
double & | valueRef (DoubleFields field, uInt entry) |
const double & | valueRef (DoubleFields field, uInt entry) const |
Private Attributes | |
Block< SDDIndexRep > * | index_p |
SDDBlock | sddBlock |
SDDBootStrap | bootstrap_p |
uInt | currentRecord_p |
Bool | needsFlushed_p |
SDDIndex is the index of an SDDFile, a set of SDDIndexReps.
Public interface
Definition at line 236 of file SDDIndex.h.
enum SDDIndex::CharFields [private] |
Definition at line 313 of file SDDIndex.h.
enum SDDIndex::DoubleFields [private] |
Definition at line 311 of file SDDIndex.h.
enum SDDIndex::FloatFields [private] |
Definition at line 304 of file SDDIndex.h.
enum SDDIndex::IntFields [private] |
Definition at line 301 of file SDDIndex.h.
enum SDDIndex::ShortFields [private] |
Definition at line 293 of file SDDIndex.h.
SDDIndex::SDDIndex | ( | const SDDBootStrap & | bs | ) |
construct index from an SDDbootStrap - reads from file if present
SDDIndex::SDDIndex | ( | const SDDIndex & | other | ) |
copy constructor
clean up the pointers
void SDDIndex::attach | ( | const SDDBootStrap & | bs | ) |
attach to a new file via an SDDBooStrap
const SDDBootStrap& SDDIndex::bootstrap | ( | ) | const [inline] |
Return a reference to the Bootstrap.
Definition at line 276 of file SDDIndex.h.
References bootstrap_p.
SDDBootStrap& SDDIndex::bootstrap | ( | ) | [inline] |
Definition at line 277 of file SDDIndex.h.
References bootstrap_p.
void SDDIndex::clear | ( | uInt | entry | ) |
set everything in an entry to 0
void SDDIndex::flush | ( | ) | [private] |
Bool SDDIndex::fullUpdate | ( | ) |
For both types of update, if the boostrap block is the same, nothing actually changes in the index.
Each returns True if an actual update occured and false if things remain the same. do a full update from the disk file
Bool SDDIndex::incrementalUpdate | ( | ) |
do an incremental update : assumes that the file has mearly grown Attempts to verify that assumption by checking the values of the last 8 known index entries with their counterparts on disk and verifying that they are still the same.
Return True if incremental was the correct model (or nothing has changed) Returns False if incremental was NOT the correct model, a fullUpdate could then be tried if desirable
Bool SDDIndex::inUse | ( | uInt | entry | ) | const |
check if an entry is in use (non-zero scan number)
Referenced by SDDFile::inUse().
Fallible<uInt> SDDIndex::maxEntryInUse | ( | ) | const |
max entry in use, invalid if non in use
uInt SDDIndex::nrEntry | ( | ) | const |
number of available entries
SDDIndexRep& SDDIndex::operator() | ( | uInt | entry | ) |
Return a reference to SDDIndexRep.
const SDDIndexRep& SDDIndex::operator() | ( | uInt | entry | ) | const |
void SDDIndex::readEntry | ( | SDDIndexRep & | rep, |
uInt | entry | ||
) | [private] |
void SDDIndex::setVersion | ( | SDDBootStrap::SDD_VERSION | newVersion | ) |
switch version
Char& SDDIndex::valueRef | ( | CharFields | field, |
uInt | entry, | ||
uInt | position | ||
) | [private] |
const Char& SDDIndex::valueRef | ( | CharFields | field, |
uInt | entry, | ||
uInt | position | ||
) | const [private] |
Short& SDDIndex::valueRef | ( | ShortFields | field, |
uInt | entry | ||
) | [private] |
const Short& SDDIndex::valueRef | ( | ShortFields | field, |
uInt | entry | ||
) | const [private] |
Int& SDDIndex::valueRef | ( | IntFields | field, |
uInt | entry | ||
) | [private] |
const Int& SDDIndex::valueRef | ( | IntFields | field, |
uInt | entry | ||
) | const [private] |
float& SDDIndex::valueRef | ( | FloatFields | field, |
uInt | entry | ||
) | [private] |
const float& SDDIndex::valueRef | ( | FloatFields | field, |
uInt | entry | ||
) | const [private] |
double& SDDIndex::valueRef | ( | DoubleFields | field, |
uInt | entry | ||
) | [private] |
const double& SDDIndex::valueRef | ( | DoubleFields | field, |
uInt | entry | ||
) | const [private] |
void SDDIndex::write | ( | ) |
write the full index to the attached file
void SDDIndex::write | ( | uInt | firstEntry, |
uInt | nEntries = 1 |
||
) |
write nEntries entries starting with firstEntry
void SDDIndex::writeEntry | ( | SDDIndexRep & | rep, |
uInt | entry | ||
) | [private] |
SDDBootStrap SDDIndex::bootstrap_p [private] |
Definition at line 317 of file SDDIndex.h.
Referenced by bootstrap().
uInt SDDIndex::currentRecord_p [private] |
Definition at line 318 of file SDDIndex.h.
Block<SDDIndexRep>* SDDIndex::index_p [private] |
Definition at line 315 of file SDDIndex.h.
Bool SDDIndex::needsFlushed_p [private] |
Definition at line 319 of file SDDIndex.h.
SDDBlock SDDIndex::sddBlock [private] |
Definition at line 316 of file SDDIndex.h.