Main Page   Modules   Namespace List   Class Hierarchy   Alphabetical List   Compound List   Compound Members   Related Pages  

CCfits::Table Class Reference

#include <Table.h>

Inheritance diagram for CCfits::Table::

Inheritance diagram
CCfits::ExtHDU CCfits::HDU CCfits::AsciiTable CCfits::BinTable List of all members.

Public Methods

 Table (const Table &right)
virtual ~Table ()
const std::map<string,Column*>& column () const
virtual Columncolumn (const string &colName) const
virtual Columncolumn (int colIndex) const
virtual long rows () const
void updateRows ()
void rows (long numRows)
virtual void deleteColumn (const string &name)
void insertRows (long first, long number=1)
void deleteRows (long first, long number=1)
void deleteRows (const std::vector< long > &rowList)
virtual std::map<string, Column*>& column ()

Protected Methods

 Table (FITSBase *p, HduType xtype, const string &hduName, int rows, const std::vector< string > &columnName, const std::vector< string > &columnFmt, const std::vector< string > &columnUnit=std::vector< string >(), int version=1)
 Table (FITSBase *p, HduType xtype, const string &hduName=string(""), int version=1)
 Table (FITSBase *p, HduType xtype, int number)
void init (bool readFlag=false, const std::vector< string > &keys=std::vector< string >())
virtual void column (const string &colname, Column *value)
int numCols () const
void numCols (int value)

Detailed Description

Table is the abstract common interface to Binary and Ascii Table HDUs.

Table is a subclass of ExtHDU that contains an associative array of Column objects. It implements methods for reading and writing columns


Constructor & Destructor Documentation

CCfits::Table::Table ( const Table & right )
 

copy constructor.

CCfits::Table::~Table ( ) [virtual]
 

destructor.

CCfits::Table::Table ( FITSBase * p,
HduType xtype,
const string & hduName,
int rows,
const std::vector< string > & columnName,
const std::vector< string > & columnFmt,
const std::vector< string > & columnUnit = std::vector<string>(),
int version = 1 ) [protected]
 

Constructor to be used for creating new HDUs.

Parameters:
p   The FITS file in which to place the new HDU
rows   The number of rows in the new HDU (the value of the NAXIS2 keyword).
columnType   a vector of types for the columns.
columnName   a vector of names for the columns.
columnFmt   the format strings for the columns
columnUnit   the units for the columns.
version   a version number

CCfits::Table::Table ( FITSBase * p,
HduType xtype,
const string & hduName = string(""),
int version = 1 ) [protected]
 

Constructor to be called by operations that read Table specified by hduName and version.

Parameters:
xtype   The type of the Table (AsciiTbl or BinaryTbl)

CCfits::Table::Table ( FITSBase * p,
HduType xtype,
int number ) [protected]
 

Table constructor for getting Tables by number.

Necessary since EXTNAME is a reserved not required keyword, and users may thus read FITS files without an extension name. Since an HDU is completely specified by extension number, this is part of the public interface.


Member Function Documentation

void CCfits::Table::column ( const string & colname,
Column * value ) [protected, virtual]
 

set the column with name colname to the input value.

Reimplemented from CCfits::ExtHDU.

std::map< string, Column *> & CCfits::Table::column ( ) [inline, virtual]
 

return a reference to the array containing the columns.

To be used in the implementation of subclasses.

Column & CCfits::Table::column ( int colIndex ) const [virtual]
 

return a reference to the column identified by colIndex.

Throws NoSuchColumn if the index is out of range -index must satisfy (1 <= index <= numCols() ).

N.B. the column number is assigned as 1-based, as in FORTRAN rather than 0-based as in C.

Exceptions:
Table::NoSuchColumn   passes colIndex to the diagnostic message printed when the exception is thrown

Reimplemented from CCfits::ExtHDU.

Column & CCfits::Table::column ( const string & colName ) const [virtual]
 

return a reference to the column of name colName.

Exceptions:
Table::NoSuchColumn   passes colName to the diagnostic message printed when the exception is thrown

Reimplemented from CCfits::ExtHDU.

const std::map< string, Column *> & CCfits::Table::column ( ) const [inline]
 

return a reference to the array containing the columns.

This public version might be used to query the size of the column container in a routine that manipulates column table data.

void CCfits::Table::deleteColumn ( const string & name ) [virtual]
 

delete a column in a Table extension by name.

Parameters:
columnName   The name of the column to be deleted.
Exceptions:
WrongExtensionType   if extension is an image.

Reimplemented from CCfits::ExtHDU.

void CCfits::Table::deleteRows ( const std::vector< long > & rowList )
 

delete a set of rows in the table specified by an input array.

Parameters:
rowlist   The vector of row numbers to be deleted.
Exceptions:
FitsError   thrown if the underlying cfitsio call fails to return without error.

void CCfits::Table::deleteRows ( long first,
long number = 1 )
 

delete a range of rows in a table.

In both this and the overloaded version which allows a selection of rows to be deleted, the cfitsio library is called first to perform the operation on the disk file, and then the FITS object is updated.

Parameters:
first   the start row of the range
number   the number of rows to delete; defaults to 1.
Exceptions:
FitsError   thrown if the cfitsio call fails to return without error.

void CCfits::Table::init ( bool readFlag = false,
const std::vector< string > & keys = std::vector<string>() ) [protected]
 

"Late Constructor." wrap-up of calls needed to construct a table. Reads header information and sets up the array of column objects in the table.

Protected function, provided to allow the implementation of extensions of the library.

void CCfits::Table::insertRows ( long first,
long number = 1 )
 

insert empty rows into the table.

Parameters:
first   the start row of the range
number   the number of rows to insert.
Exceptions:
FitsError   thrown if the underlying cfitsio call fails to return without error.

void CCfits::Table::numCols ( int value ) [inline, protected]
 

set the number of Columns in the Table.

int CCfits::Table::numCols ( ) const [inline, protected]
 

return the number of Columns in the Table (the TFIELDS keyword).

void CCfits::Table::rows ( long numRows ) [inline]
 

set the number of rows in the Table.

long CCfits::Table::rows ( ) const [inline, virtual]
 

return the number of rows in the table (NAXIS2).

Reimplemented from CCfits::ExtHDU.

void CCfits::Table::updateRows ( )
 

update the number of rows in the table.

Called to force the Table to reset its internal "rows" attribute. public, but is called when needed internally.


The documentation for this class was generated from the following files:
Generated at Fri Apr 11 16:05:13 2003 for CCfits by doxygen1.2.7 written by Dimitri van Heesch, © 1997-2001