ScanTable.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 ScanTable.h
00032  */
00033  
00034 #ifndef ScanTable_CLASS
00035 #define ScanTable_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 "CScanIntent.h"
00068 using namespace ScanIntentMod;
00069         
00070 
00071         
00072 #include "CCalDataOrigin.h"
00073 using namespace CalDataOriginMod;
00074         
00075 
00076         
00077 
00078         
00079 #include "CCalibrationFunction.h"
00080 using namespace CalibrationFunctionMod;
00081         
00082 
00083         
00084 #include "CCalibrationSet.h"
00085 using namespace CalibrationSetMod;
00086         
00087 
00088         
00089 #include "CAntennaMotionPattern.h"
00090 using namespace AntennaMotionPatternMod;
00091         
00092 
00093         
00094 
00095         
00096 
00097         
00098 
00099         
00100 
00101 
00102 
00103 #include <ConversionException.h>
00104 #include <DuplicateKey.h>
00105 #include <UniquenessViolationException.h>
00106 #include <NoSuchRow.h>
00107 #include <DuplicateKey.h>
00108 using asdm::DuplicateKey;
00109 using asdm::ConversionException;
00110 using asdm::NoSuchRow;
00111 using asdm::DuplicateKey;
00112 
00113 #ifndef WITHOUT_ACS
00114 #include <asdmIDLC.h>
00115 using asdmIDL::ScanTableIDL;
00116 #endif
00117 
00118 #include <Representable.h>
00119 
00120 namespace asdm {
00121 
00122 //class asdm::ASDM;
00123 //class asdm::ScanRow;
00124 
00125 class ASDM;
00126 class ScanRow;
00270 class ScanTable : public Representable {
00271         friend class ASDM;
00272 
00273 public:
00274 
00275 
00281         static vector<string> getKeyName();
00282 
00283 
00284         virtual ~ScanTable();
00285         
00291         ASDM &getContainer() const;
00292         
00298         unsigned int size() ;
00299         
00305         string getName() const;
00306         
00312          static const vector<string>& getAttributesNames();
00313 
00317         Entity getEntity() const;
00318 
00323         void setEntity(Entity e);
00324                 
00332         string toXML()  ;
00333 
00334 #ifndef WITHOUT_ACS
00335         // Conversion Methods
00341         ScanTableIDL *toIDL() ;
00342 #endif
00343 
00344 #ifndef WITHOUT_ACS
00345 
00351         void fromIDL(ScanTableIDL x) ;
00352 #endif
00353         
00354         //
00355         // ====> Row creation.
00356         //
00357         
00362         ScanRow *newRow();
00363         
00364         
00390         ScanRow *newRow(Tag execBlockId, int scanNumber, ArrayTime startTime, ArrayTime endTime, int numIntent, int numSubScan, vector<ScanIntentMod::ScanIntent > scanIntent, vector<CalDataOriginMod::CalDataOrigin > calDataType, vector<bool > calibrationOnLine, bool flagRow);
00391         
00392 
00393 
00406          ScanRow *newRow(ScanRow *row); 
00407 
00408         //
00409         // ====> Append a row to its table.
00410         //
00411  
00412         
00425         ScanRow* add(ScanRow* x) ; 
00426 
00427  
00428 
00429 
00430 
00431         //
00432         // ====> Methods returning rows.
00433         //
00434                 
00440         vector<ScanRow *> get() ;
00441         
00442 
00443 
00444  
00445         
00457         ScanRow* getRowByKey(Tag execBlockId, int scanNumber);
00458 
00459                 
00460 
00461 
00462 
00490         ScanRow* lookup(Tag execBlockId, int scanNumber, ArrayTime startTime, ArrayTime endTime, int numIntent, int numSubScan, vector<ScanIntentMod::ScanIntent > scanIntent, vector<CalDataOriginMod::CalDataOrigin > calDataType, vector<bool > calibrationOnLine, bool flagRow); 
00491 
00492 
00493 private:
00494 
00503         ScanTable (ASDM & container);
00504 
00505         ASDM & container;
00506         
00507         bool archiveAsBin; // If true archive binary else archive XML
00508         bool fileAsBin ; // If true file binary else file XML   
00509         
00510         Entity entity;
00511         
00512 
00513 
00517         static string tableName;
00518         
00522         static const vector<string> attributesNames;
00523         
00527         static vector<string> initAttributesNames();
00528 
00529 
00533         static vector<string> key;
00534 
00535 
00543         ScanRow* checkAndAdd(ScanRow* x) ;
00544 
00545 
00546 
00547 // A data structure to store the pointers on the table's rows.
00548 
00549 // In all cases we maintain a private vector of ScanRow s.
00550    vector<ScanRow * > privateRows;
00551    
00552 
00553                         
00554         vector<ScanRow *> row;
00555 
00556         
00557         void error() ; //throw(ConversionException);
00558 
00559         
00566         void fromXML(string xmlDoc) ;
00567                 
00572         void setFromMIMEFile(const string& directory);
00573         void setFromXMLFile(const string& directory);
00574         
00582         string toMIME(const asdm::ByteOrder* byteOrder=asdm::ByteOrder::Machine_Endianity);
00583   
00584         
00591          void setFromMIME(const string & mimeMsg);
00592         
00596         string MIMEXMLPart(const asdm::ByteOrder* byteOrder=asdm::ByteOrder::Machine_Endianity);
00597         
00607           void toFile(string directory);
00608           
00617          void setFromFile(const string& directory);     
00618  
00619 };
00620 
00621 } // End namespace asdm
00622 
00623 #endif /* ScanTable_CLASS */
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines