CalDeviceTable.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 CalDeviceTable.h 00032 */ 00033 00034 #ifndef CalDeviceTable_CLASS 00035 #define CalDeviceTable_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 #include "CCalibrationDevice.h" 00089 using namespace CalibrationDeviceMod; 00090 00091 00092 00093 #ifndef WITHOUT_ACS 00094 #include <asdmIDLC.h> 00095 using asdmIDL::CalDeviceTableIDL; 00096 #endif 00097 00098 using asdm::Angle; 00099 using asdm::AngularRate; 00100 using asdm::ArrayTime; 00101 using asdm::Complex; 00102 using asdm::Entity; 00103 using asdm::EntityId; 00104 using asdm::EntityRef; 00105 using asdm::Flux; 00106 using asdm::Frequency; 00107 using asdm::Humidity; 00108 using asdm::Interval; 00109 using asdm::Length; 00110 using asdm::PartId; 00111 using asdm::Pressure; 00112 using asdm::Speed; 00113 using asdm::Tag; 00114 using asdm::Temperature; 00115 00116 using asdm::DuplicateKey; 00117 using asdm::ConversionException; 00118 using asdm::NoSuchRow; 00119 using asdm::DuplicateKey; 00120 00121 #include <Representable.h> 00122 00123 namespace asdm { 00124 00125 //class asdm::ASDM; 00126 //class asdm::CalDeviceRow; 00127 00128 class ASDM; 00129 class CalDeviceRow; 00214 class CalDeviceTable : public Representable { 00215 friend class asdm::ASDM; 00216 00217 public: 00218 00219 00225 static vector<string> getKeyName(); 00226 00227 00228 virtual ~CalDeviceTable(); 00229 00235 ASDM &getContainer() const; 00236 00242 unsigned int size() ; 00243 00249 string getName() const; 00250 00254 Entity getEntity() const; 00255 00260 void setEntity(Entity e); 00261 00262 // 00263 // ====> Row creation. 00264 // 00265 00270 CalDeviceRow *newRow(); 00271 00276 CalDeviceRow* newRowEmpty(); 00277 00278 00296 CalDeviceRow *newRow(Tag antennaId, int feedId, Tag spectralWindowId, ArrayTimeInterval timeInterval, int numCalload, vector<CalibrationDeviceMod::CalibrationDevice > calLoadName); 00297 00302 CalDeviceRow *newRowFull(Tag antennaId, int feedId, Tag spectralWindowId, ArrayTimeInterval timeInterval, int numCalload, vector<CalibrationDeviceMod::CalibrationDevice > calLoadName); 00303 00304 00317 CalDeviceRow *newRow(CalDeviceRow *row); 00318 00323 CalDeviceRow *newRowCopy(CalDeviceRow *row); 00324 00325 // 00326 // ====> Append a row to its table. 00327 // 00328 00329 00346 CalDeviceRow* add(CalDeviceRow* x) ; 00347 00348 00349 00350 00351 00352 // 00353 // ====> Methods returning rows. 00354 // 00355 00361 vector<CalDeviceRow *> get() ; 00362 00363 00371 vector <CalDeviceRow*> *getByContext(Tag antennaId, int feedId, Tag spectralWindowId); 00372 00373 00374 00375 00376 00392 CalDeviceRow* getRowByKey(Tag antennaId, int feedId, Tag spectralWindowId, ArrayTimeInterval timeInterval); 00393 00394 00395 00396 00397 00417 CalDeviceRow* lookup(Tag antennaId, int feedId, Tag spectralWindowId, ArrayTimeInterval timeInterval, int numCalload, vector<CalibrationDeviceMod::CalibrationDevice > calLoadName); 00418 00419 00420 #ifndef WITHOUT_ACS 00421 // Conversion Methods 00427 CalDeviceTableIDL *toIDL() ; 00428 #endif 00429 00430 #ifndef WITHOUT_ACS 00431 00437 void fromIDL(CalDeviceTableIDL x) throw(DuplicateKey,ConversionException); 00438 #endif 00439 00443 char *toFITS() const throw(ConversionException); 00444 00448 void fromFITS(char *fits) throw(ConversionException); 00449 00453 string toVOTable() const throw(ConversionException); 00454 00458 void fromVOTable(string vo) throw(ConversionException); 00459 00466 string toXML() throw(ConversionException); 00467 00473 void fromXML(string xmlDoc) throw(ConversionException); 00474 00480 string toMIME(); 00481 00488 void setFromMIME(const string & mimeMsg); 00489 00499 void toFile(string directory); 00500 00509 void setFromFile(const string& directory); 00510 00511 private: 00512 00521 CalDeviceTable (ASDM & container); 00522 00523 ASDM & container; 00524 00525 bool archiveAsBin; // If true archive binary else archive XML 00526 bool fileAsBin ; // If true file binary else file XML 00527 00528 Entity entity; 00529 00530 00531 00535 static string tableName; 00536 00537 00541 static vector<string> key; 00542 00543 00549 CalDeviceRow* checkAndAdd(CalDeviceRow* x) throw (DuplicateKey); 00550 00551 00552 00553 00561 CalDeviceRow * insertByStartTime(CalDeviceRow* x, vector<CalDeviceRow* >& row); 00562 00563 00564 00565 // A data structure to store the pointers on the table's rows. 00566 00567 // In all cases we maintain a private ArrayList of CalDeviceRow s. 00568 vector<CalDeviceRow * > privateRows; 00569 00570 00571 00572 00573 00574 00575 00576 00577 typedef vector <CalDeviceRow* > TIME_ROWS; 00578 map<string, TIME_ROWS > context; 00579 00584 string Key(Tag antennaId, int feedId, Tag spectralWindowId) ; 00585 00586 00587 00588 00594 void getByKeyNoAutoIncNoTime(vector <CalDeviceRow*>& vin, vector <CalDeviceRow*>& vout, Tag antennaId, int feedId, Tag spectralWindowId); 00595 00596 00597 00598 void error() throw(ConversionException); 00599 00600 }; 00601 00602 } // End namespace asdm 00603 00604 #endif /* CalDeviceTable_CLASS */

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