AlmaRadiometerTable.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 AlmaRadiometerTable.h
00032  */
00033  
00034 #ifndef AlmaRadiometerTable_CLASS
00035 #define AlmaRadiometerTable_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 #include <ConversionException.h>
00060 #include <DuplicateKey.h>
00061 #include <UniquenessViolationException.h>
00062 #include <NoSuchRow.h>
00063 #include <DuplicateKey.h>
00064 using asdm::DuplicateKey;
00065 using asdm::ConversionException;
00066 using asdm::NoSuchRow;
00067 using asdm::DuplicateKey;
00068 
00069 #ifndef WITHOUT_ACS
00070 #include <asdmIDLC.h>
00071 using asdmIDL::AlmaRadiometerTableIDL;
00072 #endif
00073 
00074 #include <Representable.h>
00075 
00076 namespace asdm {
00077 
00078 //class asdm::ASDM;
00079 //class asdm::AlmaRadiometerRow;
00080 
00081 class ASDM;
00082 class AlmaRadiometerRow;
00130 class AlmaRadiometerTable : public Representable {
00131         friend class ASDM;
00132 
00133 public:
00134 
00135 
00141         static vector<string> getKeyName();
00142 
00143 
00144         virtual ~AlmaRadiometerTable();
00145         
00151         ASDM &getContainer() const;
00152         
00158         unsigned int size() ;
00159         
00165         string getName() const;
00166         
00172          static const vector<string>& getAttributesNames();
00173 
00177         Entity getEntity() const;
00178 
00183         void setEntity(Entity e);
00184                 
00192         string toXML()  ;
00193 
00194 #ifndef WITHOUT_ACS
00195         // Conversion Methods
00201         AlmaRadiometerTableIDL *toIDL() ;
00202 #endif
00203 
00204 #ifndef WITHOUT_ACS
00205 
00211         void fromIDL(AlmaRadiometerTableIDL x) ;
00212 #endif
00213         
00214         //
00215         // ====> Row creation.
00216         //
00217         
00222         AlmaRadiometerRow *newRow();
00223         
00224 
00225 
00238          AlmaRadiometerRow *newRow(AlmaRadiometerRow *row); 
00239 
00240         //
00241         // ====> Append a row to its table.
00242         //
00243 
00244         
00245         
00246         
00256          AlmaRadiometerRow* add(AlmaRadiometerRow* x) ;
00257 
00258 
00259 
00260         //
00261         // ====> Methods returning rows.
00262         //
00263                 
00269         vector<AlmaRadiometerRow *> get() ;
00270         
00271 
00272 
00273  
00274         
00284         AlmaRadiometerRow* getRowByKey(Tag almaRadiometerId);
00285 
00286                 
00287 
00288 
00289 
00290 
00291 private:
00292 
00301         AlmaRadiometerTable (ASDM & container);
00302 
00303         ASDM & container;
00304         
00305         bool archiveAsBin; // If true archive binary else archive XML
00306         bool fileAsBin ; // If true file binary else file XML   
00307         
00308         Entity entity;
00309         
00310 
00311         // A map for the autoincrementation algorithm
00312         map<string,int>  noAutoIncIds;
00313         void autoIncrement(string key, AlmaRadiometerRow* x);
00314 
00315 
00319         static string tableName;
00320         
00324         static const vector<string> attributesNames;
00325         
00329         static vector<string> initAttributesNames();
00330 
00331 
00335         static vector<string> key;
00336 
00337 
00347         AlmaRadiometerRow* checkAndAdd(AlmaRadiometerRow* x) ;
00348 
00349 
00350 
00351 // A data structure to store the pointers on the table's rows.
00352 
00353 // In all cases we maintain a private vector of AlmaRadiometerRow s.
00354    vector<AlmaRadiometerRow * > privateRows;
00355    
00356 
00357                         
00358         vector<AlmaRadiometerRow *> row;
00359 
00360         
00361         void error() ; //throw(ConversionException);
00362 
00363         
00370         void fromXML(string xmlDoc) ;
00371                 
00376         void setFromMIMEFile(const string& directory);
00377         void setFromXMLFile(const string& directory);
00378         
00386         string toMIME(const asdm::ByteOrder* byteOrder=asdm::ByteOrder::Machine_Endianity);
00387   
00388         
00395          void setFromMIME(const string & mimeMsg);
00396         
00400         string MIMEXMLPart(const asdm::ByteOrder* byteOrder=asdm::ByteOrder::Machine_Endianity);
00401         
00411           void toFile(string directory);
00412           
00421          void setFromFile(const string& directory);     
00422  
00423 };
00424 
00425 } // End namespace asdm
00426 
00427 #endif /* AlmaRadiometerTable_CLASS */
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines