SubscanTable.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 SubscanTable.h
00032  */
00033  
00034 #ifndef SubscanTable_CLASS
00035 #define SubscanTable_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 <ArrayTime.h>
00048 using  asdm::ArrayTime;
00049 
00050 #include <Tag.h>
00051 using  asdm::Tag;
00052 
00053 
00054 
00055 
00056         
00057 
00058         
00059 
00060         
00061 
00062         
00063 
00064         
00065 
00066         
00067 #include "CSubscanIntent.h"
00068 using namespace SubscanIntentMod;
00069         
00070 
00071         
00072 #include "CSwitchingMode.h"
00073 using namespace SwitchingModeMod;
00074         
00075 
00076         
00077 
00078         
00079 
00080         
00081 
00082         
00083 #include "CCorrelatorCalibration.h"
00084 using namespace CorrelatorCalibrationMod;
00085         
00086 
00087 
00088 
00089 #include <ConversionException.h>
00090 #include <DuplicateKey.h>
00091 #include <UniquenessViolationException.h>
00092 #include <NoSuchRow.h>
00093 #include <DuplicateKey.h>
00094 using asdm::DuplicateKey;
00095 using asdm::ConversionException;
00096 using asdm::NoSuchRow;
00097 using asdm::DuplicateKey;
00098 
00099 #ifndef WITHOUT_ACS
00100 #include <asdmIDLC.h>
00101 using asdmIDL::SubscanTableIDL;
00102 #endif
00103 
00104 #include <Representable.h>
00105 
00106 namespace asdm {
00107 
00108 //class asdm::ASDM;
00109 //class asdm::SubscanRow;
00110 
00111 class ASDM;
00112 class SubscanRow;
00230 class SubscanTable : public Representable {
00231         friend class ASDM;
00232 
00233 public:
00234 
00235 
00241         static vector<string> getKeyName();
00242 
00243 
00244         virtual ~SubscanTable();
00245         
00251         ASDM &getContainer() const;
00252         
00258         unsigned int size() ;
00259         
00265         string getName() const;
00266         
00272          static const vector<string>& getAttributesNames();
00273 
00277         Entity getEntity() const;
00278 
00283         void setEntity(Entity e);
00284                 
00292         string toXML()  ;
00293 
00294 #ifndef WITHOUT_ACS
00295         // Conversion Methods
00301         SubscanTableIDL *toIDL() ;
00302 #endif
00303 
00304 #ifndef WITHOUT_ACS
00305 
00311         void fromIDL(SubscanTableIDL x) ;
00312 #endif
00313         
00314         //
00315         // ====> Row creation.
00316         //
00317         
00322         SubscanRow *newRow();
00323         
00324         
00350         SubscanRow *newRow(Tag execBlockId, int scanNumber, int subscanNumber, ArrayTime startTime, ArrayTime endTime, string fieldName, SubscanIntentMod::SubscanIntent subscanIntent, int numberIntegration, vector<int > numberSubintegration, bool flagRow);
00351         
00352 
00353 
00366          SubscanRow *newRow(SubscanRow *row); 
00367 
00368         //
00369         // ====> Append a row to its table.
00370         //
00371  
00372         
00385         SubscanRow* add(SubscanRow* x) ; 
00386 
00387  
00388 
00389 
00390 
00391         //
00392         // ====> Methods returning rows.
00393         //
00394                 
00400         vector<SubscanRow *> get() ;
00401         
00402 
00403 
00404  
00405         
00419         SubscanRow* getRowByKey(Tag execBlockId, int scanNumber, int subscanNumber);
00420 
00421                 
00422 
00423 
00424 
00452         SubscanRow* lookup(Tag execBlockId, int scanNumber, int subscanNumber, ArrayTime startTime, ArrayTime endTime, string fieldName, SubscanIntentMod::SubscanIntent subscanIntent, int numberIntegration, vector<int > numberSubintegration, bool flagRow); 
00453 
00454 
00455 private:
00456 
00465         SubscanTable (ASDM & container);
00466 
00467         ASDM & container;
00468         
00469         bool archiveAsBin; // If true archive binary else archive XML
00470         bool fileAsBin ; // If true file binary else file XML   
00471         
00472         Entity entity;
00473         
00474 
00475 
00479         static string tableName;
00480         
00484         static const vector<string> attributesNames;
00485         
00489         static vector<string> initAttributesNames();
00490 
00491 
00495         static vector<string> key;
00496 
00497 
00505         SubscanRow* checkAndAdd(SubscanRow* x) ;
00506 
00507 
00508 
00509 // A data structure to store the pointers on the table's rows.
00510 
00511 // In all cases we maintain a private vector of SubscanRow s.
00512    vector<SubscanRow * > privateRows;
00513    
00514 
00515                         
00516         vector<SubscanRow *> row;
00517 
00518         
00519         void error() ; //throw(ConversionException);
00520 
00521         
00528         void fromXML(string xmlDoc) ;
00529                 
00534         void setFromMIMEFile(const string& directory);
00535         void setFromXMLFile(const string& directory);
00536         
00544         string toMIME(const asdm::ByteOrder* byteOrder=asdm::ByteOrder::Machine_Endianity);
00545   
00546         
00553          void setFromMIME(const string & mimeMsg);
00554         
00558         string MIMEXMLPart(const asdm::ByteOrder* byteOrder=asdm::ByteOrder::Machine_Endianity);
00559         
00569           void toFile(string directory);
00570           
00579          void setFromFile(const string& directory);     
00580  
00581 };
00582 
00583 } // End namespace asdm
00584 
00585 #endif /* SubscanTable_CLASS */
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines