00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
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
00071
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
00125
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
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
00307
00308
00309
00326 FlagCmdRow* add(FlagCmdRow* x) ;
00327
00328
00329
00330
00331
00332
00333
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
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;
00502 bool fileAsBin ;
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
00542
00543
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 }
00565
00566 #endif