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;
00151 class DataDescriptionTable : public Representable {
00152 friend class asdm::ASDM;
00153
00154 public:
00155
00156
00162 static vector<string> getKeyName();
00163
00164
00165 virtual ~DataDescriptionTable();
00166
00172 ASDM &getContainer() const;
00173
00179 unsigned int size() ;
00180
00186 string getName() const;
00187
00191 Entity getEntity() const;
00192
00197 void setEntity(Entity e);
00198
00199
00200
00201
00202
00207 DataDescriptionRow *newRow();
00208
00213 DataDescriptionRow *newRowEmpty();
00214
00224 DataDescriptionRow *newRow(Tag polOrHoloId, Tag spectralWindowId);
00225
00230 DataDescriptionRow *newRowFull(Tag polOrHoloId, Tag spectralWindowId);
00231
00244 DataDescriptionRow *newRow(DataDescriptionRow *row);
00245
00250 DataDescriptionRow *newRowCopy(DataDescriptionRow *row);
00251
00252
00253
00254
00255
00256
00257
00258
00268 DataDescriptionRow* add(DataDescriptionRow* x) ;
00269
00270
00271
00272
00273
00274
00275
00281 vector<DataDescriptionRow *> get() ;
00282
00283
00284
00285
00286
00296 DataDescriptionRow* DataDescriptionTable::getRowByKey(Tag dataDescriptionId);
00297
00298
00299
00300
00301
00313 DataDescriptionRow* lookup(Tag polarizationId, Tag spectralWindowId);
00314
00315
00316 #ifndef WITHOUT_ACS
00317
00323 DataDescriptionTableIDL *toIDL() ;
00324 #endif
00325
00326 #ifndef WITHOUT_ACS
00327
00333 void fromIDL(DataDescriptionTableIDL x) throw(DuplicateKey,ConversionException);
00334 #endif
00335
00339 char *toFITS() const throw(ConversionException);
00340
00344 void fromFITS(char *fits) throw(ConversionException);
00345
00349 string toVOTable() const throw(ConversionException);
00350
00354 void fromVOTable(string vo) throw(ConversionException);
00355
00362 string toXML() throw(ConversionException);
00363
00369 void fromXML(string xmlDoc) throw(ConversionException);
00370
00376 string toMIME();
00377
00384 void setFromMIME(const string & mimeMsg);
00385
00394 void toFile(string directory);
00395
00404 void setFromFile(const string& directory);
00405
00406 private:
00407
00416 DataDescriptionTable (ASDM & container);
00417
00418 ASDM & container;
00419
00420 bool archiveAsBin;
00421 bool fileAsBin ;
00422
00423 Entity entity;
00424
00425
00426
00427 map<string,int> noAutoIncIds;
00428 void autoIncrement(string key, DataDescriptionRow* x);
00429
00430
00434 static string tableName;
00435
00436
00440 static vector<string> key;
00441
00442
00448 DataDescriptionRow* checkAndAdd(DataDescriptionRow* x) throw (DuplicateKey, UniquenessViolationException);
00449
00450
00451
00452
00453
00454
00455 vector<DataDescriptionRow * > privateRows;
00456
00457
00458
00459 vector<DataDescriptionRow *> row;
00460
00461
00462
00468 void getByRequiredValue(vector <DataDescriptionRow*>& vin, vector <DataDescriptionRow*>& vout, Tag polarizationId, Tag spectralWindowId);
00469
00470
00471
00472
00473
00474
00475
00476 void error() throw(ConversionException);
00477
00478 };
00479
00480 }
00481
00482 #endif