CorrelatorModeTable.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 CorrelatorModeTable.h
00032  */
00033  
00034 #ifndef CorrelatorModeTable_CLASS
00035 #define CorrelatorModeTable_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 #include "CBasebandName.h"
00059 using namespace BasebandNameMod;
00060         
00061 
00062         
00063 
00064         
00065 #include "CAccumMode.h"
00066 using namespace AccumModeMod;
00067         
00068 
00069         
00070 
00071         
00072 
00073         
00074 #include "CAxisName.h"
00075 using namespace AxisNameMod;
00076         
00077 
00078         
00079 #include "CFilterMode.h"
00080 using namespace FilterModeMod;
00081         
00082 
00083         
00084 #include "CCorrelatorName.h"
00085 using namespace CorrelatorNameMod;
00086         
00087 
00088 
00089 
00090 #include <ConversionException.h>
00091 #include <DuplicateKey.h>
00092 #include <UniquenessViolationException.h>
00093 #include <NoSuchRow.h>
00094 #include <DuplicateKey.h>
00095 using asdm::DuplicateKey;
00096 using asdm::ConversionException;
00097 using asdm::NoSuchRow;
00098 using asdm::DuplicateKey;
00099 
00100 #ifndef WITHOUT_ACS
00101 #include <asdmIDLC.h>
00102 using asdmIDL::CorrelatorModeTableIDL;
00103 #endif
00104 
00105 #include <Representable.h>
00106 
00107 namespace asdm {
00108 
00109 //class asdm::ASDM;
00110 //class asdm::CorrelatorModeRow;
00111 
00112 class ASDM;
00113 class CorrelatorModeRow;
00210 class CorrelatorModeTable : public Representable {
00211         friend class ASDM;
00212 
00213 public:
00214 
00215 
00221         static vector<string> getKeyName();
00222 
00223 
00224         virtual ~CorrelatorModeTable();
00225         
00231         ASDM &getContainer() const;
00232         
00238         unsigned int size() ;
00239         
00245         string getName() const;
00246         
00252          static const vector<string>& getAttributesNames();
00253 
00257         Entity getEntity() const;
00258 
00263         void setEntity(Entity e);
00264                 
00272         string toXML()  ;
00273 
00274 #ifndef WITHOUT_ACS
00275         // Conversion Methods
00281         CorrelatorModeTableIDL *toIDL() ;
00282 #endif
00283 
00284 #ifndef WITHOUT_ACS
00285 
00291         void fromIDL(CorrelatorModeTableIDL x) ;
00292 #endif
00293         
00294         //
00295         // ====> Row creation.
00296         //
00297         
00302         CorrelatorModeRow *newRow();
00303         
00304         
00328         CorrelatorModeRow *newRow(int numBaseband, vector<BasebandNameMod::BasebandName > basebandNames, vector<int > basebandConfig, AccumModeMod::AccumMode accumMode, int binMode, int numAxes, vector<AxisNameMod::AxisName > axesOrderArray, vector<FilterModeMod::FilterMode > filterMode, CorrelatorNameMod::CorrelatorName correlatorName);
00329         
00330 
00331 
00344          CorrelatorModeRow *newRow(CorrelatorModeRow *row); 
00345 
00346         //
00347         // ====> Append a row to its table.
00348         //
00349 
00350         
00351         
00352         
00362          CorrelatorModeRow* add(CorrelatorModeRow* x) ;
00363 
00364 
00365 
00366         //
00367         // ====> Methods returning rows.
00368         //
00369                 
00375         vector<CorrelatorModeRow *> get() ;
00376         
00377 
00378 
00379  
00380         
00390         CorrelatorModeRow* getRowByKey(Tag correlatorModeId);
00391 
00392                 
00393 
00394 
00395 
00421         CorrelatorModeRow* lookup(int numBaseband, vector<BasebandNameMod::BasebandName > basebandNames, vector<int > basebandConfig, AccumModeMod::AccumMode accumMode, int binMode, int numAxes, vector<AxisNameMod::AxisName > axesOrderArray, vector<FilterModeMod::FilterMode > filterMode, CorrelatorNameMod::CorrelatorName correlatorName); 
00422 
00423 
00424 private:
00425 
00434         CorrelatorModeTable (ASDM & container);
00435 
00436         ASDM & container;
00437         
00438         bool archiveAsBin; // If true archive binary else archive XML
00439         bool fileAsBin ; // If true file binary else file XML   
00440         
00441         Entity entity;
00442         
00443 
00444         // A map for the autoincrementation algorithm
00445         map<string,int>  noAutoIncIds;
00446         void autoIncrement(string key, CorrelatorModeRow* x);
00447 
00448 
00452         static string tableName;
00453         
00457         static const vector<string> attributesNames;
00458         
00462         static vector<string> initAttributesNames();
00463 
00464 
00468         static vector<string> key;
00469 
00470 
00480         CorrelatorModeRow* checkAndAdd(CorrelatorModeRow* x) ;
00481 
00482 
00483 
00484 // A data structure to store the pointers on the table's rows.
00485 
00486 // In all cases we maintain a private vector of CorrelatorModeRow s.
00487    vector<CorrelatorModeRow * > privateRows;
00488    
00489 
00490                         
00491         vector<CorrelatorModeRow *> row;
00492 
00493         
00494         void error() ; //throw(ConversionException);
00495 
00496         
00503         void fromXML(string xmlDoc) ;
00504                 
00509         void setFromMIMEFile(const string& directory);
00510         void setFromXMLFile(const string& directory);
00511         
00519         string toMIME(const asdm::ByteOrder* byteOrder=asdm::ByteOrder::Machine_Endianity);
00520   
00521         
00528          void setFromMIME(const string & mimeMsg);
00529         
00533         string MIMEXMLPart(const asdm::ByteOrder* byteOrder=asdm::ByteOrder::Machine_Endianity);
00534         
00544           void toFile(string directory);
00545           
00554          void setFromFile(const string& directory);     
00555  
00556 };
00557 
00558 } // End namespace asdm
00559 
00560 #endif /* CorrelatorModeTable_CLASS */
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines