GBTMSDataDescFiller.h

Classes

GBTMSDataDescFiller -- GBTMSDataDescFiller fills the MSDataDescription table for GBT fillers (full description)

class GBTMSDataDescFiller

Interface

Public Members
GBTMSDataDescFiller()
GBTMSDataDescFiller(MSDataDescription &msDataDesc)
~GBTMSDataDescFiller()
void attach(MSDataDescription &msDataDesc)
void fill(Int polarizationId, const Vector<Int> &specWinIds, const Vector<Int> &receiverIds = Vector<Int>())
Int fill(Int polarizationId, Int specWinId)
Int dataDescriptionId(uInt whichReceiver) const
const Vector<Int> &dataDescriptionIds() const
Int nrec() const
void setCacheSize(uInt newCacheSize)
uInt getCacheSize() const
void flush()
Private Members
void init(MSDataDescription &msDataDesc)
Int checkAndFill(Int polarizationId, Int specWinId, Int receiverId)
GBTMSDataDescFiller(const GBTMSDataDescFiller &other)
void operator=(const GBTMSDataDescFiller &other)

Description

Review Status

Date Reviewed:
yyyy/mm/dd

Prerequisite

Etymology

This class puts GBT data (fills) into the MSDataDescription table.

Synopsis

This class puts the appropriate values for the GBT in an MSDataDescription table (which has been previously created as part of a MeasurementSet). On each fill() any necessary additions to the MSDataDescription are made. This filler keeps a certain number of the most recent data descriptionn IDs and the information that makes them unique in a cache. If a new set of information matches that cached information, that ID is reused, otherwise new rows are added to the MSDataDescription table.

It will often be the case that several spectral window ids are filled at the same time, hence it is necessary to fill several data descriptions at the same time. During a fill, these are associated with a specific receiver id.

The data description Ids are available to be used by other GBTMS*Fillers as other subtables are filled in turn.

Until the GBT polarization and spectral window information is fully available, the data description also includes a NS_GBT_RECEIVER_ID column. This column is a key into the GBT_type_* tables.

Example

Motivation

Writing a filler is a daunting task. There are various dependencies between the subtables. It helps to encapsulate the knowlege and task of filling a specific subtable to separate classes.

Member Description

GBTMSDataDescFiller()

The default ctor. No MSDataDescriotion table has been attached yet. Calling fill on such a filler will throw an exception. It is present so that this object can be instantiated before an MSDataDescription has been created.

GBTMSDataDescFiller(MSDataDescription &msDataDesc)

A filler attached to an MSDataDescription table

~GBTMSDataDescFiller()

void attach(MSDataDescription &msDataDesc)

attach it to an MSDataDescription

void fill(Int polarizationId, const Vector<Int> &specWinIds, const Vector<Int> &receiverIds = Vector<Int>())

fill using the given polarization ID and spectral window ids

Int fill(Int polarizationId, Int specWinId)

Int dataDescriptionId(uInt whichReceiver) const

What is the data description ID associated with the indicated receiver? Returns -1 if there is no association yet

const Vector<Int> &dataDescriptionIds() const

Return a vector of the most recently filled data description ids

Int nrec() const

The number of receivers which currently have known data description ids from the last fill().

void setCacheSize(uInt newCacheSize)

set the cache size - max number of data description ids and their associate information to keep, this always re-initializes the cache from the DATA_DESCRIPTION table making it potentially expensive to use.

uInt getCacheSize() const

get the cache size

void flush()

flush the underlying MS subtable

void init(MSDataDescription &msDataDesc)

initialize the above for the first time

Int checkAndFill(Int polarizationId, Int specWinId, Int receiverId)

check and optionally fill a row from the index returns the Id

GBTMSDataDescFiller(const GBTMSDataDescFiller &other)

undefined and unavailable

void operator=(const GBTMSDataDescFiller &other)