SDIterator.h

Classes

SDIterator -- (full description)

class SDIterator

Interface

Public Members
SDIterator()
virtual ~SDIterator()
virtual String type() const = 0
virtual void origin() = 0
virtual Bool more() = 0
virtual Bool unlock() = 0
virtual Bool lock(uInt nattempts=0) = 0
virtual SDIterator& operator++(int) = 0
virtual SDIterator& operator++() = 0
virtual SDIterator& operator--(int) = 0
virtual SDIterator& operator--() = 0
virtual uInt where() const = 0
virtual uInt nrecords() = 0
virtual void resync() = 0
virtual void flush() = 0
virtual void reselect() = 0
virtual void deepCopy(const String &newName) = 0
virtual const SDRecord &get() = 0
virtual const Record &getData() = 0
virtual const Record &getHeader() = 0
virtual const Record &getOther() = 0
virtual const Array<String> getHist() = 0
virtual Bool put(const SDRecord& rec) = 0
virtual Bool appendRec(const SDRecord &rec) = 0
virtual Bool deleteRec() = 0
virtual Bool isWritable() const = 0
virtual Record get_vectors(const Record& recTemplate)
virtual const Record &stringFields() const = 0
virtual String name() const = 0
virtual Bool ok() const = 0
virtual Bool useCorrectedData(Bool correctedData)
virtual Bool correctedData()
Protected Members
virtual Record getVectorShortCuts(const Record &recTemplate)
Record getVectors(const Record &recTemplate)
void makeDescFromTemplate(const Record& recTemplate, const Record& sdrec, RecordDesc& target, uInt nrows)
RecordDesc cloneDesc(const Record& rec)
void addFieldsToCopier(SDIterFieldCopier& copier, const Record& sdrec, Record& result, const String &parentName)
String parseRanges(const Matrix<Double> &ranges, const String &name, Bool colIsArray = False)
String parseList(const Vector<String> &list, const String &name)
String doubleToString(Double dbl)
void makeVariableSubRecs(Record &rec)
Private Members
uInt countFields(const RecordDesc &rec)

Description

Review Status

Date Reviewed:
yyyy/mm/dd

Prerequisite

Etymology

Synopsis

Example

Motivation

Thrown Exceptions

Member Description

SDIterator()

this just has the common functions, no data

virtual ~SDIterator()

virtual String type() const = 0

what type of sditerator is this ("MeasurementSet, Table, Image")

virtual void origin() = 0

reset the iterator to start

virtual Bool more() = 0

are there any more SDRecords after the current one

virtual Bool unlock() = 0

unlock this sditerator and all of its sub-tables, if any

virtual Bool lock(uInt nattempts=0) = 0

lock this sditerator and all of its sub-tables. The original lock type is used here. It will try and acquire the lock nattempt times - that is roughly the time in seconds until it gives up trying to acquire the lock.

virtual SDIterator& operator++(int) = 0
virtual SDIterator& operator++() = 0

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

virtual SDIterator& operator--(int) = 0
virtual SDIterator& operator--() = 0

step back, if at end, nothing changes

virtual uInt where() const = 0

return the current location

virtual uInt nrecords() = 0

how many SDRecords are there

virtual void resync() = 0

resync with the disk contents

virtual void flush() = 0

flush the contents to disk (a no-op for a read-only MS)

virtual void reselect() = 0

re-select

virtual void deepCopy(const String &newName) = 0

make a deep copy of the main table and any subtables. An exception is thrown if the newName can not be created or a file having that name already exists.

virtual const SDRecord &get() = 0

return the current SDRecord

virtual const Record &getData() = 0

return just the data portion of the current SDRecord

virtual const Record &getHeader() = 0

return just the header portion of the current SDRecord

virtual const Record &getOther() = 0

return just the other portion of the current SDRecord

virtual const Array<String> getHist() = 0

return just the hist portion of the current SDRecord

virtual Bool put(const SDRecord& rec) = 0

replace the current SDRecord with a new one

virtual Bool appendRec(const SDRecord &rec) = 0

add a new record at the end of the iterator

virtual Bool deleteRec() = 0

delete the record at the current location

virtual Bool isWritable() const = 0

see if this iterator is writable

virtual Record get_vectors(const Record& recTemplate)

get all values from the SDIterator for the fields specified in the template as vectors or arrays

virtual const Record &stringFields() const = 0

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++.

virtual String name() const = 0

return the name of iterator

virtual Bool ok() const = 0

Is this iterator ok

virtual Bool useCorrectedData(Bool correctedData)

Toggle use of corrected data if available. Default is a no-op, that returns False.

virtual Bool correctedData()

query whether corrected data is being used. Default is False.

virtual Record getVectorShortCuts(const Record &recTemplate)

current supported short-cuts are: time, scan_number, source_name, telescope_position, rest_frequency, date, ut - default just uses getVectors, may be two times through

Record getVectors(const Record &recTemplate)

get them by brute force

void makeDescFromTemplate(const Record& recTemplate, const Record& sdrec, RecordDesc& target, uInt nrows)

RecordDesc cloneDesc(const Record& rec)

void addFieldsToCopier(SDIterFieldCopier& copier, const Record& sdrec, Record& result, const String &parentName)

String parseRanges(const Matrix<Double> &ranges, const String &name, Bool colIsArray = False)

String parseList(const Vector<String> &list, const String &name)

String doubleToString(Double dbl)

void makeVariableSubRecs(Record &rec)

uInt countFields(const RecordDesc &rec)