Last change
on this file since 853 was
849,
checked in by mar637, 18 years ago
|
added assignment operator and additional constructor
|
File size:
1.1 KB
|
Rev | Line | |
---|
[808] | 1 | // |
---|
| 2 | // C++ Implementation: STSubTable |
---|
| 3 | // |
---|
| 4 | // Description: |
---|
| 5 | // |
---|
| 6 | // |
---|
| 7 | // Author: Malte Marquarding <asap@atnf.csiro.au>, (C) 2006 |
---|
| 8 | // |
---|
| 9 | // Copyright: See COPYING file that comes with this distribution |
---|
| 10 | // |
---|
| 11 | // |
---|
| 12 | #include <casa/Exceptions/Error.h> |
---|
| 13 | #include <tables/Tables/TableDesc.h> |
---|
| 14 | #include <tables/Tables/SetupNewTab.h> |
---|
| 15 | #include <tables/Tables/ScaColDesc.h> |
---|
| 16 | |
---|
[849] | 17 | #include "Scantable.h" |
---|
[808] | 18 | #include "STSubTable.h" |
---|
| 19 | |
---|
[849] | 20 | |
---|
[808] | 21 | using namespace casa; |
---|
| 22 | |
---|
| 23 | namespace asap { |
---|
| 24 | |
---|
[849] | 25 | STSubTable::STSubTable( const Scantable& parent, const casa::String& name ) |
---|
[808] | 26 | { |
---|
| 27 | TableDesc td("", "1", TableDesc::Scratch); |
---|
| 28 | td.addColumn(ScalarColumnDesc<uInt>("ID")); |
---|
[849] | 29 | String tabname = parent.table().tableName()+"/"+name; |
---|
| 30 | SetupNewTable aNewTab(tabname, td, Table::New); |
---|
| 31 | table_ = Table(aNewTab, parent.table().tableType()); |
---|
[808] | 32 | idCol_.attach(table_,"ID"); |
---|
| 33 | |
---|
| 34 | } |
---|
[849] | 35 | STSubTable::STSubTable(Table tab) |
---|
| 36 | { |
---|
| 37 | table_ = tab; |
---|
| 38 | idCol_.attach(table_,"ID"); |
---|
| 39 | } |
---|
[808] | 40 | |
---|
[849] | 41 | |
---|
[808] | 42 | STSubTable::~STSubTable() |
---|
| 43 | { |
---|
| 44 | } |
---|
| 45 | |
---|
[849] | 46 | STSubTable& asap::STSubTable::operator=( const STSubTable& other) |
---|
| 47 | { |
---|
| 48 | if (&other != this) { |
---|
| 49 | this->table_ = other.table_; |
---|
| 50 | idCol_.attach(this->table_,"ID"); |
---|
| 51 | } |
---|
| 52 | return *this; |
---|
[808] | 53 | } |
---|
[849] | 54 | |
---|
| 55 | |
---|
| 56 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.