Loading...
Searching...
No Matches
casacore::TableInfo Class Reference
tables package (libcasa_tables) » Tables_module » Tables_module_internal_classes

More...

`#include <TableInfo.h>`

## Public Types

enum | Type { PAGEDIMAGE , PAGEDARRAY , MEASUREMENTSET , ANTENNA , ARRAY , FEED , FIELD , OBSERVATION , OBSLOG , SOURCE , SPECTRALWINDOW , SYSCAL , WEATHER , ME_CALIBRATION , LOG , COMPONENTLIST }
| enum for various standard Table types. More...

## Public Member Functions

| TableInfo ()
| Create an empty object.
| TableInfo (const String &fileName)
| Create the object reading it from the given file name.
| TableInfo (Type which)
| Create a TableInfo object of one of the predefined types.
| TableInfo (const TableInfo &that)
| Copy constructor (copy semantics).
TableInfo & | operator= (const TableInfo &that)
| Assignment (copy semantics).
| ~TableInfo ()
const String & | type () const
| Get the table (sub)type.
const String & | subType () const
const String & | readme () const
| Get the readme.
void | setType (const String &type)
| Set the table (sub)type.
void | setSubType (const String &subType)
void | readmeClear ()
| Clear the readme.
void | readmeAddLine (const String &readmeLine)
| Add a line to the readme.
void | flush (const String &fileName)
| Write the TableInfo object.

## Static Public Member Functions

static String | type (Type tableType)
| Convert the Type enumerator to a type and subType string.
static String | subType (Type tableType)

## Private Attributes

String | type_p
String | subType_p
String | readme_p
Bool | writeIt_p

## Detailed Description

Table type, subtype and further info

### Intended use:

Internal

### Review Status

Reviewed By:
  UNKNOWN
Date Reviewed:
  before2004/08/25
Test programs:
  tTable

### Etymology

TableInfo holds information (like type) about a table.

### Synopsis

TableInfo holds information about a table. It contains the following information:

Type
  the type of a table (e.g. IMAGE, LOG).
SubType
  the subtype of a table (e.g. UVDATA, MAP or ANTENNAPATTERN for type IMAGE).
Readme
  An arbitrary number of lines containing ancillary text describing the table (or maybe its history).

This information is stored in the file table.info in the table directory. Regular tables as well as reference tables (results of sort/select) have their own table.info file.
The initial table-info of a regular table is blank. It has to be set explicitly by the user.
The initial table-info of a reference table is a copy of the table-info of its parent table. The user can add lines to the readme information to describe the table in more detail. Of course, the type and/or subtype can be changed at will.

The type and subtype information are stored at the beginning of the first two lines of the file as:

Type = TypeString
SubType = SubTypeString
casacore::TableInfo::Type
Type
enum for various standard Table types.
Definition TableInfo.h:133

These lines in the table.info file can be used by external programs (like the filebrowser) to determine the type of table being handled.

The third line in the file is blank. The line(s) thereafter contain the possible readme information (note that multiple readme lines are possible). They can be added using the function readmeAddLine.

Existing tables do not have a table.info file yet. The table system will handle them correctly and use a blank type, subtype and readme string. A table.info file will be created when the table is opened for update.

To be sure that different table types have unique names, it can be useful to use enum's and to define them in one common file. For Casacore tables this enum is defined in this file.

### Example

// Open a table for update.
Table table("name", Table::Update);
// Get its TableInfo object.
TableInfo& info = table.tableInfo();
// Set type and subtype.
info.setType ("IMAGE");
info.setSubType ("SubTypeString");
// Add a few readme lines. The second one adds 2 lines.
info.readmeAddLine ("the first readme string");
info.readmeAddLine ("the second readme string\nthe third readme string");
// Display the type, etc.\.
cout << info.type() << " " << info.subType() << endl;
cout << info.readme();
casacore::TableInfo::readme
const String & readme() const
Get the readme.
Definition TableInfo.h:235
casacore::TableInfo::setType
void setType(const String &type)
Set the table (sub)type.
casacore::TableInfo::subType
const String & subType() const
Definition TableInfo.h:231
casacore::TableInfo::TableInfo
TableInfo()
Create an empty object.
casacore::TableInfo::type
const String & type() const
Get the table (sub)type.
Definition TableInfo.h:227
casacore::TableInfo::readmeAddLine
void readmeAddLine(const String &readmeLine)
Add a line to the readme.
casacore::TableInfo::setSubType
void setSubType(const String &subType)
casacore::Table
Definition Table.h:157
casacore::Table::Update
@ Update
update existing table
Definition Table.h:181

### Motivation

External programs need to be able to determine the type of a table.

Definition at line 128 of file TableInfo.h.

## Member Enumeration Documentation

## Type

enum casacore::TableInfo::Type

enum for various standard Table types.

Underscores in the enumerator indicate different sub-types

Enumerator
PAGEDIMAGE | a PagedImage is a PagedArray with coordinates and Masking (opt.)
PAGEDARRAY | a PagedArray (.../Lattices/PagedArray.h)
MEASUREMENTSET | MeasurementSet main Table.
ANTENNA | MeasurementSet Antenna table.
ARRAY | MeasurementSet Array table.
FEED | MeasurementSet Feed characteristics table.
FIELD | MeasurementSet Field table.
OBSERVATION | MeasurementSet Observation information table.
OBSLOG | MeasurementSet Oserving Log table.
SOURCE | MeasurementSet Source table.
SPECTRALWINDOW | MeasurementSet Spectral Window table.
SYSCAL | MeasurementSet System Calibration table.
WEATHER | MeasurementSet Weather table.
ME_CALIBRATION | Measurement Equation Calibration table.
LOG | Casacore Log table.
COMPONENTLIST | A ComponentList table contains parameterised representations of the sky brightness.

Definition at line 133 of file TableInfo.h.

## Constructor & Destructor Documentation

## TableInfo() [1/4]

casacore::TableInfo::TableInfo | ( |  | ) |

Create an empty object.

Referenced by operator=(), and TableInfo().

## TableInfo() [2/4]

casacore::TableInfo::TableInfo | ( | const String & | fileName | ) |

explicit

Create the object reading it from the given file name.

If the file does not exist, type, subtype and readme are initialized to a blank string.

## TableInfo() [3/4]

casacore::TableInfo::TableInfo | ( | Type | which | ) |

Create a TableInfo object of one of the predefined types.

This is a centralised way of setting the Table type only.

## TableInfo() [4/4]

casacore::TableInfo::TableInfo | ( | const TableInfo & | that | ) |

Copy constructor (copy semantics).

References TableInfo().

## ~TableInfo()

casacore::TableInfo::~TableInfo | ( |  | ) |

## Member Function Documentation

## flush()

void casacore::TableInfo::flush | ( | const String & | fileName | ) |

Write the TableInfo object.

## operator=()

TableInfo & casacore::TableInfo::operator= | ( | const TableInfo & | that | ) |

Assignment (copy semantics).

References TableInfo().

## readme()

const String & casacore::TableInfo::readme | ( |  | ) | const

inline

Get the readme.

Definition at line 235 of file TableInfo.h.

References readme_p.

## readmeAddLine()

void casacore::TableInfo::readmeAddLine | ( | const String & | readmeLine | ) |

Add a line to the readme.

It will itself add a newline character ('
') to the end of the line.

## readmeClear()

void casacore::TableInfo::readmeClear | ( |  | ) |

Clear the readme.

## setSubType()

void casacore::TableInfo::setSubType | ( | const String & | subType | ) |

References subType().

## setType()

void casacore::TableInfo::setType | ( | const String & | type | ) |

Set the table (sub)type.

References type().

## subType() [1/2]

const String & casacore::TableInfo::subType | ( |  | ) | const

inline

Definition at line 231 of file TableInfo.h.

References subType_p.

Referenced by setSubType().

## subType() [2/2]

String casacore::TableInfo::subType | ( | Type | tableType | ) |

static

## type() [1/2]

const String & casacore::TableInfo::type | ( |  | ) | const

inline

Get the table (sub)type.

Definition at line 227 of file TableInfo.h.

References type_p.

Referenced by setType().

## type() [2/2]

String casacore::TableInfo::type | ( | Type | tableType | ) |

static

Convert the Type enumerator to a type and subType string.

## Member Data Documentation

## readme_p

String casacore::TableInfo::readme_p

private

Definition at line 221 of file TableInfo.h.

Referenced by readme().

## subType_p

String casacore::TableInfo::subType_p

private

Definition at line 220 of file TableInfo.h.

Referenced by subType().

## type_p

String casacore::TableInfo::type_p

private

Definition at line 219 of file TableInfo.h.

Referenced by type().

## writeIt_p

Bool casacore::TableInfo::writeIt_p

private

Definition at line 222 of file TableInfo.h.

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

- tables/Tables/TableInfo.h