source: trunk/src/STSubTable.cpp@ 851

Last change on this file since 851 was 849, checked in by mar637, 19 years ago

added assignment operator and additional constructor

File size: 1.1 KB
Line 
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
17#include "Scantable.h"
18#include "STSubTable.h"
19
20
21using namespace casa;
22
23namespace asap {
24
25STSubTable::STSubTable( const Scantable& parent, const casa::String& name )
26{
27 TableDesc td("", "1", TableDesc::Scratch);
28 td.addColumn(ScalarColumnDesc<uInt>("ID"));
29 String tabname = parent.table().tableName()+"/"+name;
30 SetupNewTable aNewTab(tabname, td, Table::New);
31 table_ = Table(aNewTab, parent.table().tableType());
32 idCol_.attach(table_,"ID");
33
34}
35STSubTable::STSubTable(Table tab)
36{
37 table_ = tab;
38 idCol_.attach(table_,"ID");
39}
40
41
42STSubTable::~STSubTable()
43{
44}
45
46STSubTable& 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;
53}
54
55
56}
Note: See TracBrowser for help on using the repository browser.