FlagCmdTable.h

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 FlagCmdTable.h
00032  */
00033  
00034 #ifndef FlagCmdTable_CLASS
00035 #define FlagCmdTable_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 #include <Angle.h>
00046 #include <AngularRate.h>
00047 #include <ArrayTime.h>
00048 #include <ArrayTimeInterval.h>
00049 #include <Complex.h>
00050 #include <Entity.h>
00051 #include <EntityId.h>
00052 #include <EntityRef.h>
00053 #include <Flux.h>
00054 #include <Frequency.h>
00055 #include <Humidity.h>
00056 #include <Interval.h>
00057 #include <Length.h>
00058 #include <PartId.h>
00059 #include <Pressure.h>
00060 #include <Speed.h>
00061 #include <Tag.h>
00062 #include <Temperature.h>
00063 #include <ConversionException.h>
00064 #include <DuplicateKey.h>
00065 #include <UniquenessViolationException.h>
00066 #include <NoSuchRow.h>
00067 #include <DuplicateKey.h>
00068 
00069 /*
00070 #include <Enumerations.h>
00071 using namespace enumerations;
00072 */
00073 
00074 
00075 
00076 
00077         
00078 
00079         
00080 
00081         
00082 
00083         
00084 
00085         
00086 
00087         
00088 
00089         
00090 
00091 
00092 #ifndef WITHOUT_ACS
00093 #include <asdmIDLC.h>
00094 using asdmIDL::FlagCmdTableIDL;
00095 #endif
00096 
00097 using asdm::Angle;
00098 using asdm::AngularRate;
00099 using asdm::ArrayTime;
00100 using asdm::Complex;
00101 using asdm::Entity;
00102 using asdm::EntityId;
00103 using asdm::EntityRef;
00104 using asdm::Flux;
00105 using asdm::Frequency;
00106 using asdm::Humidity;
00107 using asdm::Interval;
00108 using asdm::Length;
00109 using asdm::PartId;
00110 using asdm::Pressure;
00111 using asdm::Speed;
00112 using asdm::Tag;
00113 using asdm::Temperature;
00114 
00115 using asdm::DuplicateKey;
00116 using asdm::ConversionException;
00117 using asdm::NoSuchRow;
00118 using asdm::DuplicateKey;
00119 
00120 #include <Representable.h>
00121 
00122 namespace asdm {
00123 
00124 //class asdm::ASDM;
00125 //class asdm::FlagCmdRow;
00126 
00127 class ASDM;
00128 class FlagCmdRow;
00192 class FlagCmdTable : public Representable {
00193         friend class asdm::ASDM;
00194 
00195 public:
00196 
00197 
00203         static vector<string> getKeyName();
00204 
00205 
00206         virtual ~FlagCmdTable();
00207         
00213         ASDM &getContainer() const;
00214         
00220         unsigned int size() ;
00221         
00227         string getName() const;
00228 
00232         Entity getEntity() const;
00233 
00238         void setEntity(Entity e);
00239 
00240         //
00241         // ====> Row creation.
00242         //
00243         
00248         FlagCmdRow *newRow();
00249         
00254         FlagCmdRow* newRowEmpty();
00255 
00256         
00276         FlagCmdRow *newRow(ArrayTimeInterval timeInterval, string type, string reason, int level, int severity, bool applied, string command);
00277         
00282         FlagCmdRow *newRowFull(ArrayTimeInterval timeInterval, string type, string reason, int level, int severity, bool applied, string command);
00283 
00284 
00297          FlagCmdRow *newRow(FlagCmdRow *row); 
00298 
00303          FlagCmdRow *newRowCopy(FlagCmdRow *row); 
00304 
00305         //
00306         // ====> Append a row to its table.
00307         //
00308  
00309         
00326         FlagCmdRow* add(FlagCmdRow* x) ; 
00327 
00328  
00329 
00330 
00331 
00332         //
00333         // ====> Methods returning rows.
00334         //
00335                 
00341         vector<FlagCmdRow *> get() ;
00342         
00343 
00351          vector <FlagCmdRow*> *getByContext();
00352          
00353 
00354 
00355  
00356         
00366         FlagCmdRow* FlagCmdTable::getRowByKey(ArrayTimeInterval timeInterval);
00367 
00368                 
00369 
00370 
00371 
00393         FlagCmdRow* lookup(ArrayTimeInterval timeInterval, string type, string reason, int level, int severity, bool applied, string command); 
00394 
00395 
00396 #ifndef WITHOUT_ACS
00397         // Conversion Methods
00403         FlagCmdTableIDL *toIDL() ;
00404 #endif
00405 
00406 #ifndef WITHOUT_ACS
00407 
00413         void fromIDL(FlagCmdTableIDL x) throw(DuplicateKey,ConversionException);
00414 #endif
00415 
00419         char *toFITS() const throw(ConversionException);
00420 
00424         void fromFITS(char *fits) throw(ConversionException);
00425 
00429         string toVOTable() const throw(ConversionException);
00430 
00434         void fromVOTable(string vo) throw(ConversionException);
00435 
00442         string toXML()  throw(ConversionException);
00443         
00449         void fromXML(string xmlDoc) throw(ConversionException);
00450         
00456         string toMIME();
00457         
00464          void setFromMIME(const string & mimeMsg);
00465         
00475           void toFile(string directory);
00476           
00485          void setFromFile(const string& directory);     
00486 
00487 private:
00488 
00497         FlagCmdTable (ASDM & container);
00498 
00499         ASDM & container;
00500         
00501         bool archiveAsBin; // If true archive binary else archive XML
00502         bool fileAsBin ; // If true file binary else file XML   
00503         
00504         Entity entity;
00505         
00506 
00507 
00511         static string tableName;
00512 
00513 
00517         static vector<string> key;
00518 
00519 
00525         FlagCmdRow* checkAndAdd(FlagCmdRow* x) throw (DuplicateKey);
00526 
00527 
00528         
00529         
00537          FlagCmdRow * insertByStartTime(FlagCmdRow* x, vector<FlagCmdRow* >& row);
00538           
00539 
00540 
00541 // A data structure to store the pointers on the table's rows.
00542 
00543 // In all cases we maintain a private ArrayList of FlagCmdRow s.
00544    vector<FlagCmdRow * > privateRows;
00545    
00546 
00547         
00548 
00549         
00550         
00551                 
00552                 
00553         vector <FlagCmdRow *> row;
00554                  
00555                 
00556         
00557         
00558 
00559 
00560         void error() throw(ConversionException);
00561 
00562 };
00563 
00564 } // End namespace asdm
00565 
00566 #endif /* FlagCmdTable_CLASS */

Generated on Thu Nov 29 16:46:46 2007 for ASDM C++ Implementation by  doxygen 1.5.1