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

Class to generate and manage flag versions for Tables containing flag columns. More...

#include <FlagVersion.h>

List of all members.

Public Member Functions

 FlagVersion (String intab, String dataflagcolname, String rowflagcolname)
 Constructor.
virtual ~FlagVersion ()
 Destructor.
FlagVersionoperator= (const FlagVersion &)
 Operator= Equate by reference.
Vector< StringgetVersionList ()
 Get a list of entries from the version-list file for this table.
Bool attachFlagColumns (String version, ScalarColumn< Bool > &rowflag, ArrayColumn< Bool > &flags, Table &subtab)
 Specify the Table column names to use as flag columns.
Bool saveFlagVersion (String versionname, String comment, String merge=String("replace"))
 Save current main table flags into a separate version These keeps a copy in the main table too.
Bool restoreFlagVersion (String versionname, String merge=String("replace"))
 Copy flags from a flag version, into the main table.
Bool deleteFlagVersion (String versionname)
 Delete a version.
Bool clearAllFlags ()
 Clear all main table flags.

Private Member Functions

void FlagVersionError (String msg)
Bool readVersionList ()
Bool saveFlagsInto (Table &fromFTab, Table &toFTab, String merge=String("replace"))
Bool doesVersionExist (String versionname)

Private Attributes

String verlistfile_p
String flagtablename_p
String dataflagcolname_p
String rowflagcolname_p
Table tab_p
String tabname_p
Vector< Stringversionlist_p
Vector< Stringcommentlist_p
Bool fcol_p
Bool frcol_p
unsigned nrows_p
Table subflagtable_p
File file_p
SLoglog

Static Private Attributes

static String clname

Detailed Description

Class to generate and manage flag versions for Tables containing flag columns.

Prerequisite

Etymology

Manages Flag Versions.

Synopsis

This class creates and manages flag versions. A flag version as defined in this class has the following structure.

xxxx.ms xxxx.ms.flagversions

When first opened, a flagversions directory is created parallel to the original Table. This directory contains a text file : FLAG_VERSION_LIST that holds a list of string pairs version name : comment for this version.

The FLAG and FLAG_ROW columns of the main table are copied into new Tables with only two columns, whenever a new flag version is created. Flag versions can be merged using logical 'and', logical 'or', and 'replace' semantics. Flag versions can be restored to the main table of the MS.

At the end of a "save" or "restore" operation, the latest flags are always also in the main table.

Motivation

Thrown Exceptions

To Do

Definition at line 117 of file FlagVersion.h.


Constructor & Destructor Documentation

casa::FlagVersion::FlagVersion ( String  intab,
String  dataflagcolname,
String  rowflagcolname 
)

Constructor.

virtual casa::FlagVersion::~FlagVersion ( ) [virtual]

Destructor.


Member Function Documentation

Bool casa::FlagVersion::attachFlagColumns ( String  version,
ScalarColumn< Bool > &  rowflag,
ArrayColumn< Bool > &  flags,
Table subtab 
)

Specify the Table column names to use as flag columns.

For example, for a MS, they are "FLAG" and "FLAG_ROW".

Clear all main table flags.

Delete a version.

This does not touch or update the main table

Bool casa::FlagVersion::doesVersionExist ( String  versionname) [private]

Get a list of entries from the version-list file for this table.

FlagVersion& casa::FlagVersion::operator= ( const FlagVersion ) [inline]

Operator= Equate by reference.

Definition at line 128 of file FlagVersion.h.

Bool casa::FlagVersion::restoreFlagVersion ( String  versionname,
String  merge = String("replace") 
)

Copy flags from a flag version, into the main table.

Bool casa::FlagVersion::saveFlagsInto ( Table fromFTab,
Table toFTab,
String  merge = String("replace") 
) [private]
Bool casa::FlagVersion::saveFlagVersion ( String  versionname,
String  comment,
String  merge = String("replace") 
)

Save current main table flags into a separate version These keeps a copy in the main table too.

"merge" can be one of 'or','and','replace'


Member Data Documentation

String casa::FlagVersion::clname [static, private]

Definition at line 180 of file FlagVersion.h.

Definition at line 171 of file FlagVersion.h.

Definition at line 165 of file FlagVersion.h.

Definition at line 172 of file FlagVersion.h.

Definition at line 177 of file FlagVersion.h.

Definition at line 164 of file FlagVersion.h.

Definition at line 172 of file FlagVersion.h.

Definition at line 179 of file FlagVersion.h.

unsigned casa::FlagVersion::nrows_p [private]

Definition at line 173 of file FlagVersion.h.

Definition at line 166 of file FlagVersion.h.

Definition at line 175 of file FlagVersion.h.

Definition at line 168 of file FlagVersion.h.

Definition at line 169 of file FlagVersion.h.

Definition at line 163 of file FlagVersion.h.

Definition at line 170 of file FlagVersion.h.


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