Ignore:
Timestamp:
02/28/06 10:47:19 (18 years ago)
Author:
mar637
Message:

added assignment operator and additional constructor

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/STSubTable.cpp

    r808 r849  
    1515#include <tables/Tables/ScaColDesc.h>
    1616
     17#include "Scantable.h"
    1718#include "STSubTable.h"
     19
    1820
    1921using namespace casa;
     
    2123namespace asap {
    2224
    23 STSubTable::STSubTable(const casa::String& name, casa::Table::TableType tt) :
    24   type_(tt)
    25 
     25STSubTable::STSubTable( const Scantable& parent, const casa::String& name )
    2626{
    2727  TableDesc td("", "1", TableDesc::Scratch);
    2828  td.addColumn(ScalarColumnDesc<uInt>("ID"));
    29   SetupNewTable aNewTab(name, td, Table::New);
    30   table_ = Table(aNewTab, tableType());
     29  String tabname = parent.table().tableName()+"/"+name;
     30  SetupNewTable aNewTab(tabname, td, Table::New);
     31  table_ = Table(aNewTab, parent.table().tableType());
    3132  idCol_.attach(table_,"ID");
    3233
    3334}
     35STSubTable::STSubTable(Table tab)
     36{
     37  table_ = tab;
     38  idCol_.attach(table_,"ID");
     39}
     40
    3441
    3542STSubTable::~STSubTable()
     
    3744}
    3845
     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;
    3953}
     54
     55
     56}
Note: See TracChangeset for help on using the changeset viewer.