ExecBlockTable.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 ExecBlockTable.h
00032  */
00033  
00034 #ifndef ExecBlockTable_CLASS
00035 #define ExecBlockTable_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 <Angle.h>
00051 using  asdm::Angle;
00052 
00053 #include <Tag.h>
00054 using  asdm::Tag;
00055 
00056 #include <Length.h>
00057 using  asdm::Length;
00058 
00059 #include <EntityRef.h>
00060 using  asdm::EntityRef;
00061 
00062 
00063 
00064 
00065         
00066 
00067         
00068 
00069         
00070 
00071         
00072 
00073         
00074 
00075         
00076 
00077         
00078 
00079         
00080 
00081         
00082 
00083         
00084 
00085         
00086 
00087         
00088 
00089         
00090 
00091         
00092 
00093         
00094 
00095         
00096 
00097         
00098 
00099         
00100 
00101         
00102 
00103         
00104 
00105         
00106 
00107         
00108 
00109         
00110 
00111         
00112 
00113         
00114 
00115 
00116 
00117 #include <ConversionException.h>
00118 #include <DuplicateKey.h>
00119 #include <UniquenessViolationException.h>
00120 #include <NoSuchRow.h>
00121 #include <DuplicateKey.h>
00122 using asdm::DuplicateKey;
00123 using asdm::ConversionException;
00124 using asdm::NoSuchRow;
00125 using asdm::DuplicateKey;
00126 
00127 #ifndef WITHOUT_ACS
00128 #include <asdmIDLC.h>
00129 using asdmIDL::ExecBlockTableIDL;
00130 #endif
00131 
00132 #include <Representable.h>
00133 
00134 namespace asdm {
00135 
00136 //class asdm::ASDM;
00137 //class asdm::ExecBlockRow;
00138 
00139 class ASDM;
00140 class ExecBlockRow;
00359 class ExecBlockTable : public Representable {
00360         friend class ASDM;
00361 
00362 public:
00363 
00364 
00370         static vector<string> getKeyName();
00371 
00372 
00373         virtual ~ExecBlockTable();
00374         
00380         ASDM &getContainer() const;
00381         
00387         unsigned int size() ;
00388         
00394         string getName() const;
00395         
00401          static const vector<string>& getAttributesNames();
00402 
00406         Entity getEntity() const;
00407 
00412         void setEntity(Entity e);
00413                 
00421         string toXML()  ;
00422 
00423 #ifndef WITHOUT_ACS
00424         // Conversion Methods
00430         ExecBlockTableIDL *toIDL() ;
00431 #endif
00432 
00433 #ifndef WITHOUT_ACS
00434 
00440         void fromIDL(ExecBlockTableIDL x) ;
00441 #endif
00442         
00443         //
00444         // ====> Row creation.
00445         //
00446         
00451         ExecBlockRow *newRow();
00452         
00453         
00507         ExecBlockRow *newRow(ArrayTime startTime, ArrayTime endTime, int execBlockNum, EntityRef execBlockUID, EntityRef projectId, string configName, string telescopeName, string observerName, string observingLog, string sessionReference, EntityRef sbSummary, string schedulerMode, Length baseRangeMin, Length baseRangeMax, Length baseRmsMinor, Length baseRmsMajor, Angle basePa, Length siteAltitude, Angle siteLongitude, Angle siteLatitude, bool aborted, int numAntenna, vector<Tag>  antennaId, Tag sBSummaryId);
00508         
00509 
00510 
00523          ExecBlockRow *newRow(ExecBlockRow *row); 
00524 
00525         //
00526         // ====> Append a row to its table.
00527         //
00528 
00529         
00530         
00531         
00541          ExecBlockRow* add(ExecBlockRow* x) ;
00542 
00543 
00544 
00545         //
00546         // ====> Methods returning rows.
00547         //
00548                 
00554         vector<ExecBlockRow *> get() ;
00555         
00556 
00557 
00558  
00559         
00569         ExecBlockRow* getRowByKey(Tag execBlockId);
00570 
00571                 
00572 
00573 
00574 
00630         ExecBlockRow* lookup(ArrayTime startTime, ArrayTime endTime, int execBlockNum, EntityRef execBlockUID, EntityRef projectId, string configName, string telescopeName, string observerName, string observingLog, string sessionReference, EntityRef sbSummary, string schedulerMode, Length baseRangeMin, Length baseRangeMax, Length baseRmsMinor, Length baseRmsMajor, Angle basePa, Length siteAltitude, Angle siteLongitude, Angle siteLatitude, bool aborted, int numAntenna, vector<Tag>  antennaId, Tag sBSummaryId); 
00631 
00632 
00633 private:
00634 
00643         ExecBlockTable (ASDM & container);
00644 
00645         ASDM & container;
00646         
00647         bool archiveAsBin; // If true archive binary else archive XML
00648         bool fileAsBin ; // If true file binary else file XML   
00649         
00650         Entity entity;
00651         
00652 
00653         // A map for the autoincrementation algorithm
00654         map<string,int>  noAutoIncIds;
00655         void autoIncrement(string key, ExecBlockRow* x);
00656 
00657 
00661         static string tableName;
00662         
00666         static const vector<string> attributesNames;
00667         
00671         static vector<string> initAttributesNames();
00672 
00673 
00677         static vector<string> key;
00678 
00679 
00689         ExecBlockRow* checkAndAdd(ExecBlockRow* x) ;
00690 
00691 
00692 
00693 // A data structure to store the pointers on the table's rows.
00694 
00695 // In all cases we maintain a private vector of ExecBlockRow s.
00696    vector<ExecBlockRow * > privateRows;
00697    
00698 
00699                         
00700         vector<ExecBlockRow *> row;
00701 
00702         
00703         void error() ; //throw(ConversionException);
00704 
00705         
00712         void fromXML(string xmlDoc) ;
00713                 
00718         void setFromMIMEFile(const string& directory);
00719         void setFromXMLFile(const string& directory);
00720         
00728         string toMIME(const asdm::ByteOrder* byteOrder=asdm::ByteOrder::Machine_Endianity);
00729   
00730         
00737          void setFromMIME(const string & mimeMsg);
00738         
00742         string MIMEXMLPart(const asdm::ByteOrder* byteOrder=asdm::ByteOrder::Machine_Endianity);
00743         
00753           void toFile(string directory);
00754           
00763          void setFromFile(const string& directory);     
00764  
00765 };
00766 
00767 } // End namespace asdm
00768 
00769 #endif /* ExecBlockTable_CLASS */
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines