SeeingTable.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 SeeingTable.h
00032  */
00033  
00034 #ifndef SeeingTable_CLASS
00035 #define SeeingTable_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 <Angle.h>
00048 using  asdm::Angle;
00049 
00050 #include <Length.h>
00051 using  asdm::Length;
00052 
00053 #include <ArrayTimeInterval.h>
00054 using  asdm::ArrayTimeInterval;
00055 
00056 
00057 
00058 
00059         
00060 
00061         
00062 
00063         
00064 
00065         
00066 
00067         
00068 
00069         
00070 
00071 
00072 
00073 #include <ConversionException.h>
00074 #include <DuplicateKey.h>
00075 #include <UniquenessViolationException.h>
00076 #include <NoSuchRow.h>
00077 #include <DuplicateKey.h>
00078 using asdm::DuplicateKey;
00079 using asdm::ConversionException;
00080 using asdm::NoSuchRow;
00081 using asdm::DuplicateKey;
00082 
00083 #ifndef WITHOUT_ACS
00084 #include <asdmIDLC.h>
00085 using asdmIDL::SeeingTableIDL;
00086 #endif
00087 
00088 #include <Representable.h>
00089 
00090 namespace asdm {
00091 
00092 //class asdm::ASDM;
00093 //class asdm::SeeingRow;
00094 
00095 class ASDM;
00096 class SeeingRow;
00165 class SeeingTable : public Representable {
00166         friend class ASDM;
00167 
00168 public:
00169 
00170 
00176         static vector<string> getKeyName();
00177 
00178 
00179         virtual ~SeeingTable();
00180         
00186         ASDM &getContainer() const;
00187         
00193         unsigned int size() ;
00194         
00200         string getName() const;
00201         
00207          static const vector<string>& getAttributesNames();
00208 
00212         Entity getEntity() const;
00213 
00218         void setEntity(Entity e);
00219                 
00227         string toXML()  ;
00228 
00229 #ifndef WITHOUT_ACS
00230         // Conversion Methods
00236         SeeingTableIDL *toIDL() ;
00237 #endif
00238 
00239 #ifndef WITHOUT_ACS
00240 
00246         void fromIDL(SeeingTableIDL x) ;
00247 #endif
00248         
00249         //
00250         // ====> Row creation.
00251         //
00252         
00257         SeeingRow *newRow();
00258         
00259         
00277         SeeingRow *newRow(ArrayTimeInterval timeInterval, int numBaseLength, vector<Length > baseLength, vector<Angle > phaseRms, float seeing, float exponent);
00278         
00279 
00280 
00293          SeeingRow *newRow(SeeingRow *row); 
00294 
00295         //
00296         // ====> Append a row to its table.
00297         //
00298  
00299         
00316         SeeingRow* add(SeeingRow* x) ; 
00317 
00318  
00319 
00320 
00321 
00322         //
00323         // ====> Methods returning rows.
00324         //
00325                 
00331         vector<SeeingRow *> get() ;
00332         
00333 
00341          vector <SeeingRow*> *getByContext();
00342          
00343 
00344 
00345  
00346         
00356         SeeingRow* getRowByKey(ArrayTimeInterval timeInterval);
00357 
00358                 
00359 
00360 
00361 
00381         SeeingRow* lookup(ArrayTimeInterval timeInterval, int numBaseLength, vector<Length > baseLength, vector<Angle > phaseRms, float seeing, float exponent); 
00382 
00383 
00384 private:
00385 
00394         SeeingTable (ASDM & container);
00395 
00396         ASDM & container;
00397         
00398         bool archiveAsBin; // If true archive binary else archive XML
00399         bool fileAsBin ; // If true file binary else file XML   
00400         
00401         Entity entity;
00402         
00403 
00404 
00408         static string tableName;
00409         
00413         static const vector<string> attributesNames;
00414         
00418         static vector<string> initAttributesNames();
00419 
00420 
00424         static vector<string> key;
00425 
00426 
00434         SeeingRow* checkAndAdd(SeeingRow* x) ;
00435 
00436 
00437         
00438         
00446          SeeingRow * insertByStartTime(SeeingRow* x, vector<SeeingRow* >& row);
00447           
00448 
00449 
00450 // A data structure to store the pointers on the table's rows.
00451 
00452 // In all cases we maintain a private vector of SeeingRow s.
00453    vector<SeeingRow * > privateRows;
00454    
00455 
00456         
00457 
00458         
00459         
00460                 
00461                 
00462         vector <SeeingRow *> row;
00463                  
00464                 
00465         
00466         
00467 
00468         
00469         void error() ; //throw(ConversionException);
00470 
00471         
00478         void fromXML(string xmlDoc) ;
00479                 
00484         void setFromMIMEFile(const string& directory);
00485         void setFromXMLFile(const string& directory);
00486         
00494         string toMIME(const asdm::ByteOrder* byteOrder=asdm::ByteOrder::Machine_Endianity);
00495   
00496         
00503          void setFromMIME(const string & mimeMsg);
00504         
00508         string MIMEXMLPart(const asdm::ByteOrder* byteOrder=asdm::ByteOrder::Machine_Endianity);
00509         
00519           void toFile(string directory);
00520           
00529          void setFromFile(const string& directory);     
00530  
00531 };
00532 
00533 } // End namespace asdm
00534 
00535 #endif /* SeeingTable_CLASS */
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines