AlmaCorrelatorModeTable.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 AlmaCorrelatorModeTable.h
00032  */
00033  
00034 #ifndef AlmaCorrelatorModeTable_CLASS
00035 #define AlmaCorrelatorModeTable_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 #ifndef WITHOUT_ACS
00075 #include <asdmIDLC.h>
00076 using asdmIDL::AlmaCorrelatorModeTableIDL;
00077 #endif
00078 
00079 using asdm::Angle;
00080 using asdm::AngularRate;
00081 using asdm::ArrayTime;
00082 using asdm::Complex;
00083 using asdm::Entity;
00084 using asdm::EntityId;
00085 using asdm::EntityRef;
00086 using asdm::Flux;
00087 using asdm::Frequency;
00088 using asdm::Humidity;
00089 using asdm::Interval;
00090 using asdm::Length;
00091 using asdm::PartId;
00092 using asdm::Pressure;
00093 using asdm::Speed;
00094 using asdm::Tag;
00095 using asdm::Temperature;
00096 
00097 using asdm::DuplicateKey;
00098 using asdm::ConversionException;
00099 using asdm::NoSuchRow;
00100 using asdm::DuplicateKey;
00101 
00102 #include <Representable.h>
00103 
00104 namespace asdm {
00105 
00106 //class asdm::ASDM;
00107 //class asdm::AlmaCorrelatorModeRow;
00108 
00109 class ASDM;
00110 class AlmaCorrelatorModeRow;
00186 class AlmaCorrelatorModeTable : public Representable {
00187         friend class asdm::ASDM;
00188 
00189 public:
00190 
00191 
00197         static vector<string> getKeyName();
00198 
00199 
00200         virtual ~AlmaCorrelatorModeTable();
00201         
00207         ASDM &getContainer() const;
00208         
00214         unsigned int size() ;
00215         
00221         string getName() const;
00222 
00226         Entity getEntity() const;
00227 
00232         void setEntity(Entity e);
00233 
00234         //
00235         // ====> Row creation.
00236         //
00237         
00242         AlmaCorrelatorModeRow *newRow();
00243         
00248         AlmaCorrelatorModeRow* newRowEmpty();
00249 
00250         
00272         AlmaCorrelatorModeRow *newRow(int numBaseband, vector<int > basebandIndex, Interval accumMode, vector<int > basebandConfig, int binMode, bool quantization, string windowFunction, vector<int > axesOrderArray);
00273         
00278         AlmaCorrelatorModeRow *newRowFull(int numBaseband, vector<int > basebandIndex, Interval accumMode, vector<int > basebandConfig, int binMode, bool quantization, string windowFunction, vector<int > axesOrderArray);
00279 
00280 
00293          AlmaCorrelatorModeRow *newRow(AlmaCorrelatorModeRow *row); 
00294 
00299          AlmaCorrelatorModeRow *newRowCopy(AlmaCorrelatorModeRow *row); 
00300 
00301         //
00302         // ====> Append a row to its table.
00303         //
00304 
00305         
00306         
00307         
00317          AlmaCorrelatorModeRow* add(AlmaCorrelatorModeRow* x) ;
00318 
00319 
00320 
00321         //
00322         // ====> Methods returning rows.
00323         //
00324                 
00330         vector<AlmaCorrelatorModeRow *> get() ;
00331         
00332 
00333 
00334  
00335         
00345         AlmaCorrelatorModeRow* AlmaCorrelatorModeTable::getRowByKey(Tag almaCorrelatorModeId);
00346 
00347                 
00348 
00349 
00350 
00374         AlmaCorrelatorModeRow* lookup(int numBaseband, vector<int > basebandIndex, Interval accumMode, vector<int > basebandConfig, int binMode, bool quantization, string windowFunction, vector<int > axesOrderArray); 
00375 
00376 
00377 #ifndef WITHOUT_ACS
00378         // Conversion Methods
00384         AlmaCorrelatorModeTableIDL *toIDL() ;
00385 #endif
00386 
00387 #ifndef WITHOUT_ACS
00388 
00394         void fromIDL(AlmaCorrelatorModeTableIDL x) throw(DuplicateKey,ConversionException);
00395 #endif
00396 
00400         char *toFITS() const throw(ConversionException);
00401 
00405         void fromFITS(char *fits) throw(ConversionException);
00406 
00410         string toVOTable() const throw(ConversionException);
00411 
00415         void fromVOTable(string vo) throw(ConversionException);
00416 
00423         string toXML()  throw(ConversionException);
00424         
00430         void fromXML(string xmlDoc) throw(ConversionException);
00431         
00437         string toMIME();
00438         
00445          void setFromMIME(const string & mimeMsg);
00446         
00456           void toFile(string directory);
00457           
00466          void setFromFile(const string& directory);     
00467 
00468 private:
00469 
00478         AlmaCorrelatorModeTable (ASDM & container);
00479 
00480         ASDM & container;
00481         
00482         bool archiveAsBin; // If true archive binary else archive XML
00483         bool fileAsBin ; // If true file binary else file XML   
00484         
00485         Entity entity;
00486         
00487 
00488         // A map for the autoincrementation algorithm
00489         map<string,int>  noAutoIncIds;
00490         void autoIncrement(string key, AlmaCorrelatorModeRow* x);
00491 
00492 
00496         static string tableName;
00497 
00498 
00502         static vector<string> key;
00503 
00504 
00510         AlmaCorrelatorModeRow* checkAndAdd(AlmaCorrelatorModeRow* x) throw (DuplicateKey, UniquenessViolationException);
00511 
00512 
00513 
00514 // A data structure to store the pointers on the table's rows.
00515 
00516 // In all cases we maintain a private ArrayList of AlmaCorrelatorModeRow s.
00517    vector<AlmaCorrelatorModeRow * > privateRows;
00518    
00519 
00520                         
00521         vector<AlmaCorrelatorModeRow *> row;
00522 
00523 
00524         void error() throw(ConversionException);
00525 
00526 };
00527 
00528 } // End namespace asdm
00529 
00530 #endif /* AlmaCorrelatorModeTable_CLASS */

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