TotalPowerTable.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 TotalPowerTable.h
00032  */
00033  
00034 #ifndef TotalPowerTable_CLASS
00035 #define TotalPowerTable_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 <Interval.h>
00051 using  asdm::Interval;
00052 
00053 #include <Tag.h>
00054 using  asdm::Tag;
00055 
00056 #include <Length.h>
00057 using  asdm::Length;
00058 
00059 
00060 
00061 
00062         
00063 
00064         
00065 
00066         
00067 
00068         
00069 
00070         
00071 
00072         
00073 
00074         
00075 
00076         
00077 
00078         
00079 
00080         
00081 
00082         
00083 
00084         
00085 
00086         
00087 
00088 
00089 
00090 #include <ConversionException.h>
00091 #include <DuplicateKey.h>
00092 #include <UniquenessViolationException.h>
00093 #include <NoSuchRow.h>
00094 #include <DuplicateKey.h>
00095 using asdm::DuplicateKey;
00096 using asdm::ConversionException;
00097 using asdm::NoSuchRow;
00098 using asdm::DuplicateKey;
00099 
00100 #ifndef WITHOUT_ACS
00101 #include <asdmIDLC.h>
00102 using asdmIDL::TotalPowerTableIDL;
00103 #endif
00104 
00105 #include <Representable.h>
00106 
00107 namespace asdm {
00108 
00109 //class asdm::ASDM;
00110 //class asdm::TotalPowerRow;
00111 
00112 class ASDM;
00113 class TotalPowerRow;
00266 class TotalPowerTable : public Representable {
00267         friend class ASDM;
00268 
00269 public:
00270 
00271 
00277         static vector<string> getKeyName();
00278 
00279 
00280         virtual ~TotalPowerTable();
00281         
00287         ASDM &getContainer() const;
00288         
00294         unsigned int size() ;
00295         
00301         string getName() const;
00302         
00308          static const vector<string>& getAttributesNames();
00309 
00313         Entity getEntity() const;
00314 
00319         void setEntity(Entity e);
00320                 
00328         string toXML()  ;
00329 
00330 #ifndef WITHOUT_ACS
00331         // Conversion Methods
00337         TotalPowerTableIDL *toIDL() ;
00338 #endif
00339 
00340 #ifndef WITHOUT_ACS
00341 
00347         void fromIDL(TotalPowerTableIDL x) ;
00348 #endif
00349         
00350         //
00351         // ====> Row creation.
00352         //
00353         
00358         TotalPowerRow *newRow();
00359         
00360         
00398         TotalPowerRow *newRow(ArrayTime time, Tag configDescriptionId, Tag fieldId, int scanNumber, int subscanNumber, int integrationNumber, vector<vector<Length > > uvw, vector<vector<Interval > > exposure, vector<vector<ArrayTime > > timeCentroid, vector<vector<vector<float > > > floatData, vector<int > flagAnt, vector<vector<int > > flagPol, bool flagRow, Interval interval, vector<Tag>  stateId, Tag execBlockId);
00399         
00400 
00401 
00414          TotalPowerRow *newRow(TotalPowerRow *row); 
00415 
00416         //
00417         // ====> Append a row to its table.
00418         //
00419  
00420         
00437         TotalPowerRow* add(TotalPowerRow* x) ; 
00438 
00439  
00440 
00441 
00442 
00443         //
00444         // ====> Methods returning rows.
00445         //
00446                 
00452         vector<TotalPowerRow *> get() ;
00453         
00454 
00462          vector <TotalPowerRow*> *getByContext(Tag configDescriptionId, Tag fieldId);
00463          
00464 
00465 
00466  
00467         
00481         TotalPowerRow* getRowByKey(ArrayTime time, Tag configDescriptionId, Tag fieldId);
00482 
00483                 
00484 
00485 
00486 
00526         TotalPowerRow* lookup(ArrayTime time, Tag configDescriptionId, Tag fieldId, int scanNumber, int subscanNumber, int integrationNumber, vector<vector<Length > > uvw, vector<vector<Interval > > exposure, vector<vector<ArrayTime > > timeCentroid, vector<vector<vector<float > > > floatData, vector<int > flagAnt, vector<vector<int > > flagPol, bool flagRow, Interval interval, vector<Tag>  stateId, Tag execBlockId); 
00527 
00528 
00529 private:
00530 
00539         TotalPowerTable (ASDM & container);
00540 
00541         ASDM & container;
00542         
00543         bool archiveAsBin; // If true archive binary else archive XML
00544         bool fileAsBin ; // If true file binary else file XML   
00545         
00546         Entity entity;
00547         
00548 
00549 
00553         static string tableName;
00554         
00558         static const vector<string> attributesNames;
00559         
00563         static vector<string> initAttributesNames();
00564 
00565 
00569         static vector<string> key;
00570 
00571 
00579         TotalPowerRow* checkAndAdd(TotalPowerRow* x) ;
00580 
00581 
00582         
00583         
00591         TotalPowerRow * insertByTime(TotalPowerRow* x, vector<TotalPowerRow *>&row );
00592          
00593 
00594 
00595 // A data structure to store the pointers on the table's rows.
00596 
00597 // In all cases we maintain a private vector of TotalPowerRow s.
00598    vector<TotalPowerRow * > privateRows;
00599    
00600 
00601         
00602 
00603         
00604         
00605                 
00606                                 
00607         typedef vector <TotalPowerRow* > TIME_ROWS;
00608         map<string, TIME_ROWS > context;
00609                 
00614          string Key(Tag configDescriptionId, Tag fieldId) ;
00615                  
00616                 
00617         
00618         
00624         void getByKeyNoAutoIncNoTime(vector <TotalPowerRow*>& vin, vector <TotalPowerRow*>& vout,  Tag configDescriptionId, Tag fieldId);
00625         
00626 
00627         
00628         void error() ; //throw(ConversionException);
00629 
00630         
00637         void fromXML(string xmlDoc) ;
00638                 
00643         void setFromMIMEFile(const string& directory);
00644         void setFromXMLFile(const string& directory);
00645         
00653         string toMIME(const asdm::ByteOrder* byteOrder=asdm::ByteOrder::Machine_Endianity);
00654   
00655         
00662          void setFromMIME(const string & mimeMsg);
00663         
00667         string MIMEXMLPart(const asdm::ByteOrder* byteOrder=asdm::ByteOrder::Machine_Endianity);
00668         
00678           void toFile(string directory);
00679           
00688          void setFromFile(const string& directory);     
00689  
00690 };
00691 
00692 } // End namespace asdm
00693 
00694 #endif /* TotalPowerTable_CLASS */
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines