TotalPowerTable.h

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 #include <Angle.h>
00046 #include <AngularRate.h>
00047 #include <ArrayTime.h>
00048 #include <ArrayTimeInterval.h>
00049 #include <Complex.h>
00050 #include <Entity.h>
00051 #include <EntityId.h>
00052 #include <EntityRef.h>
00053 #include <Flux.h>
00054 #include <Frequency.h>
00055 #include <Humidity.h>
00056 #include <Interval.h>
00057 #include <Length.h>
00058 #include <PartId.h>
00059 #include <Pressure.h>
00060 #include <Speed.h>
00061 #include <Tag.h>
00062 #include <Temperature.h>
00063 #include <ConversionException.h>
00064 #include <DuplicateKey.h>
00065 #include <UniquenessViolationException.h>
00066 #include <NoSuchRow.h>
00067 #include <DuplicateKey.h>
00068 
00069 #ifndef WITHOUT_ACS
00070 #include <asdmIDLC.h>
00071 using asdmIDL::TotalPowerTableIDL;
00072 #endif
00073 
00074 using asdm::Angle;
00075 using asdm::AngularRate;
00076 using asdm::ArrayTime;
00077 using asdm::Complex;
00078 using asdm::Entity;
00079 using asdm::EntityId;
00080 using asdm::EntityRef;
00081 using asdm::Flux;
00082 using asdm::Frequency;
00083 using asdm::Humidity;
00084 using asdm::Interval;
00085 using asdm::Length;
00086 using asdm::PartId;
00087 using asdm::Pressure;
00088 using asdm::Speed;
00089 using asdm::Tag;
00090 using asdm::Temperature;
00091 
00092 using asdm::DuplicateKey;
00093 using asdm::ConversionException;
00094 using asdm::NoSuchRow;
00095 using asdm::DuplicateKey;
00096 
00097 #include <Representable.h>
00098 
00099 namespace asdm {
00100 
00101 //class asdm::ASDM;
00102 //class asdm::TotalPowerRow;
00103 
00104 class ASDM;
00105 class TotalPowerRow;
00233 class TotalPowerTable : public Representable {
00234         friend class asdm::ASDM;
00235 
00236 public:
00237 
00238 
00244         static vector<string> getKeyName();
00245 
00246 
00247         virtual ~TotalPowerTable();
00248         
00254         ASDM &getContainer() const;
00255         
00261         unsigned int size() ;
00262         
00268         string getName() const;
00269 
00273         Entity getEntity() const;
00274 
00279         void setEntity(Entity e);
00280 
00281         //
00282         // ====> Row creation.
00283         //
00284         
00289         TotalPowerRow *newRow();
00290         
00295         TotalPowerRow *newRowEmpty();
00296         
00334         TotalPowerRow *newRow(Tag configDescriptionId, Tag fieldId, ArrayTime time, Tag execBlockId, vector<Tag>  stateId, 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);
00335 
00340         TotalPowerRow *newRowFull(Tag configDescriptionId, Tag fieldId, ArrayTime time, Tag execBlockId, vector<Tag>  stateId, 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);
00341 
00354          TotalPowerRow *newRow(TotalPowerRow *row); 
00355 
00360          TotalPowerRow *newRowCopy(TotalPowerRow *row); 
00361 
00362         //
00363         // ====> Append a row to its table.
00364         //
00365  
00366         
00379         TotalPowerRow* add(TotalPowerRow* x) ; 
00380         
00381 
00382         //
00383         // ====> Methods returning rows.
00384         //
00385                 
00391         vector<TotalPowerRow *> get() ;
00392         
00393 
00401          vector <TotalPowerRow*> *getByContext(Tag configDescriptionId, Tag fieldId);
00402  
00403         
00417         TotalPowerRow* TotalPowerTable::getRowByKey(Tag configDescriptionId, Tag fieldId, ArrayTime time);
00418 
00419                 
00420 
00421 
00422 
00462         TotalPowerRow* lookup(Tag configDescriptionId, Tag fieldId, ArrayTime time, Tag execBlockId, vector<Tag>  stateId, 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); 
00463 
00464 
00465 #ifndef WITHOUT_ACS
00466         // Conversion Methods
00472         TotalPowerTableIDL *toIDL() ;
00473 #endif
00474 
00475 #ifndef WITHOUT_ACS
00476 
00482         void fromIDL(TotalPowerTableIDL x) throw(DuplicateKey,ConversionException);
00483 #endif
00484 
00488         char *toFITS() const throw(ConversionException);
00489 
00493         void fromFITS(char *fits) throw(ConversionException);
00494 
00498         string toVOTable() const throw(ConversionException);
00499 
00503         void fromVOTable(string vo) throw(ConversionException);
00504 
00511         string toXML()  throw(ConversionException);
00512         
00518         void fromXML(string xmlDoc) throw(ConversionException);
00519         
00525         string toMIME();        
00526 
00533          void setFromMIME(const string & mimeMsg);
00534          
00543           void toFile(string directory);
00544           
00553          void setFromFile(const string& directory);              
00554 private:
00555 
00564         TotalPowerTable (ASDM & container);
00565 
00566         ASDM & container;
00567         
00568         bool archiveAsBin; // If true archive binary else archive XML
00569         bool fileAsBin; // If true file binary else file XML            
00570         
00571         Entity entity;
00572         
00573 
00574 
00578         static string tableName;
00579 
00580 
00584         static vector<string> key;
00585 
00586 
00592         TotalPowerRow* checkAndAdd(TotalPowerRow* x) throw (DuplicateKey);
00593 
00594 
00595 
00596 // A data structure to store the pointers on the table's rows.
00597 
00598 // In all cases we maintain a private ArrayList of TotalPowerRow s.
00599    vector<TotalPowerRow * > privateRows;
00600   
00601 
00607         void getByRequiredValue(vector <TotalPowerRow*>& vin, vector <TotalPowerRow*>& vout,  Tag execBlockId, vector<Tag>  stateId, 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);
00608 
00609 
00610 
00611 
00612 
00613 
00614 
00615         void error() throw(ConversionException);
00616         
00617 
00618         
00619         map<string, vector<TotalPowerRow*> > context;
00620         
00621         string Key( const Tag& configDescriptionId, const Tag& fiedId);
00622         
00623         TotalPowerRow * insertByTime(TotalPowerRow* x, vector<TotalPowerRow *>&row);
00624 
00625 };
00626 
00627 } // End namespace asdm
00628 
00629 #endif /* TotalPowerTable_CLASS */

Generated on Thu Nov 29 16:46:47 2007 for ASDM C++ Implementation by  doxygen 1.5.1