CalPrimaryBeamTable.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 CalPrimaryBeamTable.h
00032  */
00033  
00034 #ifndef CalPrimaryBeamTable_CLASS
00035 #define CalPrimaryBeamTable_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 #include <EntityRef.h>
00057 using  asdm::EntityRef;
00058 
00059 
00060 
00061 
00062         
00063 
00064         
00065 #include "CReceiverBand.h"
00066 using namespace ReceiverBandMod;
00067         
00068 
00069         
00070 
00071         
00072 
00073         
00074 #include "CAntennaMake.h"
00075 using namespace AntennaMakeMod;
00076         
00077 
00078         
00079 
00080         
00081 
00082         
00083 #include "CPolarizationType.h"
00084 using namespace PolarizationTypeMod;
00085         
00086 
00087         
00088 
00089         
00090 
00091         
00092 
00093 
00094 
00095 #include <ConversionException.h>
00096 #include <DuplicateKey.h>
00097 #include <UniquenessViolationException.h>
00098 #include <NoSuchRow.h>
00099 #include <DuplicateKey.h>
00100 using asdm::DuplicateKey;
00101 using asdm::ConversionException;
00102 using asdm::NoSuchRow;
00103 using asdm::DuplicateKey;
00104 
00105 #ifndef WITHOUT_ACS
00106 #include <asdmIDLC.h>
00107 using asdmIDL::CalPrimaryBeamTableIDL;
00108 #endif
00109 
00110 #include <Representable.h>
00111 
00112 namespace asdm {
00113 
00114 //class asdm::ASDM;
00115 //class asdm::CalPrimaryBeamRow;
00116 
00117 class ASDM;
00118 class CalPrimaryBeamRow;
00242 class CalPrimaryBeamTable : public Representable {
00243         friend class ASDM;
00244 
00245 public:
00246 
00247 
00253         static vector<string> getKeyName();
00254 
00255 
00256         virtual ~CalPrimaryBeamTable();
00257         
00263         ASDM &getContainer() const;
00264         
00270         unsigned int size() ;
00271         
00277         string getName() const;
00278         
00284          static const vector<string>& getAttributesNames();
00285 
00289         Entity getEntity() const;
00290 
00295         void setEntity(Entity e);
00296                 
00304         string toXML()  ;
00305 
00306 #ifndef WITHOUT_ACS
00307         // Conversion Methods
00313         CalPrimaryBeamTableIDL *toIDL() ;
00314 #endif
00315 
00316 #ifndef WITHOUT_ACS
00317 
00323         void fromIDL(CalPrimaryBeamTableIDL x) ;
00324 #endif
00325         
00326         //
00327         // ====> Row creation.
00328         //
00329         
00334         CalPrimaryBeamRow *newRow();
00335         
00336         
00368         CalPrimaryBeamRow *newRow(string antennaName, ReceiverBandMod::ReceiverBand receiverBand, Tag calDataId, Tag calReductionId, ArrayTime startValidTime, ArrayTime endValidTime, AntennaMakeMod::AntennaMake antennaMake, vector<Frequency > frequencyRange, int numReceptor, vector<PolarizationTypeMod::PolarizationType > polarizationTypes, vector<double > mainBeamEfficiency, EntityRef beamMapUID, float relativeAmplitudeRms);
00369         
00370 
00371 
00384          CalPrimaryBeamRow *newRow(CalPrimaryBeamRow *row); 
00385 
00386         //
00387         // ====> Append a row to its table.
00388         //
00389  
00390         
00403         CalPrimaryBeamRow* add(CalPrimaryBeamRow* x) ; 
00404 
00405  
00406 
00407 
00408 
00409         //
00410         // ====> Methods returning rows.
00411         //
00412                 
00418         vector<CalPrimaryBeamRow *> get() ;
00419         
00420 
00421 
00422  
00423         
00439         CalPrimaryBeamRow* getRowByKey(string antennaName, ReceiverBandMod::ReceiverBand receiverBand, Tag calDataId, Tag calReductionId);
00440 
00441                 
00442 
00443 
00444 
00478         CalPrimaryBeamRow* lookup(string antennaName, ReceiverBandMod::ReceiverBand receiverBand, Tag calDataId, Tag calReductionId, ArrayTime startValidTime, ArrayTime endValidTime, AntennaMakeMod::AntennaMake antennaMake, vector<Frequency > frequencyRange, int numReceptor, vector<PolarizationTypeMod::PolarizationType > polarizationTypes, vector<double > mainBeamEfficiency, EntityRef beamMapUID, float relativeAmplitudeRms); 
00479 
00480 
00481 private:
00482 
00491         CalPrimaryBeamTable (ASDM & container);
00492 
00493         ASDM & container;
00494         
00495         bool archiveAsBin; // If true archive binary else archive XML
00496         bool fileAsBin ; // If true file binary else file XML   
00497         
00498         Entity entity;
00499         
00500 
00501 
00505         static string tableName;
00506         
00510         static const vector<string> attributesNames;
00511         
00515         static vector<string> initAttributesNames();
00516 
00517 
00521         static vector<string> key;
00522 
00523 
00531         CalPrimaryBeamRow* checkAndAdd(CalPrimaryBeamRow* x) ;
00532 
00533 
00534 
00535 // A data structure to store the pointers on the table's rows.
00536 
00537 // In all cases we maintain a private vector of CalPrimaryBeamRow s.
00538    vector<CalPrimaryBeamRow * > privateRows;
00539    
00540 
00541                         
00542         vector<CalPrimaryBeamRow *> row;
00543 
00544         
00545         void error() ; //throw(ConversionException);
00546 
00547         
00554         void fromXML(string xmlDoc) ;
00555                 
00560         void setFromMIMEFile(const string& directory);
00561         void setFromXMLFile(const string& directory);
00562         
00570         string toMIME(const asdm::ByteOrder* byteOrder=asdm::ByteOrder::Machine_Endianity);
00571   
00572         
00579          void setFromMIME(const string & mimeMsg);
00580         
00584         string MIMEXMLPart(const asdm::ByteOrder* byteOrder=asdm::ByteOrder::Machine_Endianity);
00585         
00595           void toFile(string directory);
00596           
00605          void setFromFile(const string& directory);     
00606  
00607 };
00608 
00609 } // End namespace asdm
00610 
00611 #endif /* CalPrimaryBeamTable_CLASS */
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines