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 | List of all members
casacore::SetupNewTableRep Class Reference

Representation for handle class SetupNewTable. More...

#include <SetupNewTab.h>

Public Member Functions

 SetupNewTableRep (const String &tableName, const String &tableDescName, Table::TableOption, const StorageOption &)
 Create a new table using the table description with the given name. More...
 
 SetupNewTableRep (const String &tableName, const TableDesc &, Table::TableOption, const StorageOption &)
 Create a new table using the given table description. More...
 
 ~SetupNewTableRep ()
 
uIntcount ()
 Get access to the reference count. More...
 
const Stringname () const
 Get the name of the table. More...
 
int option () const
 Get the table create option. More...
 
const StorageOptionstorageOption () const
 Get the storage option. More...
 
Bool isMarkedForDelete () const
 Test if the table is marked for delete. More...
 
const TableDesctableDesc () const
 Get the table description. More...
 
void bindColumn (const String &columnName, const DataManager &)
 Bind a column to the given data manager. More...
 
void bindColumn (const String &columnName, const String &otherColumn)
 Bind a column to the given data manager of the other column. More...
 
void bindGroup (const String &columnGroup, const DataManager &, Bool rebind=False)
 Bind a group of columns to the given data manager. More...
 
void bindAll (const DataManager &, Bool rebind=False)
 Bind all columns to the given data manager. More...
 
void bindCreate (const Record &spec)
 Create data managers and bind the columns using the specifications in the given record (which is obtained using Table::dataManagerInfo()). More...
 
void setShapeColumn (const String &columnName, const IPosition &shape)
 Define the shape of fixed shaped arrays in a column. More...
 
Bool isUsed () const
 Test if object is already in use. More...
 
ColumnSetcolumnSetPtr ()
 Get pointer to column set. More...
 
TableDesctableDescPtr ()
 Get pointer to table description. More...
 
void setInUse ()
 Set object to in use by a (Plain)Table object. More...
 
void handleUnbound ()
 Make a data manager for all unbound columns. More...
 

Private Member Functions

 SetupNewTableRep (const SetupNewTableRep &)
 Copy constructor is forbidden, because copying a table requires some more knowledge (like table name of result). More...
 
SetupNewTableRepoperator= (const SetupNewTableRep &)
 Assignment is forbidden, because copying a table requires some more knowledge (like table name of result). More...
 
void setup ()
 Setup the new table. More...
 
DataManagergetDataManager (const DataManager &dataMan)
 Get the internal data manager object for the given data manager. More...
 

Private Attributes

uInt count_p
 Reference count. More...
 
String tabName_p
 Table name. More...
 
int option_p
 Constructor options. More...
 
StorageOption storageOpt_p
 
Bool delete_p
 Marked for delete? More...
 
TableDesctdescPtr_p
 
ColumnSetcolSetPtr_p
 
std::map< void *, void * > dataManMap_p
 

Detailed Description

Representation for handle class SetupNewTable.

Intended use:

Internal

Review Status

Reviewed By:
bglenden
Date Reviewed:
12AUG94
Test programs:
None

Prerequisite

Etymology

SetupNewTableRep is the representation of class SetupNewTable.

Synopsis

SetupNewTableRep is the representation of class SetupNewTable. Its functionality is described there.

Motivation

Copying a SetupNewTable object as such is very difficult, if not impossible. However, being able to use a SetupNewTable copy constructor was required to be able to have (static) functions constructing a SetupNewTable object and return it by value (as done for example by ForwardColumn::setupNewTable). Therefore SetupNewTable is implemented using the handle idiom. SetupNewTable is the interface (i.e. the handle) for the user, while underneath SetupNewTableRep is doing all the work. The SetupNewTable copy constructor can simply copy yhe pointer to the underlying SetupNewTableRep object.

To Do

Definition at line 93 of file SetupNewTab.h.

Constructor & Destructor Documentation

casacore::SetupNewTableRep::SetupNewTableRep ( const String tableName,
const String tableDescName,
Table::TableOption  ,
const StorageOption  
)

Create a new table using the table description with the given name.

The description will be read from a file.

casacore::SetupNewTableRep::SetupNewTableRep ( const String tableName,
const TableDesc ,
Table::TableOption  ,
const StorageOption  
)

Create a new table using the given table description.

casacore::SetupNewTableRep::~SetupNewTableRep ( )
casacore::SetupNewTableRep::SetupNewTableRep ( const SetupNewTableRep )
private

Copy constructor is forbidden, because copying a table requires some more knowledge (like table name of result).

Declaring it private, makes it unusable.

Member Function Documentation

void casacore::SetupNewTableRep::bindAll ( const DataManager ,
Bool  rebind = False 
)

Bind all columns to the given data manager.

The flag rebind tells if the binding of an already bound column will be overwritten. It cannot be used anymore once the SetupNewTableRep object is used to construct a Table object.

Referenced by casacore::SetupNewTable::bindAll().

void casacore::SetupNewTableRep::bindColumn ( const String columnName,
const DataManager  
)

Bind a column to the given data manager.

If already bound, the binding will be overwritten. It cannot be used anymore once the SetupNewTableRep object is used to construct a Table object.

Referenced by casacore::SetupNewTable::bindColumn().

void casacore::SetupNewTableRep::bindColumn ( const String columnName,
const String otherColumn 
)

Bind a column to the given data manager of the other column.

If the other column is not bound, nothing will be done. If columnName is already bound, the binding will be overwritten. It cannot be used anymore once the SetupNewTableRep object is used to construct a Table object.

void casacore::SetupNewTableRep::bindCreate ( const Record spec)

Create data managers and bind the columns using the specifications in the given record (which is obtained using Table::dataManagerInfo()).

Referenced by casacore::SetupNewTable::bindCreate().

void casacore::SetupNewTableRep::bindGroup ( const String columnGroup,
const DataManager ,
Bool  rebind = False 
)

Bind a group of columns to the given data manager.

The flag rebind tells if the binding of an already bound column will be overwritten. It cannot be used anymore once the SetupNewTableRep object is used to construct a Table object.

Referenced by casacore::SetupNewTable::bindGroup().

ColumnSet* casacore::SetupNewTableRep::columnSetPtr ( )
inline

Get pointer to column set.

This function is used by PlainTable.

Definition at line 181 of file SetupNewTab.h.

References colSetPtr_p.

Referenced by casacore::SetupNewTable::columnSetPtr().

uInt& casacore::SetupNewTableRep::count ( )
inline

Get access to the reference count.

Definition at line 108 of file SetupNewTab.h.

References count_p.

DataManager* casacore::SetupNewTableRep::getDataManager ( const DataManager dataMan)
private

Get the internal data manager object for the given data manager.

If it does not exist yet, it will be cloned and stored internally.

void casacore::SetupNewTableRep::handleUnbound ( )

Make a data manager for all unbound columns.

Referenced by casacore::SetupNewTable::handleUnbound().

Bool casacore::SetupNewTableRep::isMarkedForDelete ( ) const
inline

Test if the table is marked for delete.

Definition at line 124 of file SetupNewTab.h.

References delete_p.

Referenced by casacore::SetupNewTable::isMarkedForDelete().

Bool casacore::SetupNewTableRep::isUsed ( ) const
inline

Test if object is already in use.

Definition at line 176 of file SetupNewTab.h.

References colSetPtr_p, casacore::False, and casacore::True.

Referenced by casacore::SetupNewTable::isUsed().

const String& casacore::SetupNewTableRep::name ( ) const
inline

Get the name of the table.

Definition at line 112 of file SetupNewTab.h.

References tabName_p.

Referenced by casacore::SetupNewTable::name().

SetupNewTableRep& casacore::SetupNewTableRep::operator= ( const SetupNewTableRep )
private

Assignment is forbidden, because copying a table requires some more knowledge (like table name of result).

Declaring it private, makes it unusable.

int casacore::SetupNewTableRep::option ( ) const
inline

Get the table create option.

Definition at line 116 of file SetupNewTab.h.

References option_p.

Referenced by casacore::SetupNewTable::option().

void casacore::SetupNewTableRep::setInUse ( )
inline

Set object to in use by a (Plain)Table object.

This function is used by PlainTable.

Definition at line 191 of file SetupNewTab.h.

References colSetPtr_p.

Referenced by casacore::SetupNewTable::setInUse().

void casacore::SetupNewTableRep::setShapeColumn ( const String columnName,
const IPosition shape 
)

Define the shape of fixed shaped arrays in a column.

The shape of those arrays has to be known before the table can be constructed. It has to be defined via this function, if it was not already defined in the column description. If only the dimensionality was defined in the column description, the shape's dimensionality must match it. Calling this function for an non-fixed shaped array results in an exception. It cannot be used anymore once the SetupNewTableRep object is used to construct a Table object.

Referenced by casacore::SetupNewTable::setShapeColumn().

void casacore::SetupNewTableRep::setup ( )
private

Setup the new table.

This checks various things and creates the set of columns.

const StorageOption& casacore::SetupNewTableRep::storageOption ( ) const
inline

Get the storage option.

Definition at line 120 of file SetupNewTab.h.

References storageOpt_p.

Referenced by casacore::SetupNewTable::storageOption().

const TableDesc& casacore::SetupNewTableRep::tableDesc ( ) const
inline

Get the table description.

Definition at line 128 of file SetupNewTab.h.

References tdescPtr_p.

Referenced by casacore::SetupNewTable::tableDesc().

TableDesc* casacore::SetupNewTableRep::tableDescPtr ( )
inline

Get pointer to table description.

This function is used by PlainTable.

Definition at line 186 of file SetupNewTab.h.

References tdescPtr_p.

Referenced by casacore::SetupNewTable::adjustHypercolumns(), and casacore::SetupNewTable::tableDescPtr().

Member Data Documentation

ColumnSet* casacore::SetupNewTableRep::colSetPtr_p
private

Definition at line 208 of file SetupNewTab.h.

Referenced by columnSetPtr(), isUsed(), and setInUse().

uInt casacore::SetupNewTableRep::count_p
private

Reference count.

Definition at line 199 of file SetupNewTab.h.

Referenced by count().

std::map<void*,void*> casacore::SetupNewTableRep::dataManMap_p
private

Definition at line 209 of file SetupNewTab.h.

Bool casacore::SetupNewTableRep::delete_p
private

Marked for delete?

Definition at line 206 of file SetupNewTab.h.

Referenced by isMarkedForDelete().

int casacore::SetupNewTableRep::option_p
private

Constructor options.

Definition at line 203 of file SetupNewTab.h.

Referenced by option().

StorageOption casacore::SetupNewTableRep::storageOpt_p
private

Definition at line 204 of file SetupNewTab.h.

Referenced by storageOption().

String casacore::SetupNewTableRep::tabName_p
private

Table name.

Definition at line 201 of file SetupNewTab.h.

Referenced by name().

TableDesc* casacore::SetupNewTableRep::tdescPtr_p
private

Definition at line 207 of file SetupNewTab.h.

Referenced by tableDesc(), and tableDescPtr().


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