WVMCalTable.h

Go to the documentation of this file.
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 WVMCalTable.h
00032  */
00033  
00034 #ifndef WVMCalTable_CLASS
00035 #define WVMCalTable_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 
00046 
00047 #include <Tag.h>
00048 using  asdm::Tag;
00049 
00050 #include <Frequency.h>
00051 using  asdm::Frequency;
00052 
00053 #include <ArrayTimeInterval.h>
00054 using  asdm::ArrayTimeInterval;
00055 
00056 
00057 
00058 
00059         
00060 
00061         
00062 #include "CWVRMethod.h"
00063 using namespace WVRMethodMod;
00064         
00065 
00066         
00067 
00068         
00069 
00070         
00071 
00072         
00073 
00074         
00075 
00076 
00077 
00078 #include <ConversionException.h>
00079 #include <DuplicateKey.h>
00080 #include <UniquenessViolationException.h>
00081 #include <NoSuchRow.h>
00082 #include <DuplicateKey.h>
00083 using asdm::DuplicateKey;
00084 using asdm::ConversionException;
00085 using asdm::NoSuchRow;
00086 using asdm::DuplicateKey;
00087 
00088 #ifndef WITHOUT_ACS
00089 #include <asdmIDLC.h>
00090 using asdmIDL::WVMCalTableIDL;
00091 #endif
00092 
00093 #include <Representable.h>
00094 
00095 namespace asdm {
00096 
00097 //class asdm::ASDM;
00098 //class asdm::WVMCalRow;
00099 
00100 class ASDM;
00101 class WVMCalRow;
00195 class WVMCalTable : public Representable {
00196         friend class ASDM;
00197 
00198 public:
00199 
00200 
00206         static vector<string> getKeyName();
00207 
00208 
00209         virtual ~WVMCalTable();
00210         
00216         ASDM &getContainer() const;
00217         
00223         unsigned int size() ;
00224         
00230         string getName() const;
00231         
00237          static const vector<string>& getAttributesNames();
00238 
00242         Entity getEntity() const;
00243 
00248         void setEntity(Entity e);
00249                 
00257         string toXML()  ;
00258 
00259 #ifndef WITHOUT_ACS
00260         // Conversion Methods
00266         WVMCalTableIDL *toIDL() ;
00267 #endif
00268 
00269 #ifndef WITHOUT_ACS
00270 
00276         void fromIDL(WVMCalTableIDL x) ;
00277 #endif
00278         
00279         //
00280         // ====> Row creation.
00281         //
00282         
00287         WVMCalRow *newRow();
00288         
00289         
00313         WVMCalRow *newRow(Tag antennaId, Tag spectralWindowId, ArrayTimeInterval timeInterval, WVRMethodMod::WVRMethod wvrMethod, vector<Frequency > polyFreqLimits, int numChan, int numPoly, vector<vector<double > > pathCoeff, vector<double > refTemp);
00314         
00315 
00316 
00329          WVMCalRow *newRow(WVMCalRow *row); 
00330 
00331         //
00332         // ====> Append a row to its table.
00333         //
00334  
00335         
00352         WVMCalRow* add(WVMCalRow* x) ; 
00353 
00354  
00355 
00356 
00357 
00358         //
00359         // ====> Methods returning rows.
00360         //
00361                 
00367         vector<WVMCalRow *> get() ;
00368         
00369 
00377          vector <WVMCalRow*> *getByContext(Tag antennaId, Tag spectralWindowId);
00378          
00379 
00380 
00381  
00382         
00396         WVMCalRow* getRowByKey(Tag antennaId, Tag spectralWindowId, ArrayTimeInterval timeInterval);
00397 
00398                 
00399 
00400 
00401 
00427         WVMCalRow* lookup(Tag antennaId, Tag spectralWindowId, ArrayTimeInterval timeInterval, WVRMethodMod::WVRMethod wvrMethod, vector<Frequency > polyFreqLimits, int numChan, int numPoly, vector<vector<double > > pathCoeff, vector<double > refTemp); 
00428 
00429 
00430 private:
00431 
00440         WVMCalTable (ASDM & container);
00441 
00442         ASDM & container;
00443         
00444         bool archiveAsBin; // If true archive binary else archive XML
00445         bool fileAsBin ; // If true file binary else file XML   
00446         
00447         Entity entity;
00448         
00449 
00450 
00454         static string tableName;
00455         
00459         static const vector<string> attributesNames;
00460         
00464         static vector<string> initAttributesNames();
00465 
00466 
00470         static vector<string> key;
00471 
00472 
00480         WVMCalRow* checkAndAdd(WVMCalRow* x) ;
00481 
00482 
00483         
00484         
00492          WVMCalRow * insertByStartTime(WVMCalRow* x, vector<WVMCalRow* >& row);
00493           
00494 
00495 
00496 // A data structure to store the pointers on the table's rows.
00497 
00498 // In all cases we maintain a private vector of WVMCalRow s.
00499    vector<WVMCalRow * > privateRows;
00500    
00501 
00502         
00503 
00504         
00505         
00506                 
00507                                 
00508         typedef vector <WVMCalRow* > TIME_ROWS;
00509         map<string, TIME_ROWS > context;
00510                 
00515          string Key(Tag antennaId, Tag spectralWindowId) ;
00516                  
00517                 
00518         
00519         
00525         void getByKeyNoAutoIncNoTime(vector <WVMCalRow*>& vin, vector <WVMCalRow*>& vout,  Tag antennaId, Tag spectralWindowId);
00526         
00527 
00528         
00529         void error() ; //throw(ConversionException);
00530 
00531         
00538         void fromXML(string xmlDoc) ;
00539                 
00544         void setFromMIMEFile(const string& directory);
00545         void setFromXMLFile(const string& directory);
00546         
00554         string toMIME(const asdm::ByteOrder* byteOrder=asdm::ByteOrder::Machine_Endianity);
00555   
00556         
00563          void setFromMIME(const string & mimeMsg);
00564         
00568         string MIMEXMLPart(const asdm::ByteOrder* byteOrder=asdm::ByteOrder::Machine_Endianity);
00569         
00579           void toFile(string directory);
00580           
00589          void setFromFile(const string& directory);     
00590  
00591 };
00592 
00593 } // End namespace asdm
00594 
00595 #endif /* WVMCalTable_CLASS */
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines