casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Member Functions | Private Types | Private Member Functions | Private Attributes
SDDIndex Class Reference

SDDIndex is the index of an SDDFile, a set of SDDIndexReps. More...

#include <SDDIndex.h>

List of all members.

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
SDDIndexoperator= (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
SDDIndexRepoperator() (uInt entry)
 Return a reference to SDDIndexRep.
const SDDIndexRepoperator() (uInt entry) const
const SDDBootStrapbootstrap () const
 Return a reference to the Bootstrap.
SDDBootStrapbootstrap ()
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

Detailed Description

SDDIndex is the index of an SDDFile, a set of SDDIndexReps.

Intended use:

Public interface

Review Status

Date Reviewed:
yyyy/mm/dd

Prerequisite

Etymology

Synopsis

Example

Motivation

Definition at line 236 of file SDDIndex.h.


Member Enumeration Documentation

enum SDDIndex::CharFields [private]
Enumerator:
SOURCE 

Definition at line 313 of file SDDIndex.h.

enum SDDIndex::DoubleFields [private]
Enumerator:
RESTF_INTTIME 

Definition at line 311 of file SDDIndex.h.

enum SDDIndex::FloatFields [private]
Enumerator:
HCOORD 
VCOORD 
SCAN_NUMBER 
FRES_SLEWRATE 
LST 
UTDATE 

Definition at line 304 of file SDDIndex.h.

enum SDDIndex::IntFields [private]
Enumerator:
NEW_FIRST 
NEW_LAST 

Definition at line 301 of file SDDIndex.h.

enum SDDIndex::ShortFields [private]
Enumerator:
OLD_FIRST 
OLD_LAST 
OLD_MAGIC 
OLD_POSCODE 
OBSMODE 
RECORD_PHASE 
NEW_POSCODE 

Definition at line 293 of file SDDIndex.h.


Constructor & Destructor Documentation

construct index from an SDDbootStrap - reads from file if present

SDDIndex::SDDIndex ( const SDDIndex other)

copy constructor

clean up the pointers


Member Function Documentation

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.

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]

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

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
SDDIndex& SDDIndex::operator= ( const SDDIndex other)

assignment operator, true copy

void SDDIndex::readEntry ( SDDIndexRep rep,
uInt  entry 
) [private]

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]

Member Data Documentation

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.

Definition at line 316 of file SDDIndex.h.


The documentation for this class was generated from the following file: