casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
ASDM.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 ASDM.h
00032  */
00033  
00034 #ifndef ASDM_CLASS
00035 #define ASDM_CLASS
00036 
00037 #include <vector>
00038 #include <map>
00039 
00040 #include <Representable.h>
00041 #include <Entity.h>
00042 #include <EntityId.h>
00043 #include <ArrayTime.h>
00044 #include <IllegalAccessException.h>
00045 #include <InvalidArgumentException.h>
00046 
00047 #include <Misc.h>
00048 
00049 #ifndef WITHOUT_ACS
00050 #include <asdmIDLC.h> 
00051 //using namespace asdmIDL;   /// <-------------------
00052 #endif
00053 
00054 /*\file ASDM.h
00055     \brief Generated from model's revision "1.61", branch "HEAD"
00056 */
00057 
00058 namespace asdm {
00059 
00060 
00061 //class asdm::MainTable;
00062 class MainTable;
00063 
00064 //class asdm::AlmaRadiometerTable;
00065 class AlmaRadiometerTable;
00066 
00067 //class asdm::AnnotationTable;
00068 class AnnotationTable;
00069 
00070 //class asdm::AntennaTable;
00071 class AntennaTable;
00072 
00073 //class asdm::CalAmpliTable;
00074 class CalAmpliTable;
00075 
00076 //class asdm::CalAtmosphereTable;
00077 class CalAtmosphereTable;
00078 
00079 //class asdm::CalBandpassTable;
00080 class CalBandpassTable;
00081 
00082 //class asdm::CalCurveTable;
00083 class CalCurveTable;
00084 
00085 //class asdm::CalDataTable;
00086 class CalDataTable;
00087 
00088 //class asdm::CalDelayTable;
00089 class CalDelayTable;
00090 
00091 //class asdm::CalDeviceTable;
00092 class CalDeviceTable;
00093 
00094 //class asdm::CalFluxTable;
00095 class CalFluxTable;
00096 
00097 //class asdm::CalFocusTable;
00098 class CalFocusTable;
00099 
00100 //class asdm::CalFocusModelTable;
00101 class CalFocusModelTable;
00102 
00103 //class asdm::CalGainTable;
00104 class CalGainTable;
00105 
00106 //class asdm::CalHolographyTable;
00107 class CalHolographyTable;
00108 
00109 //class asdm::CalPhaseTable;
00110 class CalPhaseTable;
00111 
00112 //class asdm::CalPointingTable;
00113 class CalPointingTable;
00114 
00115 //class asdm::CalPointingModelTable;
00116 class CalPointingModelTable;
00117 
00118 //class asdm::CalPositionTable;
00119 class CalPositionTable;
00120 
00121 //class asdm::CalPrimaryBeamTable;
00122 class CalPrimaryBeamTable;
00123 
00124 //class asdm::CalReductionTable;
00125 class CalReductionTable;
00126 
00127 //class asdm::CalSeeingTable;
00128 class CalSeeingTable;
00129 
00130 //class asdm::CalWVRTable;
00131 class CalWVRTable;
00132 
00133 //class asdm::ConfigDescriptionTable;
00134 class ConfigDescriptionTable;
00135 
00136 //class asdm::CorrelatorModeTable;
00137 class CorrelatorModeTable;
00138 
00139 //class asdm::DataDescriptionTable;
00140 class DataDescriptionTable;
00141 
00142 //class asdm::DelayModelTable;
00143 class DelayModelTable;
00144 
00145 //class asdm::DopplerTable;
00146 class DopplerTable;
00147 
00148 //class asdm::EphemerisTable;
00149 class EphemerisTable;
00150 
00151 //class asdm::ExecBlockTable;
00152 class ExecBlockTable;
00153 
00154 //class asdm::FeedTable;
00155 class FeedTable;
00156 
00157 //class asdm::FieldTable;
00158 class FieldTable;
00159 
00160 //class asdm::FlagTable;
00161 class FlagTable;
00162 
00163 //class asdm::FlagCmdTable;
00164 class FlagCmdTable;
00165 
00166 //class asdm::FocusTable;
00167 class FocusTable;
00168 
00169 //class asdm::FocusModelTable;
00170 class FocusModelTable;
00171 
00172 //class asdm::FreqOffsetTable;
00173 class FreqOffsetTable;
00174 
00175 //class asdm::GainTrackingTable;
00176 class GainTrackingTable;
00177 
00178 //class asdm::HistoryTable;
00179 class HistoryTable;
00180 
00181 //class asdm::HolographyTable;
00182 class HolographyTable;
00183 
00184 //class asdm::ObservationTable;
00185 class ObservationTable;
00186 
00187 //class asdm::PointingTable;
00188 class PointingTable;
00189 
00190 //class asdm::PointingModelTable;
00191 class PointingModelTable;
00192 
00193 //class asdm::PolarizationTable;
00194 class PolarizationTable;
00195 
00196 //class asdm::ProcessorTable;
00197 class ProcessorTable;
00198 
00199 //class asdm::ReceiverTable;
00200 class ReceiverTable;
00201 
00202 //class asdm::SBSummaryTable;
00203 class SBSummaryTable;
00204 
00205 //class asdm::ScaleTable;
00206 class ScaleTable;
00207 
00208 //class asdm::ScanTable;
00209 class ScanTable;
00210 
00211 //class asdm::SeeingTable;
00212 class SeeingTable;
00213 
00214 //class asdm::SourceTable;
00215 class SourceTable;
00216 
00217 //class asdm::SpectralWindowTable;
00218 class SpectralWindowTable;
00219 
00220 //class asdm::SquareLawDetectorTable;
00221 class SquareLawDetectorTable;
00222 
00223 //class asdm::StateTable;
00224 class StateTable;
00225 
00226 //class asdm::StationTable;
00227 class StationTable;
00228 
00229 //class asdm::SubscanTable;
00230 class SubscanTable;
00231 
00232 //class asdm::SwitchCycleTable;
00233 class SwitchCycleTable;
00234 
00235 //class asdm::SysCalTable;
00236 class SysCalTable;
00237 
00238 //class asdm::SysPowerTable;
00239 class SysPowerTable;
00240 
00241 //class asdm::TotalPowerTable;
00242 class TotalPowerTable;
00243 
00244 //class asdm::WVMCalTable;
00245 class WVMCalTable;
00246 
00247 //class asdm::WeatherTable;
00248 class WeatherTable;
00249 
00250 
00258 //class ASDM : public Representable {
00259 class ASDM {
00260 
00261 public:
00265         ASDM ();
00266         
00267         virtual ~ASDM ();
00268         
00269 
00274         MainTable & getMain () const;
00275 
00280         AlmaRadiometerTable & getAlmaRadiometer () const;
00281 
00286         AnnotationTable & getAnnotation () const;
00287 
00292         AntennaTable & getAntenna () const;
00293 
00298         CalAmpliTable & getCalAmpli () const;
00299 
00304         CalAtmosphereTable & getCalAtmosphere () const;
00305 
00310         CalBandpassTable & getCalBandpass () const;
00311 
00316         CalCurveTable & getCalCurve () const;
00317 
00322         CalDataTable & getCalData () const;
00323 
00328         CalDelayTable & getCalDelay () const;
00329 
00334         CalDeviceTable & getCalDevice () const;
00335 
00340         CalFluxTable & getCalFlux () const;
00341 
00346         CalFocusTable & getCalFocus () const;
00347 
00352         CalFocusModelTable & getCalFocusModel () const;
00353 
00358         CalGainTable & getCalGain () const;
00359 
00364         CalHolographyTable & getCalHolography () const;
00365 
00370         CalPhaseTable & getCalPhase () const;
00371 
00376         CalPointingTable & getCalPointing () const;
00377 
00382         CalPointingModelTable & getCalPointingModel () const;
00383 
00388         CalPositionTable & getCalPosition () const;
00389 
00394         CalPrimaryBeamTable & getCalPrimaryBeam () const;
00395 
00400         CalReductionTable & getCalReduction () const;
00401 
00406         CalSeeingTable & getCalSeeing () const;
00407 
00412         CalWVRTable & getCalWVR () const;
00413 
00418         ConfigDescriptionTable & getConfigDescription () const;
00419 
00424         CorrelatorModeTable & getCorrelatorMode () const;
00425 
00430         DataDescriptionTable & getDataDescription () const;
00431 
00436         DelayModelTable & getDelayModel () const;
00437 
00442         DopplerTable & getDoppler () const;
00443 
00448         EphemerisTable & getEphemeris () const;
00449 
00454         ExecBlockTable & getExecBlock () const;
00455 
00460         FeedTable & getFeed () const;
00461 
00466         FieldTable & getField () const;
00467 
00472         FlagTable & getFlag () const;
00473 
00478         FlagCmdTable & getFlagCmd () const;
00479 
00484         FocusTable & getFocus () const;
00485 
00490         FocusModelTable & getFocusModel () const;
00491 
00496         FreqOffsetTable & getFreqOffset () const;
00497 
00502         GainTrackingTable & getGainTracking () const;
00503 
00508         HistoryTable & getHistory () const;
00509 
00514         HolographyTable & getHolography () const;
00515 
00520         ObservationTable & getObservation () const;
00521 
00526         PointingTable & getPointing () const;
00527 
00532         PointingModelTable & getPointingModel () const;
00533 
00538         PolarizationTable & getPolarization () const;
00539 
00544         ProcessorTable & getProcessor () const;
00545 
00550         ReceiverTable & getReceiver () const;
00551 
00556         SBSummaryTable & getSBSummary () const;
00557 
00562         ScaleTable & getScale () const;
00563 
00568         ScanTable & getScan () const;
00569 
00574         SeeingTable & getSeeing () const;
00575 
00580         SourceTable & getSource () const;
00581 
00586         SpectralWindowTable & getSpectralWindow () const;
00587 
00592         SquareLawDetectorTable & getSquareLawDetector () const;
00593 
00598         StateTable & getState () const;
00599 
00604         StationTable & getStation () const;
00605 
00610         SubscanTable & getSubscan () const;
00611 
00616         SwitchCycleTable & getSwitchCycle () const;
00617 
00622         SysCalTable & getSysCal () const;
00623 
00628         SysPowerTable & getSysPower () const;
00629 
00634         TotalPowerTable & getTotalPower () const;
00635 
00640         WVMCalTable & getWVMCal () const;
00641 
00646         WeatherTable & getWeather () const;
00647 
00653         virtual std::string toXML();
00654         
00664         void toXML(std::string directory) ;
00665         
00676         virtual void fromXML(std::string xml) ;
00677                 
00690         static ASDM *getFromXML(std::string xmlDirectory) ;
00691         
00697         std::string toMIME();
00698         
00705          void setFromMIME(const std::string & mimeMsg); 
00706 
00721         void toFile(std::string directory);
00722 
00737          void setFromFile(std::string directory, bool loadTablesOnDemand);
00738          
00774          void setFromFile(std::string directory, const ASDMParseOptions&  parse=ASDMParseOptions());
00775          
00784           bool checkRowUniqueness() const ;
00785         
00786         #ifndef WITHOUT_ACS
00787 
00791         virtual asdmIDL::ASDMDataSetIDL* toIDL();  
00792         
00801         virtual void fromIDL(asdmIDL::ASDMDataSetIDL* x); 
00802         #endif
00803                 
00804         virtual Entity getEntity() const;
00805 
00806         virtual void setEntity(Entity e);
00807         
00811         virtual std::string getName() const;
00812         
00816         virtual unsigned int size() ;
00817         
00818 #ifndef WITHOUT_ACS
00819 
00825         static ASDM *fromArchive(EntityId datasetId) ;
00826 #endif
00827 
00828 #ifndef WITHOUT_ACS
00829 
00833         void updateArchive() const ;
00834 #endif
00835         
00841         Representable &getTable(std::string tableName) ;
00842 
00843         
00844         
00845         // ===> Attribute timeOfCreation
00846         
00847         
00848         
00849 
00850         
00855         ArrayTime getTimeOfCreation() const;
00856         
00857  
00858         
00859         
00867         void setTimeOfCreation (ArrayTime timeOfCreation);
00868                 
00869         
00870         
00871         
00872 
00873 
00874         
00875         // ===> Attribute version
00876         
00877         
00878         
00879 
00880         
00885         int getVersion() const;
00886         
00887  
00888         
00889         
00897         void setVersion (int version);
00898                 
00899         
00900         
00901         
00902 
00903 
00904         
00905         // ===> Attribute xmlnsPrefix
00906         
00907         
00908         
00909 
00910         
00915         string getXmlnsPrefix() const;
00916         
00917  
00918         
00919         
00927         void setXmlnsPrefix (string xmlnsPrefix);
00928                 
00929         
00930         
00931         
00932 
00933 
00934 
00940         enum Origin {
00941                 FILE,  
00942                 ARCHIVE, 
00943                 EX_NIHILO 
00944         };
00945         
00951          Origin getOrigin() const ;
00952          
00960          std::string getDirectory() const ;
00961          
00962          XSLTransformer & getXSLTransformer() ;
00963          
00964 private:
00965 
00966         bool archiveAsBin; // If true archive binary else archive XML
00967         bool fileAsBin ; // If true file binary else file XML           
00968         bool hasBeenAdded;
00969         Origin origin;
00970         bool loadTablesOnDemand_;  // For a dataset which is stored on disk, convert and load in memory only the tables which are used by the code the first time they are referred to.
00971         bool checkRowUniqueness_;  // For a dataset which is stored on disk, when a table is converted and loaded in memory verify (true) or not (false) the fact that each row is unique.
00972         std::string directory;
00973                 
00974 
00978         MainTable * main;
00979 
00983         AlmaRadiometerTable * almaRadiometer;
00984 
00988         AnnotationTable * annotation;
00989 
00993         AntennaTable * antenna;
00994 
00998         CalAmpliTable * calAmpli;
00999 
01003         CalAtmosphereTable * calAtmosphere;
01004 
01008         CalBandpassTable * calBandpass;
01009 
01013         CalCurveTable * calCurve;
01014 
01018         CalDataTable * calData;
01019 
01023         CalDelayTable * calDelay;
01024 
01028         CalDeviceTable * calDevice;
01029 
01033         CalFluxTable * calFlux;
01034 
01038         CalFocusTable * calFocus;
01039 
01043         CalFocusModelTable * calFocusModel;
01044 
01048         CalGainTable * calGain;
01049 
01053         CalHolographyTable * calHolography;
01054 
01058         CalPhaseTable * calPhase;
01059 
01063         CalPointingTable * calPointing;
01064 
01068         CalPointingModelTable * calPointingModel;
01069 
01073         CalPositionTable * calPosition;
01074 
01078         CalPrimaryBeamTable * calPrimaryBeam;
01079 
01083         CalReductionTable * calReduction;
01084 
01088         CalSeeingTable * calSeeing;
01089 
01093         CalWVRTable * calWVR;
01094 
01098         ConfigDescriptionTable * configDescription;
01099 
01103         CorrelatorModeTable * correlatorMode;
01104 
01108         DataDescriptionTable * dataDescription;
01109 
01113         DelayModelTable * delayModel;
01114 
01118         DopplerTable * doppler;
01119 
01123         EphemerisTable * ephemeris;
01124 
01128         ExecBlockTable * execBlock;
01129 
01133         FeedTable * feed;
01134 
01138         FieldTable * field;
01139 
01143         FlagTable * flag;
01144 
01148         FlagCmdTable * flagCmd;
01149 
01153         FocusTable * focus;
01154 
01158         FocusModelTable * focusModel;
01159 
01163         FreqOffsetTable * freqOffset;
01164 
01168         GainTrackingTable * gainTracking;
01169 
01173         HistoryTable * history;
01174 
01178         HolographyTable * holography;
01179 
01183         ObservationTable * observation;
01184 
01188         PointingTable * pointing;
01189 
01193         PointingModelTable * pointingModel;
01194 
01198         PolarizationTable * polarization;
01199 
01203         ProcessorTable * processor;
01204 
01208         ReceiverTable * receiver;
01209 
01213         SBSummaryTable * sBSummary;
01214 
01218         ScaleTable * scale;
01219 
01223         ScanTable * scan;
01224 
01228         SeeingTable * seeing;
01229 
01233         SourceTable * source;
01234 
01238         SpectralWindowTable * spectralWindow;
01239 
01243         SquareLawDetectorTable * squareLawDetector;
01244 
01248         StateTable * state;
01249 
01253         StationTable * station;
01254 
01258         SubscanTable * subscan;
01259 
01263         SwitchCycleTable * switchCycle;
01264 
01268         SysCalTable * sysCal;
01269 
01273         SysPowerTable * sysPower;
01274 
01278         TotalPowerTable * totalPower;
01279 
01283         WVMCalTable * wVMCal;
01284 
01288         WeatherTable * weather;
01289 
01293         std::vector<Representable *> table;
01294         
01298         //vector<Entity *> tableEntity;
01299         std::map<std::string, Entity> tableEntity;
01300         
01304         Entity entity;
01305 
01306         
01307         
01308         // ===> Attribute timeOfCreation
01309         
01310         
01311 
01312         ArrayTime timeOfCreation;
01313 
01314         
01315         
01316         
01317 
01318         
01319         // ===> Attribute version
01320         
01321         
01322 
01323         int version;
01324 
01325         
01326         
01327         
01328 
01329         
01330         // ===> Attribute xmlnsPrefix
01331         
01332         
01333 
01334         string xmlnsPrefix;
01335 
01336         
01337         
01338         
01339 
01340         
01341         void error() ; // throw(ConversionException);
01342         static std::string getXMLEntity(EntityId id); // throw(ConversionException);
01343         static void putXMLEntity(std::string xml); // throw(ConversionException);
01344         
01345         XSLTransformer xslTransformer;
01346         
01347 };
01348 
01349 } // End namespace asdm
01350 
01351 #endif /* ASDM_CLASS */