FreqOffsetTable.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 FreqOffsetTable.h 00032 */ 00033 00034 #ifndef FreqOffsetTable_CLASS 00035 #define FreqOffsetTable_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 #ifndef WITHOUT_ACS 00083 #include <asdmIDLC.h> 00084 using asdmIDL::FreqOffsetTableIDL; 00085 #endif 00086 00087 using asdm::Angle; 00088 using asdm::AngularRate; 00089 using asdm::ArrayTime; 00090 using asdm::Complex; 00091 using asdm::Entity; 00092 using asdm::EntityId; 00093 using asdm::EntityRef; 00094 using asdm::Flux; 00095 using asdm::Frequency; 00096 using asdm::Humidity; 00097 using asdm::Interval; 00098 using asdm::Length; 00099 using asdm::PartId; 00100 using asdm::Pressure; 00101 using asdm::Speed; 00102 using asdm::Tag; 00103 using asdm::Temperature; 00104 00105 using asdm::DuplicateKey; 00106 using asdm::ConversionException; 00107 using asdm::NoSuchRow; 00108 using asdm::DuplicateKey; 00109 00110 #include <Representable.h> 00111 00112 namespace asdm { 00113 00114 //class asdm::ASDM; 00115 //class asdm::FreqOffsetRow; 00116 00117 class ASDM; 00118 class FreqOffsetRow; 00176 class FreqOffsetTable : public Representable { 00177 friend class asdm::ASDM; 00178 00179 public: 00180 00181 00187 static vector<string> getKeyName(); 00188 00189 00190 virtual ~FreqOffsetTable(); 00191 00197 ASDM &getContainer() const; 00198 00204 unsigned int size() ; 00205 00211 string getName() const; 00212 00216 Entity getEntity() const; 00217 00222 void setEntity(Entity e); 00223 00224 // 00225 // ====> Row creation. 00226 // 00227 00232 FreqOffsetRow *newRow(); 00233 00238 FreqOffsetRow* newRowEmpty(); 00239 00240 00256 FreqOffsetRow *newRow(Tag antennaId, int feedId, Tag spectralWindowId, ArrayTimeInterval timeInterval, Frequency offset); 00257 00262 FreqOffsetRow *newRowFull(Tag antennaId, int feedId, Tag spectralWindowId, ArrayTimeInterval timeInterval, Frequency offset); 00263 00264 00277 FreqOffsetRow *newRow(FreqOffsetRow *row); 00278 00283 FreqOffsetRow *newRowCopy(FreqOffsetRow *row); 00284 00285 // 00286 // ====> Append a row to its table. 00287 // 00288 00289 00306 FreqOffsetRow* add(FreqOffsetRow* x) ; 00307 00308 00309 00310 00311 00312 // 00313 // ====> Methods returning rows. 00314 // 00315 00321 vector<FreqOffsetRow *> get() ; 00322 00323 00331 vector <FreqOffsetRow*> *getByContext(Tag antennaId, int feedId, Tag spectralWindowId); 00332 00333 00334 00335 00336 00352 FreqOffsetRow* getRowByKey(Tag antennaId, int feedId, Tag spectralWindowId, ArrayTimeInterval timeInterval); 00353 00354 00355 00356 00357 00375 FreqOffsetRow* lookup(Tag antennaId, int feedId, Tag spectralWindowId, ArrayTimeInterval timeInterval, Frequency offset); 00376 00377 00378 #ifndef WITHOUT_ACS 00379 // Conversion Methods 00385 FreqOffsetTableIDL *toIDL() ; 00386 #endif 00387 00388 #ifndef WITHOUT_ACS 00389 00395 void fromIDL(FreqOffsetTableIDL x) throw(DuplicateKey,ConversionException); 00396 #endif 00397 00401 char *toFITS() const throw(ConversionException); 00402 00406 void fromFITS(char *fits) throw(ConversionException); 00407 00411 string toVOTable() const throw(ConversionException); 00412 00416 void fromVOTable(string vo) throw(ConversionException); 00417 00424 string toXML() throw(ConversionException); 00425 00431 void fromXML(string xmlDoc) throw(ConversionException); 00432 00438 string toMIME(); 00439 00446 void setFromMIME(const string & mimeMsg); 00447 00457 void toFile(string directory); 00458 00467 void setFromFile(const string& directory); 00468 00469 private: 00470 00479 FreqOffsetTable (ASDM & container); 00480 00481 ASDM & container; 00482 00483 bool archiveAsBin; // If true archive binary else archive XML 00484 bool fileAsBin ; // If true file binary else file XML 00485 00486 Entity entity; 00487 00488 00489 00493 static string tableName; 00494 00495 00499 static vector<string> key; 00500 00501 00507 FreqOffsetRow* checkAndAdd(FreqOffsetRow* x) throw (DuplicateKey); 00508 00509 00510 00511 00519 FreqOffsetRow * insertByStartTime(FreqOffsetRow* x, vector<FreqOffsetRow* >& row); 00520 00521 00522 00523 // A data structure to store the pointers on the table's rows. 00524 00525 // In all cases we maintain a private ArrayList of FreqOffsetRow s. 00526 vector<FreqOffsetRow * > privateRows; 00527 00528 00529 00530 00531 00532 00533 00534 00535 typedef vector <FreqOffsetRow* > TIME_ROWS; 00536 map<string, TIME_ROWS > context; 00537 00542 string Key(Tag antennaId, int feedId, Tag spectralWindowId) ; 00543 00544 00545 00546 00552 void getByKeyNoAutoIncNoTime(vector <FreqOffsetRow*>& vin, vector <FreqOffsetRow*>& vout, Tag antennaId, int feedId, Tag spectralWindowId); 00553 00554 00555 00556 void error() throw(ConversionException); 00557 00558 }; 00559 00560 } // End namespace asdm 00561 00562 #endif /* FreqOffsetTable_CLASS */

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