casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
casa::FlagVersion Class Reference

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

#include <FlagVersion.h>

Public Member Functions

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

Private Member Functions

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

Private Attributes

casacore::String verlistfile_p
 
casacore::String flagtablename_p
 
casacore::String dataflagcolname_p
 
casacore::String rowflagcolname_p
 
casacore::Table tab_p
 
casacore::String tabname_p
 
casacore::Vector
< casacore::String
versionlist_p
 
casacore::Vector
< casacore::String
commentlist_p
 
casacore::Bool fcol_p
 
casacore::Bool frcol_p
 
unsigned nrows_p
 
casacore::Table subflagtable_p
 
casacore::File file_p
 
SLoglog
 

Static Private Attributes

static casacore::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 110 of file FlagVersion.h.

Constructor & Destructor Documentation

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

Constructor.

virtual casa::FlagVersion::~FlagVersion ( )
virtual

Destructor.

Member Function Documentation

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

Specify the casacore::Table column names to use as flag columns.

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

casacore::Bool casa::FlagVersion::clearAllFlags ( )

Clear all main table flags.

casacore::Bool casa::FlagVersion::deleteFlagVersion ( casacore::String  versionname)

Delete a version.

This does not touch or update the main table

casacore::Bool casa::FlagVersion::doesVersionExist ( casacore::String  versionname)
private
void casa::FlagVersion::FlagVersionError ( casacore::String  msg)
private
casacore::Vector<casacore::String> casa::FlagVersion::getVersionList ( )

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 121 of file FlagVersion.h.

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

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

casacore::Bool casa::FlagVersion::saveFlagsInto ( casacore::Table fromFTab,
casacore::Table toFTab,
casacore::String  merge = casacore::String("replace") 
)
private
casacore::Bool casa::FlagVersion::saveFlagVersion ( casacore::String  versionname,
casacore::String  comment,
casacore::String  merge = casacore::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

casacore::String casa::FlagVersion::clname
staticprivate

Definition at line 173 of file FlagVersion.h.

casacore::Vector<casacore::String> casa::FlagVersion::commentlist_p
private

Definition at line 164 of file FlagVersion.h.

casacore::String casa::FlagVersion::dataflagcolname_p
private

Definition at line 158 of file FlagVersion.h.

casacore::Bool casa::FlagVersion::fcol_p
private

Definition at line 165 of file FlagVersion.h.

casacore::File casa::FlagVersion::file_p
private

Definition at line 170 of file FlagVersion.h.

casacore::String casa::FlagVersion::flagtablename_p
private

Definition at line 157 of file FlagVersion.h.

casacore::Bool casa::FlagVersion::frcol_p
private

Definition at line 165 of file FlagVersion.h.

SLog* casa::FlagVersion::log
private

Definition at line 172 of file FlagVersion.h.

unsigned casa::FlagVersion::nrows_p
private

Definition at line 166 of file FlagVersion.h.

casacore::String casa::FlagVersion::rowflagcolname_p
private

Definition at line 159 of file FlagVersion.h.

casacore::Table casa::FlagVersion::subflagtable_p
private

Definition at line 168 of file FlagVersion.h.

casacore::Table casa::FlagVersion::tab_p
private

Definition at line 161 of file FlagVersion.h.

casacore::String casa::FlagVersion::tabname_p
private

Definition at line 162 of file FlagVersion.h.

casacore::String casa::FlagVersion::verlistfile_p
private

Definition at line 156 of file FlagVersion.h.

casacore::Vector<casacore::String> casa::FlagVersion::versionlist_p
private

Definition at line 163 of file FlagVersion.h.


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