casa
$Rev:20696$
|
Class to generate and manage flag versions for Tables containing flag columns. More...
#include <FlagVersion.h>
Public Member Functions | |
FlagVersion (String intab, String dataflagcolname, String rowflagcolname) | |
Constructor. | |
virtual | ~FlagVersion () |
Destructor. | |
FlagVersion & | operator= (const FlagVersion &) |
Operator= Equate by reference. | |
Vector< String > | getVersionList () |
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< String > | versionlist_p |
Vector< String > | commentlist_p |
Bool | fcol_p |
Bool | frcol_p |
unsigned | nrows_p |
Table | subflagtable_p |
File | file_p |
SLog * | log |
Static Private Attributes | |
static String | clname |
Class to generate and manage flag versions for Tables containing flag columns.
Manages Flag Versions.
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.
Definition at line 117 of file FlagVersion.h.
casa::FlagVersion::FlagVersion | ( | String | intab, |
String | dataflagcolname, | ||
String | rowflagcolname | ||
) |
Constructor.
virtual casa::FlagVersion::~FlagVersion | ( | ) | [virtual] |
Destructor.
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.
Bool casa::FlagVersion::deleteFlagVersion | ( | String | versionname | ) |
Delete a version.
This does not touch or update the main table
Bool casa::FlagVersion::doesVersionExist | ( | String | versionname | ) | [private] |
void casa::FlagVersion::FlagVersionError | ( | String | msg | ) | [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::readVersionList | ( | ) | [private] |
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'
String casa::FlagVersion::clname [static, private] |
Definition at line 180 of file FlagVersion.h.
Vector<String> casa::FlagVersion::commentlist_p [private] |
Definition at line 171 of file FlagVersion.h.
String casa::FlagVersion::dataflagcolname_p [private] |
Definition at line 165 of file FlagVersion.h.
Bool casa::FlagVersion::fcol_p [private] |
Definition at line 172 of file FlagVersion.h.
File casa::FlagVersion::file_p [private] |
Definition at line 177 of file FlagVersion.h.
String casa::FlagVersion::flagtablename_p [private] |
Definition at line 164 of file FlagVersion.h.
Bool casa::FlagVersion::frcol_p [private] |
Definition at line 172 of file FlagVersion.h.
SLog* casa::FlagVersion::log [private] |
Definition at line 179 of file FlagVersion.h.
unsigned casa::FlagVersion::nrows_p [private] |
Definition at line 173 of file FlagVersion.h.
String casa::FlagVersion::rowflagcolname_p [private] |
Definition at line 166 of file FlagVersion.h.
Table casa::FlagVersion::subflagtable_p [private] |
Definition at line 175 of file FlagVersion.h.
Table casa::FlagVersion::tab_p [private] |
Definition at line 168 of file FlagVersion.h.
String casa::FlagVersion::tabname_p [private] |
Definition at line 169 of file FlagVersion.h.
String casa::FlagVersion::verlistfile_p [private] |
Definition at line 163 of file FlagVersion.h.
Vector<String> casa::FlagVersion::versionlist_p [private] |
Definition at line 170 of file FlagVersion.h.