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

GBTMSDataDescFiller fills the MSDataDescription table for GBT fillers. More...

#include <GBTMSDataDescFiller.h>

List of all members.

Public Member Functions

 GBTMSDataDescFiller ()
 The default ctor.
 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

Private Member Functions

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)

Private Attributes

MSDataDescription * msDataDesc_p
MSDataDescColumns * msDataDescCols_p
Vector< Int > dataDescIds_p
 The current Ids.
Block< Int > receiverMap_p
 The map from receiver number to data description ID for the current set of Ids dataDescIds_p(receiverMap_p[whichReceiver]);.
Table * theCache_p
 the table holding the cache, its temporary
TableColumn idCacheCol_p
 the columns in the cache
TableColumn spWinIdCacheCol_p
TableColumn polIdCacheCol_p
TableColumn receiverIdCacheCol_p
TableColumn receiverIdCol_p
 The NS_GBT_RECEIVER_ID column in the actual table.
ColumnsIndex * cacheIndx_p
 The ColumnsIndex for the cache.
RecordFieldPtr< Int > spWinIdKey_p
 The pointers to the fields in the index key.
RecordFieldPtr< Int > polIdKey_p
RecordFieldPtr< Int > receiverIdKey_p
uInt nextCacheRow_p
 The next row number to get trashed in the cache when a new ID is generated.
uInt cacheSize_p
 The maximum number of rows in the cache (cache size)

Detailed Description

GBTMSDataDescFiller fills the MSDataDescription table for GBT fillers.

Intended use:

Internal

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.

Definition at line 102 of file GBTMSDataDescFiller.h.


Constructor & Destructor Documentation

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::GBTMSDataDescFiller ( MSDataDescription &  msDataDesc)

A filler attached to an MSDataDescription table.

undefined and unavailable


Member Function Documentation

void GBTMSDataDescFiller::attach ( MSDataDescription &  msDataDesc)

attach it to an MSDataDescription

Int GBTMSDataDescFiller::checkAndFill ( Int  polarizationId,
Int  specWinId,
Int  receiverId 
) [private]

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

Int GBTMSDataDescFiller::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>& GBTMSDataDescFiller::dataDescriptionIds ( ) const [inline]

Return a vector of the most recently filled data description ids.

Definition at line 131 of file GBTMSDataDescFiller.h.

References dataDescIds_p.

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

fill using the given polarization ID and spectral window ids

Int GBTMSDataDescFiller::fill ( Int  polarizationId,
Int  specWinId 
)
void GBTMSDataDescFiller::flush ( ) [inline]

flush the underlying MS subtable

Definition at line 147 of file GBTMSDataDescFiller.h.

References msDataDesc_p.

uInt GBTMSDataDescFiller::getCacheSize ( ) const [inline]

get the cache size

Definition at line 144 of file GBTMSDataDescFiller.h.

References cacheSize_p.

void GBTMSDataDescFiller::init ( MSDataDescription &  msDataDesc) [private]

initialize the above for the first time

Int GBTMSDataDescFiller::nrec ( ) const [inline]

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

Definition at line 135 of file GBTMSDataDescFiller.h.

References receiverMap_p.

void GBTMSDataDescFiller::operator= ( const GBTMSDataDescFiller other) [private]
void GBTMSDataDescFiller::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.


Member Data Documentation

ColumnsIndex* GBTMSDataDescFiller::cacheIndx_p [private]

The ColumnsIndex for the cache.

Definition at line 171 of file GBTMSDataDescFiller.h.

The maximum number of rows in the cache (cache size)

Definition at line 180 of file GBTMSDataDescFiller.h.

Referenced by getCacheSize().

Vector<Int> GBTMSDataDescFiller::dataDescIds_p [private]

The current Ids.

Definition at line 154 of file GBTMSDataDescFiller.h.

Referenced by dataDescriptionIds().

TableColumn GBTMSDataDescFiller::idCacheCol_p [private]

the columns in the cache

Definition at line 165 of file GBTMSDataDescFiller.h.

MSDataDescription* GBTMSDataDescFiller::msDataDesc_p [private]

Definition at line 150 of file GBTMSDataDescFiller.h.

Referenced by flush().

MSDataDescColumns* GBTMSDataDescFiller::msDataDescCols_p [private]

Definition at line 151 of file GBTMSDataDescFiller.h.

The next row number to get trashed in the cache when a new ID is generated.

Definition at line 177 of file GBTMSDataDescFiller.h.

TableColumn GBTMSDataDescFiller::polIdCacheCol_p [private]

Definition at line 165 of file GBTMSDataDescFiller.h.

RecordFieldPtr<Int> GBTMSDataDescFiller::polIdKey_p [private]

Definition at line 174 of file GBTMSDataDescFiller.h.

Definition at line 165 of file GBTMSDataDescFiller.h.

TableColumn GBTMSDataDescFiller::receiverIdCol_p [private]

The NS_GBT_RECEIVER_ID column in the actual table.

Definition at line 168 of file GBTMSDataDescFiller.h.

RecordFieldPtr<Int> GBTMSDataDescFiller::receiverIdKey_p [private]

Definition at line 174 of file GBTMSDataDescFiller.h.

Block<Int> GBTMSDataDescFiller::receiverMap_p [private]

The map from receiver number to data description ID for the current set of Ids dataDescIds_p(receiverMap_p[whichReceiver]);.

Definition at line 159 of file GBTMSDataDescFiller.h.

Referenced by nrec().

Definition at line 165 of file GBTMSDataDescFiller.h.

RecordFieldPtr<Int> GBTMSDataDescFiller::spWinIdKey_p [private]

The pointers to the fields in the index key.

Definition at line 174 of file GBTMSDataDescFiller.h.

the table holding the cache, its temporary

Definition at line 162 of file GBTMSDataDescFiller.h.


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