SysCalTable.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 SysCalTable.h
00032  */
00033  
00034 #ifndef SysCalTable_CLASS
00035 #define SysCalTable_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 
00099         
00100 
00101         
00102 
00103         
00104 
00105         
00106 
00107         
00108 
00109         
00110 
00111         
00112 
00113         
00114 
00115         
00116 
00117         
00118 
00119         
00120 
00121         
00122 
00123         
00124 
00125         
00126 
00127         
00128 
00129         
00130 
00131         
00132 
00133         
00134 
00135         
00136 
00137         
00138 
00139         
00140 
00141         
00142 
00143         
00144 
00145         
00146 
00147         
00148 
00149         
00150 
00151         
00152 
00153         
00154 
00155         
00156 
00157         
00158 
00159         
00160 
00161         
00162 
00163         
00164 
00165         
00166 
00167 
00168 #ifndef WITHOUT_ACS
00169 #include <asdmIDLC.h>
00170 using asdmIDL::SysCalTableIDL;
00171 #endif
00172 
00173 using asdm::Angle;
00174 using asdm::AngularRate;
00175 using asdm::ArrayTime;
00176 using asdm::Complex;
00177 using asdm::Entity;
00178 using asdm::EntityId;
00179 using asdm::EntityRef;
00180 using asdm::Flux;
00181 using asdm::Frequency;
00182 using asdm::Humidity;
00183 using asdm::Interval;
00184 using asdm::Length;
00185 using asdm::PartId;
00186 using asdm::Pressure;
00187 using asdm::Speed;
00188 using asdm::Tag;
00189 using asdm::Temperature;
00190 
00191 using asdm::DuplicateKey;
00192 using asdm::ConversionException;
00193 using asdm::NoSuchRow;
00194 using asdm::DuplicateKey;
00195 
00196 #include <Representable.h>
00197 
00198 namespace asdm {
00199 
00200 //class asdm::ASDM;
00201 //class asdm::SysCalRow;
00202 
00203 class ASDM;
00204 class SysCalRow;
00520 class SysCalTable : public Representable {
00521         friend class asdm::ASDM;
00522 
00523 public:
00524 
00525 
00531         static vector<string> getKeyName();
00532 
00533 
00534         virtual ~SysCalTable();
00535         
00541         ASDM &getContainer() const;
00542         
00548         unsigned int size() ;
00549         
00555         string getName() const;
00556 
00560         Entity getEntity() const;
00561 
00566         void setEntity(Entity e);
00567 
00568         //
00569         // ====> Row creation.
00570         //
00571         
00576         SysCalRow *newRow();
00577         
00582         SysCalRow* newRowEmpty();
00583 
00584         
00598         SysCalRow *newRow(Tag antennaId, int feedId, Tag spectralWindowId, ArrayTimeInterval timeInterval);
00599         
00604         SysCalRow *newRowFull(Tag antennaId, int feedId, Tag spectralWindowId, ArrayTimeInterval timeInterval);
00605 
00606 
00619          SysCalRow *newRow(SysCalRow *row); 
00620 
00625          SysCalRow *newRowCopy(SysCalRow *row); 
00626 
00627         //
00628         // ====> Append a row to its table.
00629         //
00630  
00631         
00648         SysCalRow* add(SysCalRow* x) ; 
00649 
00650  
00651 
00652 
00653 
00654         //
00655         // ====> Methods returning rows.
00656         //
00657                 
00663         vector<SysCalRow *> get() ;
00664         
00665 
00673          vector <SysCalRow*> *getByContext(Tag antennaId, int feedId, Tag spectralWindowId);
00674          
00675 
00676 
00677  
00678         
00694         SysCalRow* SysCalTable::getRowByKey(Tag antennaId, int feedId, Tag spectralWindowId, ArrayTimeInterval timeInterval);
00695 
00696                 
00697 
00698 
00699 
00715         SysCalRow* lookup(Tag antennaId, int feedId, Tag spectralWindowId, ArrayTimeInterval timeInterval); 
00716 
00717 
00718 #ifndef WITHOUT_ACS
00719         // Conversion Methods
00725         SysCalTableIDL *toIDL() ;
00726 #endif
00727 
00728 #ifndef WITHOUT_ACS
00729 
00735         void fromIDL(SysCalTableIDL x) throw(DuplicateKey,ConversionException);
00736 #endif
00737 
00741         char *toFITS() const throw(ConversionException);
00742 
00746         void fromFITS(char *fits) throw(ConversionException);
00747 
00751         string toVOTable() const throw(ConversionException);
00752 
00756         void fromVOTable(string vo) throw(ConversionException);
00757 
00764         string toXML()  throw(ConversionException);
00765         
00771         void fromXML(string xmlDoc) throw(ConversionException);
00772         
00778         string toMIME();
00779         
00786          void setFromMIME(const string & mimeMsg);
00787         
00797           void toFile(string directory);
00798           
00807          void setFromFile(const string& directory);     
00808 
00809 private:
00810 
00819         SysCalTable (ASDM & container);
00820 
00821         ASDM & container;
00822         
00823         bool archiveAsBin; // If true archive binary else archive XML
00824         bool fileAsBin ; // If true file binary else file XML   
00825         
00826         Entity entity;
00827         
00828 
00829 
00833         static string tableName;
00834 
00835 
00839         static vector<string> key;
00840 
00841 
00847         SysCalRow* checkAndAdd(SysCalRow* x) throw (DuplicateKey);
00848 
00849 
00850         
00851         
00859          SysCalRow * insertByStartTime(SysCalRow* x, vector<SysCalRow* >& row);
00860           
00861 
00862 
00863 // A data structure to store the pointers on the table's rows.
00864 
00865 // In all cases we maintain a private ArrayList of SysCalRow s.
00866    vector<SysCalRow * > privateRows;
00867    
00868 
00869         
00870 
00871         
00872         
00873                 
00874                                 
00875         typedef vector <SysCalRow* > TIME_ROWS;
00876         map<string, TIME_ROWS > context;
00877                 
00882          string Key(Tag antennaId, int feedId, Tag spectralWindowId) ;
00883                  
00884                 
00885         
00886         
00892         void getByKeyNoAutoIncNoTime(vector <SysCalRow*>& vin, vector <SysCalRow*>& vout,  Tag antennaId, int feedId, Tag spectralWindowId);
00893         
00894 
00895 
00896         void error() throw(ConversionException);
00897 
00898 };
00899 
00900 } // End namespace asdm
00901 
00902 #endif /* SysCalTable_CLASS */

Generated on Thu Nov 29 16:46:47 2007 for ASDM C++ Implementation by  doxygen 1.5.1