ConfigDescriptionTable.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 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 
00046 
00047 #include <Tag.h>
00048 using  asdm::Tag;
00049 
00050 
00051 
00052 
00053         
00054 
00055         
00056 
00057         
00058 
00059         
00060 #include "CCorrelationMode.h"
00061 using namespace CorrelationModeMod;
00062         
00063 
00064         
00065 
00066         
00067 
00068         
00069 #include "CAtmPhaseCorrection.h"
00070 using namespace AtmPhaseCorrectionMod;
00071         
00072 
00073         
00074 #include "CProcessorType.h"
00075 using namespace ProcessorTypeMod;
00076         
00077 
00078         
00079 
00080         
00081 #include "CSpectralResolutionType.h"
00082 using namespace SpectralResolutionTypeMod;
00083         
00084 
00085         
00086 
00087         
00088 #include "CSpectralResolutionType.h"
00089 using namespace SpectralResolutionTypeMod;
00090         
00091 
00092 
00093 
00094 #include <ConversionException.h>
00095 #include <DuplicateKey.h>
00096 #include <UniquenessViolationException.h>
00097 #include <NoSuchRow.h>
00098 #include <DuplicateKey.h>
00099 using asdm::DuplicateKey;
00100 using asdm::ConversionException;
00101 using asdm::NoSuchRow;
00102 using asdm::DuplicateKey;
00103 
00104 #ifndef WITHOUT_ACS
00105 #include <asdmIDLC.h>
00106 using asdmIDL::ConfigDescriptionTableIDL;
00107 #endif
00108 
00109 #include <Representable.h>
00110 
00111 namespace asdm {
00112 
00113 //class asdm::ASDM;
00114 //class asdm::ConfigDescriptionRow;
00115 
00116 class ASDM;
00117 class ConfigDescriptionRow;
00273 class ConfigDescriptionTable : public Representable {
00274         friend class ASDM;
00275 
00276 public:
00277 
00278 
00284         static vector<string> getKeyName();
00285 
00286 
00287         virtual ~ConfigDescriptionTable();
00288         
00294         ASDM &getContainer() const;
00295         
00301         unsigned int size() ;
00302         
00308         string getName() const;
00309         
00315          static const vector<string>& getAttributesNames();
00316 
00320         Entity getEntity() const;
00321 
00326         void setEntity(Entity e);
00327                 
00335         string toXML()  ;
00336 
00337 #ifndef WITHOUT_ACS
00338         // Conversion Methods
00344         ConfigDescriptionTableIDL *toIDL() ;
00345 #endif
00346 
00347 #ifndef WITHOUT_ACS
00348 
00354         void fromIDL(ConfigDescriptionTableIDL x) ;
00355 #endif
00356         
00357         //
00358         // ====> Row creation.
00359         //
00360         
00365         ConfigDescriptionRow *newRow();
00366         
00367         
00399         ConfigDescriptionRow *newRow(int numAntenna, int numDataDescription, int numFeed, CorrelationModeMod::CorrelationMode correlationMode, int numAtmPhaseCorrection, vector<AtmPhaseCorrectionMod::AtmPhaseCorrection > atmPhaseCorrection, ProcessorTypeMod::ProcessorType processorType, SpectralResolutionTypeMod::SpectralResolutionType spectralType, vector<Tag>  antennaId, vector<int>  feedId, vector<Tag>  switchCycleId, vector<Tag>  dataDescriptionId, Tag processorId);
00400         
00401 
00402 
00415          ConfigDescriptionRow *newRow(ConfigDescriptionRow *row); 
00416 
00417         //
00418         // ====> Append a row to its table.
00419         //
00420 
00421         
00422         
00423         
00433          ConfigDescriptionRow* add(ConfigDescriptionRow* x) ;
00434 
00435 
00436 
00437         //
00438         // ====> Methods returning rows.
00439         //
00440                 
00446         vector<ConfigDescriptionRow *> get() ;
00447         
00448 
00449 
00450  
00451         
00461         ConfigDescriptionRow* getRowByKey(Tag configDescriptionId);
00462 
00463                 
00464 
00465 
00466 
00500         ConfigDescriptionRow* lookup(int numAntenna, int numDataDescription, int numFeed, CorrelationModeMod::CorrelationMode correlationMode, int numAtmPhaseCorrection, vector<AtmPhaseCorrectionMod::AtmPhaseCorrection > atmPhaseCorrection, ProcessorTypeMod::ProcessorType processorType, SpectralResolutionTypeMod::SpectralResolutionType spectralType, vector<Tag>  antennaId, vector<int>  feedId, vector<Tag>  switchCycleId, vector<Tag>  dataDescriptionId, Tag processorId); 
00501 
00502 
00503 private:
00504 
00513         ConfigDescriptionTable (ASDM & container);
00514 
00515         ASDM & container;
00516         
00517         bool archiveAsBin; // If true archive binary else archive XML
00518         bool fileAsBin ; // If true file binary else file XML   
00519         
00520         Entity entity;
00521         
00522 
00523         // A map for the autoincrementation algorithm
00524         map<string,int>  noAutoIncIds;
00525         void autoIncrement(string key, ConfigDescriptionRow* x);
00526 
00527 
00531         static string tableName;
00532         
00536         static const vector<string> attributesNames;
00537         
00541         static vector<string> initAttributesNames();
00542 
00543 
00547         static vector<string> key;
00548 
00549 
00559         ConfigDescriptionRow* checkAndAdd(ConfigDescriptionRow* x) ;
00560 
00561 
00562 
00563 // A data structure to store the pointers on the table's rows.
00564 
00565 // In all cases we maintain a private vector of ConfigDescriptionRow s.
00566    vector<ConfigDescriptionRow * > privateRows;
00567    
00568 
00569                         
00570         vector<ConfigDescriptionRow *> row;
00571 
00572         
00573         void error() ; //throw(ConversionException);
00574 
00575         
00582         void fromXML(string xmlDoc) ;
00583                 
00588         void setFromMIMEFile(const string& directory);
00589         void setFromXMLFile(const string& directory);
00590         
00598         string toMIME(const asdm::ByteOrder* byteOrder=asdm::ByteOrder::Machine_Endianity);
00599   
00600         
00607          void setFromMIME(const string & mimeMsg);
00608         
00612         string MIMEXMLPart(const asdm::ByteOrder* byteOrder=asdm::ByteOrder::Machine_Endianity);
00613         
00623           void toFile(string directory);
00624           
00633          void setFromFile(const string& directory);     
00634  
00635 };
00636 
00637 } // End namespace asdm
00638 
00639 #endif /* ConfigDescriptionTable_CLASS */
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines