Changeset 90


Ignore:
Timestamp:
11/12/04 12:16:44 (20 years ago)
Author:
mar637
Message:

added copy function
renaming and update according to SDMemTable changes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/SDMemTableWrapper.h

    r83 r90  
    4242
    4343public:
    44   SDMemTableWrapper(const std::string& name) : 
     44  SDMemTableWrapper(const std::string& name) :
    4545    table_(new SDMemTable(name)) {;}
    46   SDMemTableWrapper() : 
     46  SDMemTableWrapper() :
    4747    table_(new SDMemTable()) {;}
    48  
     48
    4949  SDMemTableWrapper(CountedPtr<SDMemTable> cp) : table_(cp) {;}
    50   SDMemTableWrapper(SDMemTable* sdmt) : table_(sdmt) {;}
    51  
     50  //SDMemTableWrapper(SDMemTable* sdmt) : table_(sdmt) {;}
     51  SDMemTableWrapper(const SDMemTableWrapper& mt) :
     52    table_(mt.getCP()) {;}
     53
    5254  SDMemTableWrapper(const SDMemTableWrapper& mt, const std::string& expr) :
    5355    table_(new SDMemTable(mt.getCP()->table(), expr)) {;}
    54  
     56
     57  SDMemTableWrapper copy() {
     58    //CountedPtr<SDMemTable> cp = new SDMemTable(*this, False);
     59    return SDMemTableWrapper(new SDMemTable(*(this->getCP()), False));
     60  }
     61
    5562  SDMemTableWrapper getScan(int scan) {
    5663    String cond("SELECT * from $1 WHERE SCANID == ");
     
    6976  }
    7077
    71   std::vector<double> getAbscissa(int whichRow, 
    72                                   const std::string& unit = "GHz",
    73                                   const std::string& frame = "TOPO",
    74                                   double restfreq=0.0) const {
     78  std::vector<double> getAbscissa(int whichRow,
     79                                  const std::string& unit = "GHz",
     80                                  const std::string& frame = "TOPO",
     81                                  double restfreq=0.0) const {
    7582    return table_->getAbscissa(whichRow,unit,frame,restfreq);
    7683  }
     
    7986  std::string getTime(int whichRow=0) {return table_->getTime(whichRow);}
    8087
    81   std::vector<bool> getMask(int whichRow=0) const { 
    82     return table_->getMask(whichRow); 
     88  std::vector<bool> getMask(int whichRow=0) const {
     89    return table_->getMask(whichRow);
    8390  }
    84   bool setMask(const std::vector<int> mvals) const { 
    85     return table_->setMask(mvals); 
    86  }
     91  bool setMask(const std::vector<int> mvals) const {
     92    return table_->setMask(mvals);
     93  }
    8794
     95  void flag(int whichRow=-1) {
     96    table_->flag(whichRow);
     97  }
    8898  std::string getSourceName(int whichRow=0) {
    8999    return table_->getSourceName(whichRow);
    90100  }
    91101
     102  void setSpectrum(std::vector<float> spectrum, int whichRow=0) {
     103      table_->setSpectrum(spectrum, whichRow);
     104  }
     105
    92106  bool setIF(int whichIF=0) {return table_->setIF(whichIF);}
    93107  bool setBeam(int whichBeam=0) {return table_->setBeam(whichBeam);}
    94   bool setPol(int whichPol=0) {return table_->setPol(whichPol);} 
     108  bool setPol(int whichPol=0) {return table_->setPol(whichPol);}
    95109
    96110  int getIF() {return table_->getIF();}
    97111  int getBeam() {return table_->getBeam();}
    98   int getPol() {return table_->getPol();} 
     112  int getPol() {return table_->getPol();}
    99113
    100114  int nIF() {return table_->nIF();}
    101115  int nBeam() {return table_->nBeam();}
    102   int nPol() {return table_->nPol();}
    103   int nChan() {return table_->nChan();}
    104   int nScans() {return table_->nScans();}
     116  int nPol() {return table_->nPol();}
     117  int nChan() {return table_->nChan();}
     118  int nScan() {return table_->nScan();}
     119  int nRow() {return table_->nRow();}
    105120
    106121  //sets the mask
    107122  bool setChannels(const std::vector<int>& whichChans) {
    108     return setChannels(whichChans); 
     123    return setChannels(whichChans);
    109124  }
    110125  void makePersistent(const std::string& fname) {
    111126    table_->makePersistent(fname);
    112127  }
     128
     129  void setRestFreqs(std::vector<double> freqs, const std::string& theunit) {
     130    table_->setRestFreqs(freqs, theunit);
     131  }
     132
    113133  CountedPtr<SDMemTable> getCP() const {return table_;}
    114   void summary() { table_->summary(); }
    115  
     134  std::string summary() { return table_->summary(); }
     135
    116136private:
    117137  CountedPtr<SDMemTable> table_;
Note: See TracChangeset for help on using the changeset viewer.