GBTMSObservationFiller.h

Classes

GBTMSObservationFiller -- GBTMSObservationFiller fills the MSObservation table for GBT fillers (full description)

class GBTMSObservationFiller

Interface

Public Members
GBTMSObservationFiller()
GBTMSObservationFiller(MSObservation &msObservation)
~GBTMSObservationFiller()
void attach(MSObservation &msObservation)
void fill(const String &project, const String &observer, const MVTime &timestamp, Double duration, const String &telescope)
Int observationId() const
const String &project() const
void flush()
Private Members
void init(MSObservation &msObservation)
GBTMSObservationFiller(const GBTMSObservationFiller &other)
void operator=(const GBTMSObservationFiller &other)

Description

Review Status

Date Reviewed:
yyyy/mm/dd

Prerequisite

Etymology

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

Synopsis

This class puts the appropriate values for the GBT in an MSObservation table (which has been previously created as part of a MeasurementSet). On each fill() any necessary additions to the MSObservation are made. Each fill() adds a new row to the MSObservation table.

The observationId is available to be used by other GBTMS*Fillers as other subtables are filled in turn.

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

GBTMSObservationFiller()

The default ctor. No MSObservation 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 MSObservation has been created.

GBTMSObservationFiller(MSObservation &msObservation)

A filler attached to an MSObservation table

~GBTMSObservationFiller()

void attach(MSObservation &msObservation)

attach it to an MSObservation

void fill(const String &project, const String &observer, const MVTime &timestamp, Double duration, const String &telescope)

fill - adds a new row to the observation table whenever project, observer or telescope, changes. other content to add will be added here as it becomes available e.g. OBS_SCHEDULE The timestamp and duration are used to adjust that TIME_RANGE so that the current project row extends at least from timestamp to timestamp+duration.

Int observationId() const

this is the row number of the most recently "filled" MSObservation row it returns -1 if nothing has been filled yet

const String &project() const

its easier to just cache the most recent project here

void flush()

flush the underlying MS subtable

void init(MSObservation &msObservation)

initialize the above for the first time

GBTMSObservationFiller(const GBTMSObservationFiller &other)

undefined and unavailable

void operator=(const GBTMSObservationFiller &other)