PointingModelTable.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 PointingModelTable.h
00032  */
00033  
00034 #ifndef PointingModelTable_CLASS
00035 #define PointingModelTable_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 
00061         
00062 #include "CPolarizationType.h"
00063 using namespace PolarizationTypeMod;
00064         
00065 
00066         
00067 #include "CReceiverBand.h"
00068 using namespace ReceiverBandMod;
00069         
00070 
00071         
00072 
00073         
00074 
00075 
00076 
00077 #include <ConversionException.h>
00078 #include <DuplicateKey.h>
00079 #include <UniquenessViolationException.h>
00080 #include <NoSuchRow.h>
00081 #include <DuplicateKey.h>
00082 using asdm::DuplicateKey;
00083 using asdm::ConversionException;
00084 using asdm::NoSuchRow;
00085 using asdm::DuplicateKey;
00086 
00087 #ifndef WITHOUT_ACS
00088 #include <asdmIDLC.h>
00089 using asdmIDL::PointingModelTableIDL;
00090 #endif
00091 
00092 #include <Representable.h>
00093 
00094 namespace asdm {
00095 
00096 //class asdm::ASDM;
00097 //class asdm::PointingModelRow;
00098 
00099 class ASDM;
00100 class PointingModelRow;
00202 class PointingModelTable : public Representable {
00203         friend class ASDM;
00204 
00205 public:
00206 
00207 
00213         static vector<string> getKeyName();
00214 
00215 
00216         virtual ~PointingModelTable();
00217         
00223         ASDM &getContainer() const;
00224         
00230         unsigned int size() ;
00231         
00237         string getName() const;
00238         
00244          static const vector<string>& getAttributesNames();
00245 
00249         Entity getEntity() const;
00250 
00255         void setEntity(Entity e);
00256                 
00264         string toXML()  ;
00265 
00266 #ifndef WITHOUT_ACS
00267         // Conversion Methods
00273         PointingModelTableIDL *toIDL() ;
00274 #endif
00275 
00276 #ifndef WITHOUT_ACS
00277 
00283         void fromIDL(PointingModelTableIDL x) ;
00284 #endif
00285         
00286         //
00287         // ====> Row creation.
00288         //
00289         
00294         PointingModelRow *newRow();
00295         
00296         
00318         PointingModelRow *newRow(Tag antennaId, int numCoeff, vector<string > coeffName, vector<float > coeffVal, PolarizationTypeMod::PolarizationType polarizationType, ReceiverBandMod::ReceiverBand receiverBand, string assocNature, int assocPointingModelId);
00319         
00320 
00321 
00334          PointingModelRow *newRow(PointingModelRow *row); 
00335 
00336         //
00337         // ====> Append a row to its table.
00338         //
00339 
00340         
00341         
00342         
00352          PointingModelRow* add(PointingModelRow* x) ;
00353 
00354 
00355 
00356         //
00357         // ====> Methods returning rows.
00358         //
00359                 
00365         vector<PointingModelRow *> get() ;
00366         
00367 
00368 
00369  
00370         
00382         PointingModelRow* getRowByKey(Tag antennaId, int pointingModelId);
00383 
00384                 
00385         
00393         vector <PointingModelRow *>  getRowByPointingModelId(int);
00394 
00395 
00396 
00420         PointingModelRow* lookup(Tag antennaId, int numCoeff, vector<string > coeffName, vector<float > coeffVal, PolarizationTypeMod::PolarizationType polarizationType, ReceiverBandMod::ReceiverBand receiverBand, string assocNature, int assocPointingModelId); 
00421 
00422 
00423 private:
00424 
00433         PointingModelTable (ASDM & container);
00434 
00435         ASDM & container;
00436         
00437         bool archiveAsBin; // If true archive binary else archive XML
00438         bool fileAsBin ; // If true file binary else file XML   
00439         
00440         Entity entity;
00441         
00442 
00443         // A map for the autoincrementation algorithm
00444         map<string,int>  noAutoIncIds;
00445         void autoIncrement(string key, PointingModelRow* x);
00446 
00447 
00451         static string tableName;
00452         
00456         static const vector<string> attributesNames;
00457         
00461         static vector<string> initAttributesNames();
00462 
00463 
00467         static vector<string> key;
00468 
00469 
00479         PointingModelRow* checkAndAdd(PointingModelRow* x) ;
00480 
00481 
00482 
00483 // A data structure to store the pointers on the table's rows.
00484 
00485 // In all cases we maintain a private vector of PointingModelRow s.
00486    vector<PointingModelRow * > privateRows;
00487    
00488 
00489                         
00490         vector<PointingModelRow *> row;
00491 
00492         
00493         void error() ; //throw(ConversionException);
00494 
00495         
00502         void fromXML(string xmlDoc) ;
00503                 
00508         void setFromMIMEFile(const string& directory);
00509         void setFromXMLFile(const string& directory);
00510         
00518         string toMIME(const asdm::ByteOrder* byteOrder=asdm::ByteOrder::Machine_Endianity);
00519   
00520         
00527          void setFromMIME(const string & mimeMsg);
00528         
00532         string MIMEXMLPart(const asdm::ByteOrder* byteOrder=asdm::ByteOrder::Machine_Endianity);
00533         
00543           void toFile(string directory);
00544           
00553          void setFromFile(const string& directory);     
00554  
00555 };
00556 
00557 } // End namespace asdm
00558 
00559 #endif /* PointingModelTable_CLASS */
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines