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 FeedTable_CLASS
00035 #define FeedTable_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 #include "CPolarizationType.h"
00095 using namespace PolarizationTypeMod;
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109 #ifndef WITHOUT_ACS
00110 #include <asdmIDLC.h>
00111 using asdmIDL::FeedTableIDL;
00112 #endif
00113
00114 using asdm::Angle;
00115 using asdm::AngularRate;
00116 using asdm::ArrayTime;
00117 using asdm::Complex;
00118 using asdm::Entity;
00119 using asdm::EntityId;
00120 using asdm::EntityRef;
00121 using asdm::Flux;
00122 using asdm::Frequency;
00123 using asdm::Humidity;
00124 using asdm::Interval;
00125 using asdm::Length;
00126 using asdm::PartId;
00127 using asdm::Pressure;
00128 using asdm::Speed;
00129 using asdm::Tag;
00130 using asdm::Temperature;
00131
00132 using asdm::DuplicateKey;
00133 using asdm::ConversionException;
00134 using asdm::NoSuchRow;
00135 using asdm::DuplicateKey;
00136
00137 #include <Representable.h>
00138
00139 namespace asdm {
00140
00141
00142
00143
00144 class ASDM;
00145 class FeedRow;
00284 class FeedTable : public Representable {
00285 friend class asdm::ASDM;
00286
00287 public:
00288
00289
00295 static vector<string> getKeyName();
00296
00297
00298 virtual ~FeedTable();
00299
00305 ASDM &getContainer() const;
00306
00312 unsigned int size() ;
00313
00319 string getName() const;
00320
00324 Entity getEntity() const;
00325
00330 void setEntity(Entity e);
00331
00332
00333
00334
00335
00340 FeedRow *newRow();
00341
00346 FeedRow* newRowEmpty();
00347
00348
00374 FeedRow *newRow(Tag antennaId, Tag spectralWindowId, ArrayTimeInterval timeInterval, vector<int> receiverId, int numReceptor, vector<vector<double > > beamOffset, vector<vector<Length > > focusReference, vector<PolarizationType > polarizationTypes, vector<vector<Complex > > polResponse, vector<Angle > receptorAngle);
00375
00380 FeedRow *newRowFull(Tag antennaId, Tag spectralWindowId, ArrayTimeInterval timeInterval, vector<int> receiverId, int numReceptor, vector<vector<double > > beamOffset, vector<vector<Length > > focusReference, vector<PolarizationType > polarizationTypes, vector<vector<Complex > > polResponse, vector<Angle > receptorAngle);
00381
00382
00395 FeedRow *newRow(FeedRow *row);
00396
00401 FeedRow *newRowCopy(FeedRow *row);
00402
00403
00404
00405
00406
00407
00408
00409
00410
00420 FeedRow* add(FeedRow* x) ;
00421
00422
00423
00424
00425
00426
00427
00433 vector<FeedRow *> get() ;
00434
00435
00443 vector <FeedRow*> *getByContext(Tag antennaId, Tag spectralWindowId);
00444
00445
00446
00447
00448
00464 FeedRow* FeedTable::getRowByKey(int feedId, Tag antennaId, Tag spectralWindowId, ArrayTimeInterval timeInterval);
00465
00466
00467
00475 vector <FeedRow *> FeedTable::getRowByFeedId(int);
00476
00477
00478
00506 FeedRow* lookup(Tag antennaId, Tag spectralWindowId, ArrayTimeInterval timeInterval, vector<int> receiverId, int numReceptor, vector<vector<double > > beamOffset, vector<vector<Length > > focusReference, vector<PolarizationType > polarizationTypes, vector<vector<Complex > > polResponse, vector<Angle > receptorAngle);
00507
00508
00509 #ifndef WITHOUT_ACS
00510
00516 FeedTableIDL *toIDL() ;
00517 #endif
00518
00519 #ifndef WITHOUT_ACS
00520
00526 void fromIDL(FeedTableIDL x) throw(DuplicateKey,ConversionException);
00527 #endif
00528
00532 char *toFITS() const throw(ConversionException);
00533
00537 void fromFITS(char *fits) throw(ConversionException);
00538
00542 string toVOTable() const throw(ConversionException);
00543
00547 void fromVOTable(string vo) throw(ConversionException);
00548
00555 string toXML() throw(ConversionException);
00556
00562 void fromXML(string xmlDoc) throw(ConversionException);
00563
00569 string toMIME();
00570
00577 void setFromMIME(const string & mimeMsg);
00578
00588 void toFile(string directory);
00589
00598 void setFromFile(const string& directory);
00599
00600 private:
00601
00610 FeedTable (ASDM & container);
00611
00612 ASDM & container;
00613
00614 bool archiveAsBin;
00615 bool fileAsBin ;
00616
00617 Entity entity;
00618
00619
00620
00624 static string tableName;
00625
00626
00630 static vector<string> key;
00631
00632
00638 FeedRow* checkAndAdd(FeedRow* x) throw (DuplicateKey, UniquenessViolationException);
00639
00640
00641
00642
00650 FeedRow * insertByStartTime(FeedRow* x, vector<FeedRow* >& row);
00651
00652
00653
00654
00655
00656
00657 vector<FeedRow * > privateRows;
00658
00659
00660
00661
00662
00663
00664
00665
00666 typedef vector <vector <FeedRow* > > ID_TIME_ROWS;
00667 map<string, ID_TIME_ROWS > context;
00668
00673 string Key(Tag antennaId, Tag spectralWindowId) ;
00674
00675
00676
00677
00683 void getByKeyNoAutoIncNoTime(vector <FeedRow*>& vin, vector <FeedRow*>& vout, Tag antennaId, Tag spectralWindowId);
00684
00685
00686
00687 void error() throw(ConversionException);
00688
00689 };
00690
00691 }
00692
00693 #endif