CalWVRTable.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 CalWVRTable.h
00032  */
00033  
00034 #ifndef CalWVRTable_CLASS
00035 #define CalWVRTable_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 <ArrayTime.h>
00048 using  asdm::ArrayTime;
00049 
00050 #include <Tag.h>
00051 using  asdm::Tag;
00052 
00053 #include <Length.h>
00054 using  asdm::Length;
00055 
00056 #include <Temperature.h>
00057 using  asdm::Temperature;
00058 
00059 #include <Frequency.h>
00060 using  asdm::Frequency;
00061 
00062 
00063 
00064 
00065         
00066 
00067         
00068 
00069         
00070 #include "CWVRMethod.h"
00071 using namespace WVRMethodMod;
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 #include <ConversionException.h>
00103 #include <DuplicateKey.h>
00104 #include <UniquenessViolationException.h>
00105 #include <NoSuchRow.h>
00106 #include <DuplicateKey.h>
00107 using asdm::DuplicateKey;
00108 using asdm::ConversionException;
00109 using asdm::NoSuchRow;
00110 using asdm::DuplicateKey;
00111 
00112 #ifndef WITHOUT_ACS
00113 #include <asdmIDLC.h>
00114 using asdmIDL::CalWVRTableIDL;
00115 #endif
00116 
00117 #include <Representable.h>
00118 
00119 namespace asdm {
00120 
00121 //class asdm::ASDM;
00122 //class asdm::CalWVRRow;
00123 
00124 class ASDM;
00125 class CalWVRRow;
00282 class CalWVRTable : public Representable {
00283         friend class ASDM;
00284 
00285 public:
00286 
00287 
00293         static vector<string> getKeyName();
00294 
00295 
00296         virtual ~CalWVRTable();
00297         
00303         ASDM &getContainer() const;
00304         
00310         unsigned int size() ;
00311         
00317         string getName() const;
00318         
00324          static const vector<string>& getAttributesNames();
00325 
00329         Entity getEntity() const;
00330 
00335         void setEntity(Entity e);
00336                 
00344         string toXML()  ;
00345 
00346 #ifndef WITHOUT_ACS
00347         // Conversion Methods
00353         CalWVRTableIDL *toIDL() ;
00354 #endif
00355 
00356 #ifndef WITHOUT_ACS
00357 
00363         void fromIDL(CalWVRTableIDL x) ;
00364 #endif
00365         
00366         //
00367         // ====> Row creation.
00368         //
00369         
00374         CalWVRRow *newRow();
00375         
00376         
00418         CalWVRRow *newRow(string antennaName, Tag calDataId, Tag calReductionId, ArrayTime startValidTime, ArrayTime endValidTime, WVRMethodMod::WVRMethod wvrMethod, int numInputAntennas, vector<string > inputAntennaNames, int numChan, vector<Frequency > chanFreq, vector<Frequency > chanWidth, vector<vector<Temperature > > refTemp, int numPoly, vector<vector<vector<float > > > pathCoeff, vector<Frequency > polyFreqLimits, vector<float > wetPath, vector<float > dryPath, Length water);
00419         
00420 
00421 
00434          CalWVRRow *newRow(CalWVRRow *row); 
00435 
00436         //
00437         // ====> Append a row to its table.
00438         //
00439  
00440         
00453         CalWVRRow* add(CalWVRRow* x) ; 
00454 
00455  
00456 
00457 
00458 
00459         //
00460         // ====> Methods returning rows.
00461         //
00462                 
00468         vector<CalWVRRow *> get() ;
00469         
00470 
00471 
00472  
00473         
00487         CalWVRRow* getRowByKey(string antennaName, Tag calDataId, Tag calReductionId);
00488 
00489                 
00490 
00491 
00492 
00536         CalWVRRow* lookup(string antennaName, Tag calDataId, Tag calReductionId, ArrayTime startValidTime, ArrayTime endValidTime, WVRMethodMod::WVRMethod wvrMethod, int numInputAntennas, vector<string > inputAntennaNames, int numChan, vector<Frequency > chanFreq, vector<Frequency > chanWidth, vector<vector<Temperature > > refTemp, int numPoly, vector<vector<vector<float > > > pathCoeff, vector<Frequency > polyFreqLimits, vector<float > wetPath, vector<float > dryPath, Length water); 
00537 
00538 
00539 private:
00540 
00549         CalWVRTable (ASDM & container);
00550 
00551         ASDM & container;
00552         
00553         bool archiveAsBin; // If true archive binary else archive XML
00554         bool fileAsBin ; // If true file binary else file XML   
00555         
00556         Entity entity;
00557         
00558 
00559 
00563         static string tableName;
00564         
00568         static const vector<string> attributesNames;
00569         
00573         static vector<string> initAttributesNames();
00574 
00575 
00579         static vector<string> key;
00580 
00581 
00589         CalWVRRow* checkAndAdd(CalWVRRow* x) ;
00590 
00591 
00592 
00593 // A data structure to store the pointers on the table's rows.
00594 
00595 // In all cases we maintain a private vector of CalWVRRow s.
00596    vector<CalWVRRow * > privateRows;
00597    
00598 
00599                         
00600         vector<CalWVRRow *> row;
00601 
00602         
00603         void error() ; //throw(ConversionException);
00604 
00605         
00612         void fromXML(string xmlDoc) ;
00613                 
00618         void setFromMIMEFile(const string& directory);
00619         void setFromXMLFile(const string& directory);
00620         
00628         string toMIME(const asdm::ByteOrder* byteOrder=asdm::ByteOrder::Machine_Endianity);
00629   
00630         
00637          void setFromMIME(const string & mimeMsg);
00638         
00642         string MIMEXMLPart(const asdm::ByteOrder* byteOrder=asdm::ByteOrder::Machine_Endianity);
00643         
00653           void toFile(string directory);
00654           
00663          void setFromFile(const string& directory);     
00664  
00665 };
00666 
00667 } // End namespace asdm
00668 
00669 #endif /* CalWVRTable_CLASS */
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines