CalCurveTable.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 CalCurveTable.h
00032  */
00033  
00034 #ifndef CalCurveTable_CLASS
00035 #define CalCurveTable_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 <Frequency.h>
00054 using  asdm::Frequency;
00055 
00056 
00057 
00058 
00059         
00060 #include "CAtmPhaseCorrection.h"
00061 using namespace AtmPhaseCorrectionMod;
00062         
00063 
00064         
00065 #include "CCalCurveType.h"
00066 using namespace CalCurveTypeMod;
00067         
00068 
00069         
00070 #include "CReceiverBand.h"
00071 using namespace ReceiverBandMod;
00072         
00073 
00074         
00075 
00076         
00077 
00078         
00079 
00080         
00081 
00082         
00083 
00084         
00085 
00086         
00087 
00088         
00089 
00090         
00091 #include "CPolarizationType.h"
00092 using namespace PolarizationTypeMod;
00093         
00094 
00095         
00096 
00097         
00098 
00099         
00100 
00101         
00102 
00103 
00104 
00105 #include <ConversionException.h>
00106 #include <DuplicateKey.h>
00107 #include <UniquenessViolationException.h>
00108 #include <NoSuchRow.h>
00109 #include <DuplicateKey.h>
00110 using asdm::DuplicateKey;
00111 using asdm::ConversionException;
00112 using asdm::NoSuchRow;
00113 using asdm::DuplicateKey;
00114 
00115 #ifndef WITHOUT_ACS
00116 #include <asdmIDLC.h>
00117 using asdmIDL::CalCurveTableIDL;
00118 #endif
00119 
00120 #include <Representable.h>
00121 
00122 namespace asdm {
00123 
00124 //class asdm::ASDM;
00125 //class asdm::CalCurveRow;
00126 
00127 class ASDM;
00128 class CalCurveRow;
00292 class CalCurveTable : public Representable {
00293         friend class ASDM;
00294 
00295 public:
00296 
00297 
00303         static vector<string> getKeyName();
00304 
00305 
00306         virtual ~CalCurveTable();
00307         
00313         ASDM &getContainer() const;
00314         
00320         unsigned int size() ;
00321         
00327         string getName() const;
00328         
00334          static const vector<string>& getAttributesNames();
00335 
00339         Entity getEntity() const;
00340 
00345         void setEntity(Entity e);
00346                 
00354         string toXML()  ;
00355 
00356 #ifndef WITHOUT_ACS
00357         // Conversion Methods
00363         CalCurveTableIDL *toIDL() ;
00364 #endif
00365 
00366 #ifndef WITHOUT_ACS
00367 
00373         void fromIDL(CalCurveTableIDL x) ;
00374 #endif
00375         
00376         //
00377         // ====> Row creation.
00378         //
00379         
00384         CalCurveRow *newRow();
00385         
00386         
00424         CalCurveRow *newRow(AtmPhaseCorrectionMod::AtmPhaseCorrection atmPhaseCorrection, CalCurveTypeMod::CalCurveType typeCurve, ReceiverBandMod::ReceiverBand receiverBand, Tag calDataId, Tag calReductionId, ArrayTime startValidTime, ArrayTime endValidTime, vector<Frequency > frequencyRange, int numAntenna, int numPoly, int numReceptor, vector<string > antennaNames, string refAntennaName, vector<PolarizationTypeMod::PolarizationType > polarizationTypes, vector<vector<vector<float > > > curve, vector<double > reducedChiSquared);
00425         
00426 
00427 
00440          CalCurveRow *newRow(CalCurveRow *row); 
00441 
00442         //
00443         // ====> Append a row to its table.
00444         //
00445  
00446         
00459         CalCurveRow* add(CalCurveRow* x) ; 
00460 
00461  
00462 
00463 
00464 
00465         //
00466         // ====> Methods returning rows.
00467         //
00468                 
00474         vector<CalCurveRow *> get() ;
00475         
00476 
00477 
00478  
00479         
00497         CalCurveRow* getRowByKey(AtmPhaseCorrectionMod::AtmPhaseCorrection atmPhaseCorrection, CalCurveTypeMod::CalCurveType typeCurve, ReceiverBandMod::ReceiverBand receiverBand, Tag calDataId, Tag calReductionId);
00498 
00499                 
00500 
00501 
00502 
00542         CalCurveRow* lookup(AtmPhaseCorrectionMod::AtmPhaseCorrection atmPhaseCorrection, CalCurveTypeMod::CalCurveType typeCurve, ReceiverBandMod::ReceiverBand receiverBand, Tag calDataId, Tag calReductionId, ArrayTime startValidTime, ArrayTime endValidTime, vector<Frequency > frequencyRange, int numAntenna, int numPoly, int numReceptor, vector<string > antennaNames, string refAntennaName, vector<PolarizationTypeMod::PolarizationType > polarizationTypes, vector<vector<vector<float > > > curve, vector<double > reducedChiSquared); 
00543 
00544 
00545 private:
00546 
00555         CalCurveTable (ASDM & container);
00556 
00557         ASDM & container;
00558         
00559         bool archiveAsBin; // If true archive binary else archive XML
00560         bool fileAsBin ; // If true file binary else file XML   
00561         
00562         Entity entity;
00563         
00564 
00565 
00569         static string tableName;
00570         
00574         static const vector<string> attributesNames;
00575         
00579         static vector<string> initAttributesNames();
00580 
00581 
00585         static vector<string> key;
00586 
00587 
00595         CalCurveRow* checkAndAdd(CalCurveRow* x) ;
00596 
00597 
00598 
00599 // A data structure to store the pointers on the table's rows.
00600 
00601 // In all cases we maintain a private vector of CalCurveRow s.
00602    vector<CalCurveRow * > privateRows;
00603    
00604 
00605                         
00606         vector<CalCurveRow *> row;
00607 
00608         
00609         void error() ; //throw(ConversionException);
00610 
00611         
00618         void fromXML(string xmlDoc) ;
00619                 
00624         void setFromMIMEFile(const string& directory);
00625         void setFromXMLFile(const string& directory);
00626         
00634         string toMIME(const asdm::ByteOrder* byteOrder=asdm::ByteOrder::Machine_Endianity);
00635   
00636         
00643          void setFromMIME(const string & mimeMsg);
00644         
00648         string MIMEXMLPart(const asdm::ByteOrder* byteOrder=asdm::ByteOrder::Machine_Endianity);
00649         
00659           void toFile(string directory);
00660           
00669          void setFromFile(const string& directory);     
00670  
00671 };
00672 
00673 } // End namespace asdm
00674 
00675 #endif /* CalCurveTable_CLASS */
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines