Go to the documentation of this file.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 DataDescriptionTable_CLASS
00035 #define DataDescriptionTable_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 #ifndef WITHOUT_ACS
00070 #include <asdmIDLC.h>
00071 using asdmIDL::DataDescriptionTableIDL;
00072 #endif
00073
00074 using asdm::Angle;
00075 using asdm::AngularRate;
00076 using asdm::ArrayTime;
00077 using asdm::Complex;
00078 using asdm::Entity;
00079 using asdm::EntityId;
00080 using asdm::EntityRef;
00081 using asdm::Flux;
00082 using asdm::Frequency;
00083 using asdm::Humidity;
00084 using asdm::Interval;
00085 using asdm::Length;
00086 using asdm::PartId;
00087 using asdm::Pressure;
00088 using asdm::Speed;
00089 using asdm::Tag;
00090 using asdm::Temperature;
00091
00092 using asdm::DuplicateKey;
00093 using asdm::ConversionException;
00094 using asdm::NoSuchRow;
00095 using asdm::DuplicateKey;
00096
00097 #include <Representable.h>
00098
00099 namespace asdm {
00100
00101
00102
00103
00104 class ASDM;
00105 class DataDescriptionRow;
00139 class DataDescriptionTable : public Representable {
00140 friend class asdm::ASDM;
00141
00142 public:
00143
00144
00150 static vector<string> getKeyName();
00151
00152
00153 virtual ~DataDescriptionTable();
00154
00160 ASDM &getContainer() const;
00161
00167 unsigned int size() ;
00168
00174 string getName() const;
00175
00181 static const vector<string>& getAttributesNames();
00182
00186 Entity getEntity() const;
00187
00192 void setEntity(Entity e);
00193
00194
00195
00196
00197
00202 DataDescriptionRow *newRow();
00203
00208 DataDescriptionRow *newRowEmpty();
00209
00219 DataDescriptionRow *newRow(Tag polOrHoloId, Tag spectralWindowId);
00220
00225 DataDescriptionRow *newRowFull(Tag polOrHoloId, Tag spectralWindowId);
00226
00239 DataDescriptionRow *newRow(DataDescriptionRow *row);
00240
00245 DataDescriptionRow *newRowCopy(DataDescriptionRow *row);
00246
00247
00248
00249
00250
00251
00252
00253
00263 DataDescriptionRow* add(DataDescriptionRow* x) ;
00264
00265
00266
00267
00268
00269
00270
00276 vector<DataDescriptionRow *> get() ;
00277
00278
00279
00280
00281
00291 DataDescriptionRow* getRowByKey(Tag dataDescriptionId);
00292
00293
00294
00295
00296
00308 DataDescriptionRow* lookup(Tag polarizationId, Tag spectralWindowId);
00309
00310
00311 #ifndef WITHOUT_ACS
00312
00318 DataDescriptionTableIDL *toIDL() ;
00319 #endif
00320
00321 #ifndef WITHOUT_ACS
00322
00328 void fromIDL(DataDescriptionTableIDL x) throw(DuplicateKey,ConversionException);
00329 #endif
00330
00334 char *toFITS() const throw(ConversionException);
00335
00339 void fromFITS(char *fits) throw(ConversionException);
00340
00344 string toVOTable() const throw(ConversionException);
00345
00349 void fromVOTable(string vo) throw(ConversionException);
00350
00357 string toXML() throw(ConversionException);
00358
00364 void fromXML(string xmlDoc) throw(ConversionException);
00365
00371 string toMIME();
00372
00379 void setFromMIME(const string & mimeMsg);
00380
00389 void toFile(string directory);
00390
00399 void setFromFile(const string& directory);
00400
00401 private:
00402
00411 DataDescriptionTable (ASDM & container);
00412
00413 ASDM & container;
00414
00415 bool archiveAsBin;
00416 bool fileAsBin ;
00417
00418 Entity entity;
00419
00420
00421
00422 map<string,int> noAutoIncIds;
00423 void autoIncrement(string key, DataDescriptionRow* x);
00424
00425
00429 static string tableName;
00430
00434 static const vector<string> attributesNames;
00435
00439 static vector<string> initAttributesNames();
00440
00444 static vector<string> key;
00445
00446
00452 DataDescriptionRow* checkAndAdd(DataDescriptionRow* x) throw (DuplicateKey, UniquenessViolationException);
00453
00454
00455
00456
00457
00458
00459 vector<DataDescriptionRow * > privateRows;
00460
00461
00462
00463 vector<DataDescriptionRow *> row;
00464
00465
00466
00472 void getByRequiredValue(vector <DataDescriptionRow*>& vin, vector <DataDescriptionRow*>& vout, Tag polarizationId, Tag spectralWindowId);
00473
00474
00475
00476
00477
00478
00479
00480 void error() throw(ConversionException);
00481
00482 };
00483
00484 }
00485
00486 #endif