SpectralWindowTable.h

00001 00002 /* 00003 * ALMA - Atacama Large Millimeter Array 00004 * (c) European Southern Observatory, 2002 00005 * (c) Associated Universities Inc., 2002 00006 * Copyright by ESO (in the framework of the ALMA collaboration), 00007 * Copyright by AUI (in the framework of the ALMA collaboration), 00008 * All rights reserved. 00009 * 00010 * This library is free software; you can redistribute it and/or 00011 * modify it under the terms of the GNU Lesser General Public 00012 * License as published by the Free software Foundation; either 00013 * version 2.1 of the License, or (at your option) any later version. 00014 * 00015 * This library is distributed in the hope that it will be useful, 00016 * but WITHOUT ANY WARRANTY, without even the implied warranty of 00017 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00018 * Lesser General Public License for more details. 00019 * 00020 * You should have received a copy of the GNU Lesser General Public 00021 * License along with this library; if not, write to the Free Software 00022 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 00023 * MA 02111-1307 USA 00024 * 00025 * Warning! 00026 * -------------------------------------------------------------------- 00027 * | This is generated code! Do not modify this file. | 00028 * | If you do, all changes will be lost when the file is re-generated. | 00029 * -------------------------------------------------------------------- 00030 * 00031 * File SpectralWindowTable.h 00032 */ 00033 00034 #ifndef SpectralWindowTable_CLASS 00035 #define SpectralWindowTable_CLASS 00036 00037 #include <string> 00038 #include <vector> 00039 #include <map> 00040 #include <set> 00041 using std::string; 00042 using std::vector; 00043 using std::map; 00044 00045 #include <Angle.h> 00046 #include <AngularRate.h> 00047 #include <ArrayTime.h> 00048 #include <ArrayTimeInterval.h> 00049 #include <Complex.h> 00050 #include <Entity.h> 00051 #include <EntityId.h> 00052 #include <EntityRef.h> 00053 #include <Flux.h> 00054 #include <Frequency.h> 00055 #include <Humidity.h> 00056 #include <Interval.h> 00057 #include <Length.h> 00058 #include <PartId.h> 00059 #include <Pressure.h> 00060 #include <Speed.h> 00061 #include <Tag.h> 00062 #include <Temperature.h> 00063 #include <ConversionException.h> 00064 #include <DuplicateKey.h> 00065 #include <UniquenessViolationException.h> 00066 #include <NoSuchRow.h> 00067 #include <DuplicateKey.h> 00068 00069 /* 00070 #include <Enumerations.h> 00071 using namespace enumerations; 00072 */ 00073 00074 00075 00076 00077 00078 00079 00080 00081 00082 00083 00084 00085 00086 00087 00088 00089 00090 00091 00092 00093 00094 00095 00096 00097 00098 #include "CNetSideband.h" 00099 using namespace NetSidebandMod; 00100 00101 00102 00103 #include "CSidebandProcessingMode.h" 00104 using namespace SidebandProcessingModeMod; 00105 00106 00107 00108 #include "CBasebandName.h" 00109 using namespace BasebandNameMod; 00110 00111 00112 00113 00114 00115 00116 00117 00118 00119 00120 00121 #include "CSpectralResolutionType.h" 00122 using namespace SpectralResolutionTypeMod; 00123 00124 00125 00126 00127 00128 #include "CWindowFunction.h" 00129 using namespace WindowFunctionMod; 00130 00131 00132 00133 00134 00135 #include "CCorrelationBit.h" 00136 using namespace CorrelationBitMod; 00137 00138 00139 00140 00141 00142 #ifndef WITHOUT_ACS 00143 #include <asdmIDLC.h> 00144 using asdmIDL::SpectralWindowTableIDL; 00145 #endif 00146 00147 using asdm::Angle; 00148 using asdm::AngularRate; 00149 using asdm::ArrayTime; 00150 using asdm::Complex; 00151 using asdm::Entity; 00152 using asdm::EntityId; 00153 using asdm::EntityRef; 00154 using asdm::Flux; 00155 using asdm::Frequency; 00156 using asdm::Humidity; 00157 using asdm::Interval; 00158 using asdm::Length; 00159 using asdm::PartId; 00160 using asdm::Pressure; 00161 using asdm::Speed; 00162 using asdm::Tag; 00163 using asdm::Temperature; 00164 00165 using asdm::DuplicateKey; 00166 using asdm::ConversionException; 00167 using asdm::NoSuchRow; 00168 using asdm::DuplicateKey; 00169 00170 #include <Representable.h> 00171 00172 namespace asdm { 00173 00174 //class asdm::ASDM; 00175 //class asdm::SpectralWindowRow; 00176 00177 class ASDM; 00178 class SpectralWindowRow; 00359 class SpectralWindowTable : public Representable { 00360 friend class asdm::ASDM; 00361 00362 public: 00363 00364 00370 static vector<string> getKeyName(); 00371 00372 00373 virtual ~SpectralWindowTable(); 00374 00380 ASDM &getContainer() const; 00381 00387 unsigned int size() ; 00388 00394 string getName() const; 00395 00399 Entity getEntity() const; 00400 00405 void setEntity(Entity e); 00406 00407 // 00408 // ====> Row creation. 00409 // 00410 00415 SpectralWindowRow *newRow(); 00416 00421 SpectralWindowRow* newRowEmpty(); 00422 00423 00457 SpectralWindowRow *newRow(int numChan, Frequency refFreq, vector<Frequency > chanFreq, vector<Frequency > chanWidth, vector<Frequency > effectiveBw, vector<Frequency > resolution, Frequency totBandwidth, NetSidebandMod::NetSideband netSideband, SidebandProcessingModeMod::SidebandProcessingMode sidebandProcessingMode, bool quantization, WindowFunctionMod::WindowFunction windowFunction, bool oversampling, CorrelationBitMod::CorrelationBit correlationBit, bool flagRow); 00458 00463 SpectralWindowRow *newRowFull(int numChan, Frequency refFreq, vector<Frequency > chanFreq, vector<Frequency > chanWidth, vector<Frequency > effectiveBw, vector<Frequency > resolution, Frequency totBandwidth, NetSidebandMod::NetSideband netSideband, SidebandProcessingModeMod::SidebandProcessingMode sidebandProcessingMode, bool quantization, WindowFunctionMod::WindowFunction windowFunction, bool oversampling, CorrelationBitMod::CorrelationBit correlationBit, bool flagRow); 00464 00465 00478 SpectralWindowRow *newRow(SpectralWindowRow *row); 00479 00484 SpectralWindowRow *newRowCopy(SpectralWindowRow *row); 00485 00486 // 00487 // ====> Append a row to its table. 00488 // 00489 00490 00491 00492 00502 SpectralWindowRow* add(SpectralWindowRow* x) ; 00503 00504 00505 00506 // 00507 // ====> Methods returning rows. 00508 // 00509 00515 vector<SpectralWindowRow *> get() ; 00516 00517 00518 00519 00520 00530 SpectralWindowRow* getRowByKey(Tag spectralWindowId); 00531 00532 00533 00534 00535 00571 SpectralWindowRow* lookup(int numChan, Frequency refFreq, vector<Frequency > chanFreq, vector<Frequency > chanWidth, vector<Frequency > effectiveBw, vector<Frequency > resolution, Frequency totBandwidth, NetSidebandMod::NetSideband netSideband, SidebandProcessingModeMod::SidebandProcessingMode sidebandProcessingMode, bool quantization, WindowFunctionMod::WindowFunction windowFunction, bool oversampling, CorrelationBitMod::CorrelationBit correlationBit, bool flagRow); 00572 00573 00574 #ifndef WITHOUT_ACS 00575 // Conversion Methods 00581 SpectralWindowTableIDL *toIDL() ; 00582 #endif 00583 00584 #ifndef WITHOUT_ACS 00585 00591 void fromIDL(SpectralWindowTableIDL x) throw(DuplicateKey,ConversionException); 00592 #endif 00593 00597 char *toFITS() const throw(ConversionException); 00598 00602 void fromFITS(char *fits) throw(ConversionException); 00603 00607 string toVOTable() const throw(ConversionException); 00608 00612 void fromVOTable(string vo) throw(ConversionException); 00613 00620 string toXML() throw(ConversionException); 00621 00627 void fromXML(string xmlDoc) throw(ConversionException); 00628 00634 string toMIME(); 00635 00642 void setFromMIME(const string & mimeMsg); 00643 00653 void toFile(string directory); 00654 00663 void setFromFile(const string& directory); 00664 00665 private: 00666 00675 SpectralWindowTable (ASDM & container); 00676 00677 ASDM & container; 00678 00679 bool archiveAsBin; // If true archive binary else archive XML 00680 bool fileAsBin ; // If true file binary else file XML 00681 00682 Entity entity; 00683 00684 00685 // A map for the autoincrementation algorithm 00686 map<string,int> noAutoIncIds; 00687 void autoIncrement(string key, SpectralWindowRow* x); 00688 00689 00693 static string tableName; 00694 00695 00699 static vector<string> key; 00700 00701 00707 SpectralWindowRow* checkAndAdd(SpectralWindowRow* x) throw (DuplicateKey, UniquenessViolationException); 00708 00709 00710 00711 // A data structure to store the pointers on the table's rows. 00712 00713 // In all cases we maintain a private ArrayList of SpectralWindowRow s. 00714 vector<SpectralWindowRow * > privateRows; 00715 00716 00717 00718 vector<SpectralWindowRow *> row; 00719 00720 00721 void error() throw(ConversionException); 00722 00723 }; 00724 00725 } // End namespace asdm 00726 00727 #endif /* SpectralWindowTable_CLASS */

Generated on Tue Nov 18 17:43:41 2008 for ASDM C++ Implementation by doxygen 1.3.8