FeedTable.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 FeedTable.h
00032  */
00033  
00034 #ifndef FeedTable_CLASS
00035 #define FeedTable_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 /*
00070 #include <Enumerations.h>
00071 using namespace enumerations;
00072 */
00073 
00074 
00075 
00076 
00077         
00078 
00079         
00080 
00081         
00082 
00083         
00084 
00085         
00086 
00087         
00088 
00089         
00090 
00091         
00092 
00093         
00094 #include "CPolarizationType.h"
00095 using namespace PolarizationTypeMod;
00096         
00097 
00098         
00099 
00100         
00101 
00102         
00103 
00104         
00105 
00106         
00107 
00108 
00109 #ifndef WITHOUT_ACS
00110 #include <asdmIDLC.h>
00111 using asdmIDL::FeedTableIDL;
00112 #endif
00113 
00114 using asdm::Angle;
00115 using asdm::AngularRate;
00116 using asdm::ArrayTime;
00117 using asdm::Complex;
00118 using asdm::Entity;
00119 using asdm::EntityId;
00120 using asdm::EntityRef;
00121 using asdm::Flux;
00122 using asdm::Frequency;
00123 using asdm::Humidity;
00124 using asdm::Interval;
00125 using asdm::Length;
00126 using asdm::PartId;
00127 using asdm::Pressure;
00128 using asdm::Speed;
00129 using asdm::Tag;
00130 using asdm::Temperature;
00131 
00132 using asdm::DuplicateKey;
00133 using asdm::ConversionException;
00134 using asdm::NoSuchRow;
00135 using asdm::DuplicateKey;
00136 
00137 #include <Representable.h>
00138 
00139 namespace asdm {
00140 
00141 //class asdm::ASDM;
00142 //class asdm::FeedRow;
00143 
00144 class ASDM;
00145 class FeedRow;
00284 class FeedTable : public Representable {
00285         friend class asdm::ASDM;
00286 
00287 public:
00288 
00289 
00295         static vector<string> getKeyName();
00296 
00297 
00298         virtual ~FeedTable();
00299         
00305         ASDM &getContainer() const;
00306         
00312         unsigned int size() ;
00313         
00319         string getName() const;
00320 
00324         Entity getEntity() const;
00325 
00330         void setEntity(Entity e);
00331 
00332         //
00333         // ====> Row creation.
00334         //
00335         
00340         FeedRow *newRow();
00341         
00346         FeedRow* newRowEmpty();
00347 
00348         
00374         FeedRow *newRow(Tag antennaId, Tag spectralWindowId, ArrayTimeInterval timeInterval, vector<int>  receiverId, int numReceptor, vector<vector<double > > beamOffset, vector<vector<Length > > focusReference, vector<PolarizationType > polarizationTypes, vector<vector<Complex > > polResponse, vector<Angle > receptorAngle);
00375         
00380         FeedRow *newRowFull(Tag antennaId, Tag spectralWindowId, ArrayTimeInterval timeInterval, vector<int>  receiverId, int numReceptor, vector<vector<double > > beamOffset, vector<vector<Length > > focusReference, vector<PolarizationType > polarizationTypes, vector<vector<Complex > > polResponse, vector<Angle > receptorAngle);
00381 
00382 
00395          FeedRow *newRow(FeedRow *row); 
00396 
00401          FeedRow *newRowCopy(FeedRow *row); 
00402 
00403         //
00404         // ====> Append a row to its table.
00405         //
00406 
00407         
00408          
00409         
00410         
00420          FeedRow* add(FeedRow* x) ;
00421 
00422 
00423 
00424         //
00425         // ====> Methods returning rows.
00426         //
00427                 
00433         vector<FeedRow *> get() ;
00434         
00435 
00443          vector <FeedRow*> *getByContext(Tag antennaId, Tag spectralWindowId);
00444          
00445 
00446 
00447  
00448         
00464         FeedRow* FeedTable::getRowByKey(int feedId, Tag antennaId, Tag spectralWindowId, ArrayTimeInterval timeInterval);
00465 
00466                 
00467         
00475         vector <FeedRow *>  FeedTable::getRowByFeedId(int);
00476 
00477 
00478 
00506         FeedRow* lookup(Tag antennaId, Tag spectralWindowId, ArrayTimeInterval timeInterval, vector<int>  receiverId, int numReceptor, vector<vector<double > > beamOffset, vector<vector<Length > > focusReference, vector<PolarizationType > polarizationTypes, vector<vector<Complex > > polResponse, vector<Angle > receptorAngle); 
00507 
00508 
00509 #ifndef WITHOUT_ACS
00510         // Conversion Methods
00516         FeedTableIDL *toIDL() ;
00517 #endif
00518 
00519 #ifndef WITHOUT_ACS
00520 
00526         void fromIDL(FeedTableIDL x) throw(DuplicateKey,ConversionException);
00527 #endif
00528 
00532         char *toFITS() const throw(ConversionException);
00533 
00537         void fromFITS(char *fits) throw(ConversionException);
00538 
00542         string toVOTable() const throw(ConversionException);
00543 
00547         void fromVOTable(string vo) throw(ConversionException);
00548 
00555         string toXML()  throw(ConversionException);
00556         
00562         void fromXML(string xmlDoc) throw(ConversionException);
00563         
00569         string toMIME();
00570         
00577          void setFromMIME(const string & mimeMsg);
00578         
00588           void toFile(string directory);
00589           
00598          void setFromFile(const string& directory);     
00599 
00600 private:
00601 
00610         FeedTable (ASDM & container);
00611 
00612         ASDM & container;
00613         
00614         bool archiveAsBin; // If true archive binary else archive XML
00615         bool fileAsBin ; // If true file binary else file XML   
00616         
00617         Entity entity;
00618         
00619 
00620 
00624         static string tableName;
00625 
00626 
00630         static vector<string> key;
00631 
00632 
00638         FeedRow* checkAndAdd(FeedRow* x) throw (DuplicateKey, UniquenessViolationException);
00639 
00640 
00641         
00642         
00650          FeedRow * insertByStartTime(FeedRow* x, vector<FeedRow* >& row);
00651           
00652 
00653 
00654 // A data structure to store the pointers on the table's rows.
00655 
00656 // In all cases we maintain a private ArrayList of FeedRow s.
00657    vector<FeedRow * > privateRows;
00658    
00659 
00660         
00661 
00662         
00663         
00664                 
00665                 
00666         typedef vector <vector <FeedRow* > > ID_TIME_ROWS;
00667         map<string, ID_TIME_ROWS > context;
00668         
00673          string Key(Tag antennaId, Tag spectralWindowId) ;
00674                 
00675                 
00676         
00677         
00683         void getByKeyNoAutoIncNoTime(vector <FeedRow*>& vin, vector <FeedRow*>& vout,  Tag antennaId, Tag spectralWindowId);
00684         
00685 
00686 
00687         void error() throw(ConversionException);
00688 
00689 };
00690 
00691 } // End namespace asdm
00692 
00693 #endif /* FeedTable_CLASS */

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