ConfigDescriptionTable.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 ConfigDescriptionTable.h
00032  */
00033  
00034 #ifndef ConfigDescriptionTable_CLASS
00035 #define ConfigDescriptionTable_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 #include "CCorrelationMode.h"
00087 using namespace CorrelationModeMod;
00088         
00089 
00090         
00091 
00092         
00093 
00094         
00095 #include "CAtmPhaseCorrection.h"
00096 using namespace AtmPhaseCorrectionMod;
00097         
00098 
00099         
00100 #include "CSpectralResolutionType.h"
00101 using namespace SpectralResolutionTypeMod;
00102         
00103 
00104 
00105 #ifndef WITHOUT_ACS
00106 #include <asdmIDLC.h>
00107 using asdmIDL::ConfigDescriptionTableIDL;
00108 #endif
00109 
00110 using asdm::Angle;
00111 using asdm::AngularRate;
00112 using asdm::ArrayTime;
00113 using asdm::Complex;
00114 using asdm::Entity;
00115 using asdm::EntityId;
00116 using asdm::EntityRef;
00117 using asdm::Flux;
00118 using asdm::Frequency;
00119 using asdm::Humidity;
00120 using asdm::Interval;
00121 using asdm::Length;
00122 using asdm::PartId;
00123 using asdm::Pressure;
00124 using asdm::Speed;
00125 using asdm::Tag;
00126 using asdm::Temperature;
00127 
00128 using asdm::DuplicateKey;
00129 using asdm::ConversionException;
00130 using asdm::NoSuchRow;
00131 using asdm::DuplicateKey;
00132 
00133 #include <Representable.h>
00134 
00135 namespace asdm {
00136 
00137 //class asdm::ASDM;
00138 //class asdm::ConfigDescriptionRow;
00139 
00140 class ASDM;
00141 class ConfigDescriptionRow;
00256 class ConfigDescriptionTable : public Representable {
00257         friend class asdm::ASDM;
00258 
00259 public:
00260 
00261 
00267         static vector<string> getKeyName();
00268 
00269 
00270         virtual ~ConfigDescriptionTable();
00271         
00277         ASDM &getContainer() const;
00278         
00284         unsigned int size() ;
00285         
00291         string getName() const;
00292 
00296         Entity getEntity() const;
00297 
00302         void setEntity(Entity e);
00303 
00304         //
00305         // ====> Row creation.
00306         //
00307         
00312         ConfigDescriptionRow *newRow();
00313         
00318         ConfigDescriptionRow* newRowEmpty();
00319 
00320         
00346         ConfigDescriptionRow *newRow(vector<Tag>  antennaId, vector<Tag>  dataDescriptionId, vector<int>  feedId, Tag processorId, vector<Tag>  switchCycleId, int numAntenna, int numFeed, vector<int > numSubBand, CorrelationMode correlationMode, AtmPhaseCorrection atmPhaseCorrection);
00347         
00352         ConfigDescriptionRow *newRowFull(vector<Tag>  antennaId, vector<Tag>  dataDescriptionId, vector<int>  feedId, Tag processorId, vector<Tag>  switchCycleId, int numAntenna, int numFeed, vector<int > numSubBand, CorrelationMode correlationMode, AtmPhaseCorrection atmPhaseCorrection);
00353 
00354 
00367          ConfigDescriptionRow *newRow(ConfigDescriptionRow *row); 
00368 
00373          ConfigDescriptionRow *newRowCopy(ConfigDescriptionRow *row); 
00374 
00375         //
00376         // ====> Append a row to its table.
00377         //
00378 
00379         
00380         
00381         
00391          ConfigDescriptionRow* add(ConfigDescriptionRow* x) ;
00392 
00393 
00394 
00395         //
00396         // ====> Methods returning rows.
00397         //
00398                 
00404         vector<ConfigDescriptionRow *> get() ;
00405         
00406 
00407 
00408  
00409         
00419         ConfigDescriptionRow* ConfigDescriptionTable::getRowByKey(Tag configDescriptionId);
00420 
00421                 
00422 
00423 
00424 
00452         ConfigDescriptionRow* lookup(vector<Tag>  antennaId, vector<Tag>  dataDescriptionId, vector<int>  feedId, Tag processorId, vector<Tag>  switchCycleId, int numAntenna, int numFeed, vector<int > numSubBand, CorrelationMode correlationMode, AtmPhaseCorrection atmPhaseCorrection); 
00453 
00454 
00455 #ifndef WITHOUT_ACS
00456         // Conversion Methods
00462         ConfigDescriptionTableIDL *toIDL() ;
00463 #endif
00464 
00465 #ifndef WITHOUT_ACS
00466 
00472         void fromIDL(ConfigDescriptionTableIDL x) throw(DuplicateKey,ConversionException);
00473 #endif
00474 
00478         char *toFITS() const throw(ConversionException);
00479 
00483         void fromFITS(char *fits) throw(ConversionException);
00484 
00488         string toVOTable() const throw(ConversionException);
00489 
00493         void fromVOTable(string vo) throw(ConversionException);
00494 
00501         string toXML()  throw(ConversionException);
00502         
00508         void fromXML(string xmlDoc) throw(ConversionException);
00509         
00515         string toMIME();
00516         
00523          void setFromMIME(const string & mimeMsg);
00524         
00534           void toFile(string directory);
00535           
00544          void setFromFile(const string& directory);     
00545 
00546 private:
00547 
00556         ConfigDescriptionTable (ASDM & container);
00557 
00558         ASDM & container;
00559         
00560         bool archiveAsBin; // If true archive binary else archive XML
00561         bool fileAsBin ; // If true file binary else file XML   
00562         
00563         Entity entity;
00564         
00565 
00566         // A map for the autoincrementation algorithm
00567         map<string,int>  noAutoIncIds;
00568         void autoIncrement(string key, ConfigDescriptionRow* x);
00569 
00570 
00574         static string tableName;
00575 
00576 
00580         static vector<string> key;
00581 
00582 
00588         ConfigDescriptionRow* checkAndAdd(ConfigDescriptionRow* x) throw (DuplicateKey, UniquenessViolationException);
00589 
00590 
00591 
00592 // A data structure to store the pointers on the table's rows.
00593 
00594 // In all cases we maintain a private ArrayList of ConfigDescriptionRow s.
00595    vector<ConfigDescriptionRow * > privateRows;
00596    
00597 
00598                         
00599         vector<ConfigDescriptionRow *> row;
00600 
00601 
00602         void error() throw(ConversionException);
00603 
00604 };
00605 
00606 } // End namespace asdm
00607 
00608 #endif /* ConfigDescriptionTable_CLASS */

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