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 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
00137
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
00430 ExecBlockTableIDL *toIDL() ;
00431 #endif
00432
00433 #ifndef WITHOUT_ACS
00434
00440 void fromIDL(ExecBlockTableIDL x) ;
00441 #endif
00442
00443
00444
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
00527
00528
00529
00530
00531
00541 ExecBlockRow* add(ExecBlockRow* x) ;
00542
00543
00544
00545
00546
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;
00648 bool fileAsBin ;
00649
00650 Entity entity;
00651
00652
00653
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
00694
00695
00696 vector<ExecBlockRow * > privateRows;
00697
00698
00699
00700 vector<ExecBlockRow *> row;
00701
00702
00703 void error() ;
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 }
00768
00769 #endif