SpectralWindowTable.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 SpectralWindowTable.h
00032  */
00033  
00034 #ifndef SpectralWindowTable_CLASS
00035 #define SpectralWindowTable_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 
00046 
00047 #include <Tag.h>
00048 using  asdm::Tag;
00049 
00050 #include <Frequency.h>
00051 using  asdm::Frequency;
00052 
00053 
00054 
00055 
00056         
00057 
00058         
00059 #include "CBasebandName.h"
00060 using namespace BasebandNameMod;
00061         
00062 
00063         
00064 #include "CNetSideband.h"
00065 using namespace NetSidebandMod;
00066         
00067 
00068         
00069 
00070         
00071 
00072         
00073 #include "CSidebandProcessingMode.h"
00074 using namespace SidebandProcessingModeMod;
00075         
00076 
00077         
00078 
00079         
00080 #include "CWindowFunction.h"
00081 using namespace WindowFunctionMod;
00082         
00083 
00084         
00085 
00086         
00087 
00088         
00089 
00090         
00091 
00092         
00093 
00094         
00095 #include "CCorrelationBit.h"
00096 using namespace CorrelationBitMod;
00097         
00098 
00099         
00100 
00101         
00102 
00103         
00104 
00105         
00106 
00107         
00108 
00109         
00110 #include "CFrequencyReferenceCode.h"
00111 using namespace FrequencyReferenceCodeMod;
00112         
00113 
00114         
00115 
00116         
00117 
00118         
00119 
00120         
00121 
00122         
00123 
00124         
00125 
00126         
00127 
00128         
00129 #include "CSpectralResolutionType.h"
00130 using namespace SpectralResolutionTypeMod;
00131         
00132 
00133 
00134 
00135 #include <ConversionException.h>
00136 #include <DuplicateKey.h>
00137 #include <UniquenessViolationException.h>
00138 #include <NoSuchRow.h>
00139 #include <DuplicateKey.h>
00140 using asdm::DuplicateKey;
00141 using asdm::ConversionException;
00142 using asdm::NoSuchRow;
00143 using asdm::DuplicateKey;
00144 
00145 #ifndef WITHOUT_ACS
00146 #include <asdmIDLC.h>
00147 using asdmIDL::SpectralWindowTableIDL;
00148 #endif
00149 
00150 #include <Representable.h>
00151 
00152 namespace asdm {
00153 
00154 //class asdm::ASDM;
00155 //class asdm::SpectralWindowRow;
00156 
00157 class ASDM;
00158 class SpectralWindowRow;
00405 class SpectralWindowTable : public Representable {
00406         friend class ASDM;
00407 
00408 public:
00409 
00410 
00416         static vector<string> getKeyName();
00417 
00418 
00419         virtual ~SpectralWindowTable();
00420         
00426         ASDM &getContainer() const;
00427         
00433         unsigned int size() ;
00434         
00440         string getName() const;
00441         
00447          static const vector<string>& getAttributesNames();
00448 
00452         Entity getEntity() const;
00453 
00458         void setEntity(Entity e);
00459                 
00467         string toXML()  ;
00468 
00469 #ifndef WITHOUT_ACS
00470         // Conversion Methods
00476         SpectralWindowTableIDL *toIDL() ;
00477 #endif
00478 
00479 #ifndef WITHOUT_ACS
00480 
00486         void fromIDL(SpectralWindowTableIDL x) ;
00487 #endif
00488         
00489         //
00490         // ====> Row creation.
00491         //
00492         
00497         SpectralWindowRow *newRow();
00498         
00499         
00519         SpectralWindowRow *newRow(BasebandNameMod::BasebandName basebandName, NetSidebandMod::NetSideband netSideband, int numChan, Frequency refFreq, SidebandProcessingModeMod::SidebandProcessingMode sidebandProcessingMode, Frequency totBandwidth, WindowFunctionMod::WindowFunction windowFunction);
00520         
00521 
00522 
00535          SpectralWindowRow *newRow(SpectralWindowRow *row); 
00536 
00537         //
00538         // ====> Append a row to its table.
00539         //
00540 
00541         
00542         
00543         
00553          SpectralWindowRow* add(SpectralWindowRow* x) ;
00554 
00555 
00556 
00557         //
00558         // ====> Methods returning rows.
00559         //
00560                 
00566         vector<SpectralWindowRow *> get() ;
00567         
00568 
00569 
00570  
00571         
00581         SpectralWindowRow* getRowByKey(Tag spectralWindowId);
00582 
00583                 
00584 
00585 
00586 
00608         SpectralWindowRow* lookup(BasebandNameMod::BasebandName basebandName, NetSidebandMod::NetSideband netSideband, int numChan, Frequency refFreq, SidebandProcessingModeMod::SidebandProcessingMode sidebandProcessingMode, Frequency totBandwidth, WindowFunctionMod::WindowFunction windowFunction); 
00609 
00610 
00611 private:
00612 
00621         SpectralWindowTable (ASDM & container);
00622 
00623         ASDM & container;
00624         
00625         bool archiveAsBin; // If true archive binary else archive XML
00626         bool fileAsBin ; // If true file binary else file XML   
00627         
00628         Entity entity;
00629         
00630 
00631         // A map for the autoincrementation algorithm
00632         map<string,int>  noAutoIncIds;
00633         void autoIncrement(string key, SpectralWindowRow* x);
00634 
00635 
00639         static string tableName;
00640         
00644         static const vector<string> attributesNames;
00645         
00649         static vector<string> initAttributesNames();
00650 
00651 
00655         static vector<string> key;
00656 
00657 
00667         SpectralWindowRow* checkAndAdd(SpectralWindowRow* x) ;
00668 
00669 
00670 
00671 // A data structure to store the pointers on the table's rows.
00672 
00673 // In all cases we maintain a private vector of SpectralWindowRow s.
00674    vector<SpectralWindowRow * > privateRows;
00675    
00676 
00677                         
00678         vector<SpectralWindowRow *> row;
00679 
00680         
00681         void error() ; //throw(ConversionException);
00682 
00683         
00690         void fromXML(string xmlDoc) ;
00691                 
00696         void setFromMIMEFile(const string& directory);
00697         void setFromXMLFile(const string& directory);
00698         
00706         string toMIME(const asdm::ByteOrder* byteOrder=asdm::ByteOrder::Machine_Endianity);
00707   
00708         
00715          void setFromMIME(const string & mimeMsg);
00716         
00720         string MIMEXMLPart(const asdm::ByteOrder* byteOrder=asdm::ByteOrder::Machine_Endianity);
00721         
00731           void toFile(string directory);
00732           
00741          void setFromFile(const string& directory);     
00742  
00743 };
00744 
00745 } // End namespace asdm
00746 
00747 #endif /* SpectralWindowTable_CLASS */
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines