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 FieldTable_CLASS
00035 #define FieldTable_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
00093
00094
00095
00096
00097
00098 #ifndef WITHOUT_ACS
00099 #include <asdmIDLC.h>
00100 using asdmIDL::FieldTableIDL;
00101 #endif
00102
00103 using asdm::Angle;
00104 using asdm::AngularRate;
00105 using asdm::ArrayTime;
00106 using asdm::Complex;
00107 using asdm::Entity;
00108 using asdm::EntityId;
00109 using asdm::EntityRef;
00110 using asdm::Flux;
00111 using asdm::Frequency;
00112 using asdm::Humidity;
00113 using asdm::Interval;
00114 using asdm::Length;
00115 using asdm::PartId;
00116 using asdm::Pressure;
00117 using asdm::Speed;
00118 using asdm::Tag;
00119 using asdm::Temperature;
00120
00121 using asdm::DuplicateKey;
00122 using asdm::ConversionException;
00123 using asdm::NoSuchRow;
00124 using asdm::DuplicateKey;
00125
00126 #include <Representable.h>
00127
00128 namespace asdm {
00129
00130
00131
00132
00133 class ASDM;
00134 class FieldRow;
00237 class FieldTable : public Representable {
00238 friend class asdm::ASDM;
00239
00240 public:
00241
00242
00248 static vector<string> getKeyName();
00249
00250
00251 virtual ~FieldTable();
00252
00258 ASDM &getContainer() const;
00259
00265 unsigned int size() ;
00266
00272 string getName() const;
00273
00277 Entity getEntity() const;
00278
00283 void setEntity(Entity e);
00284
00285
00286
00287
00288
00293 FieldRow *newRow();
00294
00299 FieldRow* newRowEmpty();
00300
00301
00323 FieldRow *newRow(string fieldName, string code, ArrayTime time, int numPoly, vector<vector<Angle > > delayDir, vector<vector<Angle > > phaseDir, vector<vector<Angle > > referenceDir, bool flagRow);
00324
00329 FieldRow *newRowFull(string fieldName, string code, ArrayTime time, int numPoly, vector<vector<Angle > > delayDir, vector<vector<Angle > > phaseDir, vector<vector<Angle > > referenceDir, bool flagRow);
00330
00331
00344 FieldRow *newRow(FieldRow *row);
00345
00350 FieldRow *newRowCopy(FieldRow *row);
00351
00352
00353
00354
00355
00356
00357
00358
00368 FieldRow* add(FieldRow* x) ;
00369
00370
00371
00372
00373
00374
00375
00381 vector<FieldRow *> get() ;
00382
00383
00384
00385
00386
00396 FieldRow* FieldTable::getRowByKey(Tag fieldId);
00397
00398
00399
00400
00401
00425 FieldRow* lookup(string fieldName, string code, ArrayTime time, int numPoly, vector<vector<Angle > > delayDir, vector<vector<Angle > > phaseDir, vector<vector<Angle > > referenceDir, bool flagRow);
00426
00427
00428 #ifndef WITHOUT_ACS
00429
00435 FieldTableIDL *toIDL() ;
00436 #endif
00437
00438 #ifndef WITHOUT_ACS
00439
00445 void fromIDL(FieldTableIDL x) throw(DuplicateKey,ConversionException);
00446 #endif
00447
00451 char *toFITS() const throw(ConversionException);
00452
00456 void fromFITS(char *fits) throw(ConversionException);
00457
00461 string toVOTable() const throw(ConversionException);
00462
00466 void fromVOTable(string vo) throw(ConversionException);
00467
00474 string toXML() throw(ConversionException);
00475
00481 void fromXML(string xmlDoc) throw(ConversionException);
00482
00488 string toMIME();
00489
00496 void setFromMIME(const string & mimeMsg);
00497
00507 void toFile(string directory);
00508
00517 void setFromFile(const string& directory);
00518
00519 private:
00520
00529 FieldTable (ASDM & container);
00530
00531 ASDM & container;
00532
00533 bool archiveAsBin;
00534 bool fileAsBin ;
00535
00536 Entity entity;
00537
00538
00539
00540 map<string,int> noAutoIncIds;
00541 void autoIncrement(string key, FieldRow* x);
00542
00543
00547 static string tableName;
00548
00549
00553 static vector<string> key;
00554
00555
00561 FieldRow* checkAndAdd(FieldRow* x) throw (DuplicateKey, UniquenessViolationException);
00562
00563
00564
00565
00566
00567
00568 vector<FieldRow * > privateRows;
00569
00570
00571
00572 vector<FieldRow *> row;
00573
00574
00575 void error() throw(ConversionException);
00576
00577 };
00578
00579 }
00580
00581 #endif