CalGainTable.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 CalGainTable.h
00032  */
00033  
00034 #ifndef CalGainTable_CLASS
00035 #define CalGainTable_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 
00054 
00055 
00056         
00057 
00058         
00059 
00060         
00061 
00062         
00063 
00064         
00065 
00066         
00067 
00068         
00069 
00070         
00071 
00072         
00073 
00074 
00075 
00076 #include <ConversionException.h>
00077 #include <DuplicateKey.h>
00078 #include <UniquenessViolationException.h>
00079 #include <NoSuchRow.h>
00080 #include <DuplicateKey.h>
00081 using asdm::DuplicateKey;
00082 using asdm::ConversionException;
00083 using asdm::NoSuchRow;
00084 using asdm::DuplicateKey;
00085 
00086 #ifndef WITHOUT_ACS
00087 #include <asdmIDLC.h>
00088 using asdmIDL::CalGainTableIDL;
00089 #endif
00090 
00091 #include <Representable.h>
00092 
00093 namespace asdm {
00094 
00095 //class asdm::ASDM;
00096 //class asdm::CalGainRow;
00097 
00098 class ASDM;
00099 class CalGainRow;
00205 class CalGainTable : public Representable {
00206         friend class ASDM;
00207 
00208 public:
00209 
00210 
00216         static vector<string> getKeyName();
00217 
00218 
00219         virtual ~CalGainTable();
00220         
00226         ASDM &getContainer() const;
00227         
00233         unsigned int size() ;
00234         
00240         string getName() const;
00241         
00247          static const vector<string>& getAttributesNames();
00248 
00252         Entity getEntity() const;
00253 
00258         void setEntity(Entity e);
00259                 
00267         string toXML()  ;
00268 
00269 #ifndef WITHOUT_ACS
00270         // Conversion Methods
00276         CalGainTableIDL *toIDL() ;
00277 #endif
00278 
00279 #ifndef WITHOUT_ACS
00280 
00286         void fromIDL(CalGainTableIDL x) ;
00287 #endif
00288         
00289         //
00290         // ====> Row creation.
00291         //
00292         
00297         CalGainRow *newRow();
00298         
00299         
00327         CalGainRow *newRow(Tag calDataId, Tag calReductionId, ArrayTime startValidTime, ArrayTime endValidTime, float gain, bool gainValid, float fit, float fitWeight, bool totalGainValid, float totalFit, float totalFitWeight);
00328         
00329 
00330 
00343          CalGainRow *newRow(CalGainRow *row); 
00344 
00345         //
00346         // ====> Append a row to its table.
00347         //
00348  
00349         
00362         CalGainRow* add(CalGainRow* x) ; 
00363 
00364  
00365 
00366 
00367 
00368         //
00369         // ====> Methods returning rows.
00370         //
00371                 
00377         vector<CalGainRow *> get() ;
00378         
00379 
00380 
00381  
00382         
00394         CalGainRow* getRowByKey(Tag calDataId, Tag calReductionId);
00395 
00396                 
00397 
00398 
00399 
00429         CalGainRow* lookup(Tag calDataId, Tag calReductionId, ArrayTime startValidTime, ArrayTime endValidTime, float gain, bool gainValid, float fit, float fitWeight, bool totalGainValid, float totalFit, float totalFitWeight); 
00430 
00431 
00432 private:
00433 
00442         CalGainTable (ASDM & container);
00443 
00444         ASDM & container;
00445         
00446         bool archiveAsBin; // If true archive binary else archive XML
00447         bool fileAsBin ; // If true file binary else file XML   
00448         
00449         Entity entity;
00450         
00451 
00452 
00456         static string tableName;
00457         
00461         static const vector<string> attributesNames;
00462         
00466         static vector<string> initAttributesNames();
00467 
00468 
00472         static vector<string> key;
00473 
00474 
00482         CalGainRow* checkAndAdd(CalGainRow* x) ;
00483 
00484 
00485 
00486 // A data structure to store the pointers on the table's rows.
00487 
00488 // In all cases we maintain a private vector of CalGainRow s.
00489    vector<CalGainRow * > privateRows;
00490    
00491 
00492                         
00493         vector<CalGainRow *> row;
00494 
00495         
00496         void error() ; //throw(ConversionException);
00497 
00498         
00505         void fromXML(string xmlDoc) ;
00506                 
00511         void setFromMIMEFile(const string& directory);
00512         void setFromXMLFile(const string& directory);
00513         
00521         string toMIME(const asdm::ByteOrder* byteOrder=asdm::ByteOrder::Machine_Endianity);
00522   
00523         
00530          void setFromMIME(const string & mimeMsg);
00531         
00535         string MIMEXMLPart(const asdm::ByteOrder* byteOrder=asdm::ByteOrder::Machine_Endianity);
00536         
00546           void toFile(string directory);
00547           
00556          void setFromFile(const string& directory);     
00557  
00558 };
00559 
00560 } // End namespace asdm
00561 
00562 #endif /* CalGainTable_CLASS */
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines