DelayModelTable.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 DelayModelTable.h
00032  */
00033  
00034 #ifndef DelayModelTable_CLASS
00035 #define DelayModelTable_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 <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         
00074 
00075         
00076 
00077         
00078 
00079 
00080 
00081 #include <ConversionException.h>
00082 #include <DuplicateKey.h>
00083 #include <UniquenessViolationException.h>
00084 #include <NoSuchRow.h>
00085 #include <DuplicateKey.h>
00086 using asdm::DuplicateKey;
00087 using asdm::ConversionException;
00088 using asdm::NoSuchRow;
00089 using asdm::DuplicateKey;
00090 
00091 #ifndef WITHOUT_ACS
00092 #include <asdmIDLC.h>
00093 using asdmIDL::DelayModelTableIDL;
00094 #endif
00095 
00096 #include <Representable.h>
00097 
00098 namespace asdm {
00099 
00100 //class asdm::ASDM;
00101 //class asdm::DelayModelRow;
00102 
00103 class ASDM;
00104 class DelayModelRow;
00213 class DelayModelTable : public Representable {
00214         friend class ASDM;
00215 
00216 public:
00217 
00218 
00224         static vector<string> getKeyName();
00225 
00226 
00227         virtual ~DelayModelTable();
00228         
00234         ASDM &getContainer() const;
00235         
00241         unsigned int size() ;
00242         
00248         string getName() const;
00249         
00255          static const vector<string>& getAttributesNames();
00256 
00260         Entity getEntity() const;
00261 
00266         void setEntity(Entity e);
00267                 
00275         string toXML()  ;
00276 
00277 #ifndef WITHOUT_ACS
00278         // Conversion Methods
00284         DelayModelTableIDL *toIDL() ;
00285 #endif
00286 
00287 #ifndef WITHOUT_ACS
00288 
00294         void fromIDL(DelayModelTableIDL x) ;
00295 #endif
00296         
00297         //
00298         // ====> Row creation.
00299         //
00300         
00305         DelayModelRow *newRow();
00306         
00307         
00329         DelayModelRow *newRow(Tag antennaId, ArrayTimeInterval timeInterval, ArrayTime timeOrigin, int numPoly, vector<double > atmDryDelay, vector<double > atmWetDelay, vector<double > clockDelay, vector<double > geomDelay);
00330         
00331 
00332 
00345          DelayModelRow *newRow(DelayModelRow *row); 
00346 
00347         //
00348         // ====> Append a row to its table.
00349         //
00350  
00351         
00368         DelayModelRow* add(DelayModelRow* x) ; 
00369 
00370  
00371 
00372 
00373 
00374         //
00375         // ====> Methods returning rows.
00376         //
00377                 
00383         vector<DelayModelRow *> get() ;
00384         
00385 
00393          vector <DelayModelRow*> *getByContext(Tag antennaId);
00394          
00395 
00396 
00397  
00398         
00410         DelayModelRow* getRowByKey(Tag antennaId, ArrayTimeInterval timeInterval);
00411 
00412                 
00413 
00414 
00415 
00439         DelayModelRow* lookup(Tag antennaId, ArrayTimeInterval timeInterval, ArrayTime timeOrigin, int numPoly, vector<double > atmDryDelay, vector<double > atmWetDelay, vector<double > clockDelay, vector<double > geomDelay); 
00440 
00441 
00442 private:
00443 
00452         DelayModelTable (ASDM & container);
00453 
00454         ASDM & container;
00455         
00456         bool archiveAsBin; // If true archive binary else archive XML
00457         bool fileAsBin ; // If true file binary else file XML   
00458         
00459         Entity entity;
00460         
00461 
00462 
00466         static string tableName;
00467         
00471         static const vector<string> attributesNames;
00472         
00476         static vector<string> initAttributesNames();
00477 
00478 
00482         static vector<string> key;
00483 
00484 
00492         DelayModelRow* checkAndAdd(DelayModelRow* x) ;
00493 
00494 
00495         
00496         
00504          DelayModelRow * insertByStartTime(DelayModelRow* x, vector<DelayModelRow* >& row);
00505           
00506 
00507 
00508 // A data structure to store the pointers on the table's rows.
00509 
00510 // In all cases we maintain a private vector of DelayModelRow s.
00511    vector<DelayModelRow * > privateRows;
00512    
00513 
00514         
00515 
00516         
00517         
00518                 
00519                                 
00520         typedef vector <DelayModelRow* > TIME_ROWS;
00521         map<string, TIME_ROWS > context;
00522                 
00527          string Key(Tag antennaId) ;
00528                  
00529                 
00530         
00531         
00537         void getByKeyNoAutoIncNoTime(vector <DelayModelRow*>& vin, vector <DelayModelRow*>& vout,  Tag antennaId);
00538         
00539 
00540         
00541         void error() ; //throw(ConversionException);
00542 
00543         
00550         void fromXML(string xmlDoc) ;
00551                 
00556         void setFromMIMEFile(const string& directory);
00557         void setFromXMLFile(const string& directory);
00558         
00566         string toMIME(const asdm::ByteOrder* byteOrder=asdm::ByteOrder::Machine_Endianity);
00567   
00568         
00575          void setFromMIME(const string & mimeMsg);
00576         
00580         string MIMEXMLPart(const asdm::ByteOrder* byteOrder=asdm::ByteOrder::Machine_Endianity);
00581         
00591           void toFile(string directory);
00592           
00601          void setFromFile(const string& directory);     
00602  
00603 };
00604 
00605 } // End namespace asdm
00606 
00607 #endif /* DelayModelTable_CLASS */
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines