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 ConfigDescriptionTable_CLASS
00035 #define ConfigDescriptionTable_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 #include "CCorrelationMode.h"
00087 using namespace CorrelationModeMod;
00088
00089
00090
00091
00092
00093
00094
00095 #include "CAtmPhaseCorrection.h"
00096 using namespace AtmPhaseCorrectionMod;
00097
00098
00099
00100 #include "CSpectralResolutionType.h"
00101 using namespace SpectralResolutionTypeMod;
00102
00103
00104
00105 #ifndef WITHOUT_ACS
00106 #include <asdmIDLC.h>
00107 using asdmIDL::ConfigDescriptionTableIDL;
00108 #endif
00109
00110 using asdm::Angle;
00111 using asdm::AngularRate;
00112 using asdm::ArrayTime;
00113 using asdm::Complex;
00114 using asdm::Entity;
00115 using asdm::EntityId;
00116 using asdm::EntityRef;
00117 using asdm::Flux;
00118 using asdm::Frequency;
00119 using asdm::Humidity;
00120 using asdm::Interval;
00121 using asdm::Length;
00122 using asdm::PartId;
00123 using asdm::Pressure;
00124 using asdm::Speed;
00125 using asdm::Tag;
00126 using asdm::Temperature;
00127
00128 using asdm::DuplicateKey;
00129 using asdm::ConversionException;
00130 using asdm::NoSuchRow;
00131 using asdm::DuplicateKey;
00132
00133 #include <Representable.h>
00134
00135 namespace asdm {
00136
00137
00138
00139
00140 class ASDM;
00141 class ConfigDescriptionRow;
00256 class ConfigDescriptionTable : public Representable {
00257 friend class asdm::ASDM;
00258
00259 public:
00260
00261
00267 static vector<string> getKeyName();
00268
00269
00270 virtual ~ConfigDescriptionTable();
00271
00277 ASDM &getContainer() const;
00278
00284 unsigned int size() ;
00285
00291 string getName() const;
00292
00296 Entity getEntity() const;
00297
00302 void setEntity(Entity e);
00303
00304
00305
00306
00307
00312 ConfigDescriptionRow *newRow();
00313
00318 ConfigDescriptionRow* newRowEmpty();
00319
00320
00346 ConfigDescriptionRow *newRow(vector<Tag> antennaId, vector<Tag> dataDescriptionId, vector<int> feedId, Tag processorId, vector<Tag> switchCycleId, int numAntenna, int numFeed, vector<int > numSubBand, CorrelationMode correlationMode, AtmPhaseCorrection atmPhaseCorrection);
00347
00352 ConfigDescriptionRow *newRowFull(vector<Tag> antennaId, vector<Tag> dataDescriptionId, vector<int> feedId, Tag processorId, vector<Tag> switchCycleId, int numAntenna, int numFeed, vector<int > numSubBand, CorrelationMode correlationMode, AtmPhaseCorrection atmPhaseCorrection);
00353
00354
00367 ConfigDescriptionRow *newRow(ConfigDescriptionRow *row);
00368
00373 ConfigDescriptionRow *newRowCopy(ConfigDescriptionRow *row);
00374
00375
00376
00377
00378
00379
00380
00381
00391 ConfigDescriptionRow* add(ConfigDescriptionRow* x) ;
00392
00393
00394
00395
00396
00397
00398
00404 vector<ConfigDescriptionRow *> get() ;
00405
00406
00407
00408
00409
00419 ConfigDescriptionRow* ConfigDescriptionTable::getRowByKey(Tag configDescriptionId);
00420
00421
00422
00423
00424
00452 ConfigDescriptionRow* lookup(vector<Tag> antennaId, vector<Tag> dataDescriptionId, vector<int> feedId, Tag processorId, vector<Tag> switchCycleId, int numAntenna, int numFeed, vector<int > numSubBand, CorrelationMode correlationMode, AtmPhaseCorrection atmPhaseCorrection);
00453
00454
00455 #ifndef WITHOUT_ACS
00456
00462 ConfigDescriptionTableIDL *toIDL() ;
00463 #endif
00464
00465 #ifndef WITHOUT_ACS
00466
00472 void fromIDL(ConfigDescriptionTableIDL x) throw(DuplicateKey,ConversionException);
00473 #endif
00474
00478 char *toFITS() const throw(ConversionException);
00479
00483 void fromFITS(char *fits) throw(ConversionException);
00484
00488 string toVOTable() const throw(ConversionException);
00489
00493 void fromVOTable(string vo) throw(ConversionException);
00494
00501 string toXML() throw(ConversionException);
00502
00508 void fromXML(string xmlDoc) throw(ConversionException);
00509
00515 string toMIME();
00516
00523 void setFromMIME(const string & mimeMsg);
00524
00534 void toFile(string directory);
00535
00544 void setFromFile(const string& directory);
00545
00546 private:
00547
00556 ConfigDescriptionTable (ASDM & container);
00557
00558 ASDM & container;
00559
00560 bool archiveAsBin;
00561 bool fileAsBin ;
00562
00563 Entity entity;
00564
00565
00566
00567 map<string,int> noAutoIncIds;
00568 void autoIncrement(string key, ConfigDescriptionRow* x);
00569
00570
00574 static string tableName;
00575
00576
00580 static vector<string> key;
00581
00582
00588 ConfigDescriptionRow* checkAndAdd(ConfigDescriptionRow* x) throw (DuplicateKey, UniquenessViolationException);
00589
00590
00591
00592
00593
00594
00595 vector<ConfigDescriptionRow * > privateRows;
00596
00597
00598
00599 vector<ConfigDescriptionRow *> row;
00600
00601
00602 void error() throw(ConversionException);
00603
00604 };
00605
00606 }
00607
00608 #endif