FocusModelTable.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 FocusModelTable.h
00032  */
00033  
00034 #ifndef FocusModelTable_CLASS
00035 #define FocusModelTable_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 #include "CPolarizationType.h"
00057 using namespace PolarizationTypeMod;
00058         
00059 
00060         
00061 #include "CReceiverBand.h"
00062 using namespace ReceiverBandMod;
00063         
00064 
00065         
00066 
00067         
00068 
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::FocusModelTableIDL;
00090 #endif
00091 
00092 #include <Representable.h>
00093 
00094 namespace asdm {
00095 
00096 //class asdm::ASDM;
00097 //class asdm::FocusModelRow;
00098 
00099 class ASDM;
00100 class FocusModelRow;
00199 class FocusModelTable : public Representable {
00200         friend class ASDM;
00201 
00202 public:
00203 
00204 
00210         static vector<string> getKeyName();
00211 
00212 
00213         virtual ~FocusModelTable();
00214         
00220         ASDM &getContainer() const;
00221         
00227         unsigned int size() ;
00228         
00234         string getName() const;
00235         
00241          static const vector<string>& getAttributesNames();
00242 
00246         Entity getEntity() const;
00247 
00252         void setEntity(Entity e);
00253                 
00261         string toXML()  ;
00262 
00263 #ifndef WITHOUT_ACS
00264         // Conversion Methods
00270         FocusModelTableIDL *toIDL() ;
00271 #endif
00272 
00273 #ifndef WITHOUT_ACS
00274 
00280         void fromIDL(FocusModelTableIDL x) ;
00281 #endif
00282         
00283         //
00284         // ====> Row creation.
00285         //
00286         
00291         FocusModelRow *newRow();
00292         
00293         
00317         FocusModelRow *newRow(Tag antennaId, PolarizationTypeMod::PolarizationType polarizationType, ReceiverBandMod::ReceiverBand receiverBand, int numCoeff, vector<string > coeffName, vector<string > coeffFormula, vector<float > coeffVal, string assocNature, int assocFocusModelId);
00318         
00319 
00320 
00333          FocusModelRow *newRow(FocusModelRow *row); 
00334 
00335         //
00336         // ====> Append a row to its table.
00337         //
00338 
00339         
00340         
00341         
00351          FocusModelRow* add(FocusModelRow* x) ;
00352 
00353 
00354 
00355         //
00356         // ====> Methods returning rows.
00357         //
00358                 
00364         vector<FocusModelRow *> get() ;
00365         
00366 
00367 
00368  
00369         
00381         FocusModelRow* getRowByKey(Tag antennaId, int focusModelId);
00382 
00383                 
00384         
00392         vector <FocusModelRow *>  getRowByFocusModelId(int);
00393 
00394 
00395 
00421         FocusModelRow* lookup(Tag antennaId, PolarizationTypeMod::PolarizationType polarizationType, ReceiverBandMod::ReceiverBand receiverBand, int numCoeff, vector<string > coeffName, vector<string > coeffFormula, vector<float > coeffVal, string assocNature, int assocFocusModelId); 
00422 
00423 
00424 private:
00425 
00434         FocusModelTable (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, FocusModelRow* 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         FocusModelRow* checkAndAdd(FocusModelRow* 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 FocusModelRow s.
00487    vector<FocusModelRow * > privateRows;
00488    
00489 
00490                         
00491         vector<FocusModelRow *> 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 /* FocusModelTable_CLASS */
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines