SDTableIterator.h

Classes

SDTableIterator -- (full description)

class SDTableIterator : public SDIterator

Interface

Public Members
SDTableIterator(const String &tableName, const Record &selection, Table::TableOption opt = Table::Old, TableLock::LockOption lockoption = TableLock::DefaultLocking)
SDTableIterator(const SDTableIterator& other)
SDTableIterator(const SDTableIterator& other, const Record &selection)
~SDTableIterator()
SDTableIterator &operator=(const SDTableIterator& other)
virtual String type() const
Bool unlock()
Bool lock(uInt nattempts=0)
void origin()
Bool more()
SDIterator& operator++(int)
SDIterator& operator++()
SDIterator& operator--(int)
SDIterator& operator--()
uInt where() const
uInt nrecords()
void resync()
void flush()
void reselect()
void deepCopy(const String &newName)
const SDRecord &get()
const Record &getData()
const Record &getHeader()
const Record &getOther()
const Array<String> getHist()
Bool put(const SDRecord& rec)
Bool appendRec(const SDRecord &rec)
Bool deleteRec()
Bool isWritable() const
const Record &stringFields() const
String name() const
Bool ok() const
Private Members
void cleanup()
void cleanupMost()
void copyAll()
void copyData()
void copyHeader()
void copyHist()
void copyOther()
Bool replaceAll(const SDRecord& rec, Bool rowIsNew = False)
Bool ensureSDFITSTable()
void init()
void initStatics()
void applySelection(const Record &selection)
void createTable(const String& tableName, TableLock::LockOption lockoption, Table::TableOption opt)
void ensureOutputColumns()
void setRowShape()
void initStringFields(Record &fieldsRec, const Record &modelRec)
String makeFullAxisSel(const String &axisSel, const Vector<String> &ctypeCols, const Vector<String> &axisCols)
String parseSelection(const Record& selection, const TableDesc& layout, Vector<uInt> &specalRows, Bool &hasSpecial)
Bool parseSpecialFields(const Record& selection, Vector<uInt> &specialRows)
Vector<uInt> parseRow(const Record& selection, Int maxRow)
Bool parseRecord(const Record& selection, const SimpleOrderedMap<String, String>& map, const TableDesc& layout, String& result)
Bool parseDescRecord(const Record& selection, String& result)
Double getRefPix(const Vector<Double> &chanVals, Double refVal, Double &delta)
static void getSpecialVectors(SDIterAxes &axes, Vector<Double> &uts, Vector<String> &dates, uInt nrecs, uInt nrow, Bool doUT, Bool doDate)
Record getVectorShortCuts(const Record &recTemplate)
Bool isSDFITSTable(const Table& tab)
void deleteCopiers()
void setCopiers()
Bool copyRecord(Record &outRec, const Record &inRec)

Description

Review Status

Date Reviewed:
yyyy/mm/dd

Prerequisite

Etymology

Synopsis

Example

Motivation

Thrown Exceptions

To Do

Member Description

SDTableIterator(const String &tableName, const Record &selection, Table::TableOption opt = Table::Old, TableLock::LockOption lockoption = TableLock::DefaultLocking)

construct an iterator from a FLAT Table for now, this must be an SDFITS table the selection string is currently ignored

SDTableIterator(const SDTableIterator& other)

construct from another iterator

SDTableIterator(const SDTableIterator& other, const Record &selection)

construct from another with selection

~SDTableIterator()

SDTableIterator &operator=(const SDTableIterator& other)

assiment operator

virtual String type() const

what type of sditerator is this ("Table")

Bool unlock()

Unlock this table

Bool lock(uInt nattempts=0)

Lock this table. Try nattempts times.

void origin()

Resets the iterator to the top

Bool more()

are there any more SDRecords after the current one

SDIterator& operator++(int)

step to the next one, if at end, nothing changes

SDIterator& operator++()

SDIterator& operator--(int)

step back, if at end, nothing changes

SDIterator& operator--()

uInt where() const

return the current row number

uInt nrecords()

how many SDRecords are there

void resync()

resync with the disk contents

void flush()

flush the disk contents - a no-op if this is a read-only sditerator

void reselect()

re-select

void deepCopy(const String &newName)

make a deep copy

const SDRecord &get()

return the current SDRecord

const Record &getData()

return just the data portion of the current SDRecord

const Record &getHeader()

return just the header portion of the current SDRecord

const Record &getOther()

return just the other portion of the current SDRecord

const Array<String> getHist()

return just the hist portion of the current SDRecord

Bool put(const SDRecord& rec)

replace the current SDRecord with a new one

Bool appendRec(const SDRecord &rec)

add a new record at the end of the iterator

Bool deleteRec()

delete the record at the current location

Bool isWritable() const

see if this iterator is writable currently always returns False.

const Record &stringFields() const

get a record with structure like the current working SDRecord which contains only fields which are scalar string fields - the value of those fields is just a boolean. This is necessary so that the proper parsing of the selection when given as a string can be done for each field without having to duplicate that code in both glish and here in C++.

String name() const

return the name of iterator, the same as the table name

Bool ok() const

other things may not work if ok == False, this needs to be cleaned up

void cleanup()

void cleanupMost()

void copyAll()

void copyData()

void copyHeader()

void copyHist()

void copyOther()

Bool replaceAll(const SDRecord& rec, Bool rowIsNew = False)

Bool ensureSDFITSTable()

void init()

void initStatics()

void applySelection(const Record &selection)

void createTable(const String& tableName, TableLock::LockOption lockoption, Table::TableOption opt)

void ensureOutputColumns()

void setRowShape()

void initStringFields(Record &fieldsRec, const Record &modelRec)

String makeFullAxisSel(const String &axisSel, const Vector<String> &ctypeCols, const Vector<String> &axisCols)

String parseSelection(const Record& selection, const TableDesc& layout, Vector<uInt> &specalRows, Bool &hasSpecial)

Bool parseSpecialFields(const Record& selection, Vector<uInt> &specialRows)

Vector<uInt> parseRow(const Record& selection, Int maxRow)

Bool parseRecord(const Record& selection, const SimpleOrderedMap<String, String>& map, const TableDesc& layout, String& result)

Bool parseDescRecord(const Record& selection, String& result)

Double getRefPix(const Vector<Double> &chanVals, Double refVal, Double &delta)

static void getSpecialVectors(SDIterAxes &axes, Vector<Double> &uts, Vector<String> &dates, uInt nrecs, uInt nrow, Bool doUT, Bool doDate)

Record getVectorShortCuts(const Record &recTemplate)

Bool isSDFITSTable(const Table& tab)

This will likely be more useful elsewhere eventually Does the table appear to be from an SDFITS file

void deleteCopiers()

void setCopiers()

Bool copyRecord(Record &outRec, const Record &inRec)