ProcessorTable.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 ProcessorTable.h
00032  */
00033  
00034 #ifndef ProcessorTable_CLASS
00035 #define ProcessorTable_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 #include "CProcessorType.h"
00081 using namespace ProcessorTypeMod;
00082         
00083 
00084         
00085 
00086         
00087 
00088 
00089 #ifndef WITHOUT_ACS
00090 #include <asdmIDLC.h>
00091 using asdmIDL::ProcessorTableIDL;
00092 #endif
00093 
00094 using asdm::Angle;
00095 using asdm::AngularRate;
00096 using asdm::ArrayTime;
00097 using asdm::Complex;
00098 using asdm::Entity;
00099 using asdm::EntityId;
00100 using asdm::EntityRef;
00101 using asdm::Flux;
00102 using asdm::Frequency;
00103 using asdm::Humidity;
00104 using asdm::Interval;
00105 using asdm::Length;
00106 using asdm::PartId;
00107 using asdm::Pressure;
00108 using asdm::Speed;
00109 using asdm::Tag;
00110 using asdm::Temperature;
00111 
00112 using asdm::DuplicateKey;
00113 using asdm::ConversionException;
00114 using asdm::NoSuchRow;
00115 using asdm::DuplicateKey;
00116 
00117 #include <Representable.h>
00118 
00119 namespace asdm {
00120 
00121 //class asdm::ASDM;
00122 //class asdm::ProcessorRow;
00123 
00124 class ASDM;
00125 class ProcessorRow;
00180 class ProcessorTable : public Representable {
00181         friend class asdm::ASDM;
00182 
00183 public:
00184 
00185 
00191         static vector<string> getKeyName();
00192 
00193 
00194         virtual ~ProcessorTable();
00195         
00201         ASDM &getContainer() const;
00202         
00208         unsigned int size() ;
00209         
00215         string getName() const;
00216 
00220         Entity getEntity() const;
00221 
00226         void setEntity(Entity e);
00227 
00228         //
00229         // ====> Row creation.
00230         //
00231         
00236         ProcessorRow *newRow();
00237         
00242         ProcessorRow* newRowEmpty();
00243 
00244         
00256         ProcessorRow *newRow(Tag almaCorrelatorModeId, ProcessorType type, string subType);
00257         
00262         ProcessorRow *newRowFull(Tag almaCorrelatorModeId, ProcessorType type, string subType);
00263 
00264 
00277          ProcessorRow *newRow(ProcessorRow *row); 
00278 
00283          ProcessorRow *newRowCopy(ProcessorRow *row); 
00284 
00285         //
00286         // ====> Append a row to its table.
00287         //
00288 
00289         
00290         
00291         
00301          ProcessorRow* add(ProcessorRow* x) ;
00302 
00303 
00304 
00305         //
00306         // ====> Methods returning rows.
00307         //
00308                 
00314         vector<ProcessorRow *> get() ;
00315         
00316 
00317 
00318  
00319         
00329         ProcessorRow* ProcessorTable::getRowByKey(Tag processorId);
00330 
00331                 
00332 
00333 
00334 
00348         ProcessorRow* lookup(Tag almaCorrelatorModeId, ProcessorType type, string subType); 
00349 
00350 
00351 #ifndef WITHOUT_ACS
00352         // Conversion Methods
00358         ProcessorTableIDL *toIDL() ;
00359 #endif
00360 
00361 #ifndef WITHOUT_ACS
00362 
00368         void fromIDL(ProcessorTableIDL x) throw(DuplicateKey,ConversionException);
00369 #endif
00370 
00374         char *toFITS() const throw(ConversionException);
00375 
00379         void fromFITS(char *fits) throw(ConversionException);
00380 
00384         string toVOTable() const throw(ConversionException);
00385 
00389         void fromVOTable(string vo) throw(ConversionException);
00390 
00397         string toXML()  throw(ConversionException);
00398         
00404         void fromXML(string xmlDoc) throw(ConversionException);
00405         
00411         string toMIME();
00412         
00419          void setFromMIME(const string & mimeMsg);
00420         
00430           void toFile(string directory);
00431           
00440          void setFromFile(const string& directory);     
00441 
00442 private:
00443 
00452         ProcessorTable (ASDM & container);
00453 
00454         ASDM & container;
00455         
00456         bool archiveAsBin; // If true archive binary else archive XML
00457         bool fileAsBin ; // If true file binary else file XML   
00458         
00459         Entity entity;
00460         
00461 
00462         // A map for the autoincrementation algorithm
00463         map<string,int>  noAutoIncIds;
00464         void autoIncrement(string key, ProcessorRow* x);
00465 
00466 
00470         static string tableName;
00471 
00472 
00476         static vector<string> key;
00477 
00478 
00484         ProcessorRow* checkAndAdd(ProcessorRow* x) throw (DuplicateKey, UniquenessViolationException);
00485 
00486 
00487 
00488 // A data structure to store the pointers on the table's rows.
00489 
00490 // In all cases we maintain a private ArrayList of ProcessorRow s.
00491    vector<ProcessorRow * > privateRows;
00492    
00493 
00494                         
00495         vector<ProcessorRow *> row;
00496 
00497 
00498         void error() throw(ConversionException);
00499 
00500 };
00501 
00502 } // End namespace asdm
00503 
00504 #endif /* ProcessorTable_CLASS */

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