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 SourceTable_CLASS
00035 #define SourceTable_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
00046
00047 #include <ArrayTime.h>
00048 using asdm::ArrayTime;
00049
00050 #include <AngularRate.h>
00051 using asdm::AngularRate;
00052
00053 #include <Angle.h>
00054 using asdm::Angle;
00055
00056 #include <Speed.h>
00057 using asdm::Speed;
00058
00059 #include <Flux.h>
00060 using asdm::Flux;
00061
00062 #include <Tag.h>
00063 using asdm::Tag;
00064
00065 #include <Length.h>
00066 using asdm::Length;
00067
00068 #include <Frequency.h>
00069 using asdm::Frequency;
00070
00071 #include <ArrayTimeInterval.h>
00072 using asdm::ArrayTimeInterval;
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090 #include "CDirectionReferenceCode.h"
00091 using namespace DirectionReferenceCodeMod;
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109
00110
00111
00112
00113
00114
00115 #include "CSourceModel.h"
00116 using namespace SourceModelMod;
00117
00118
00119
00120 #include "CFrequencyReferenceCode.h"
00121 using namespace FrequencyReferenceCodeMod;
00122
00123
00124
00125
00126
00127
00128
00129
00130
00131
00132
00133 #include "CStokesParameter.h"
00134 using namespace StokesParameterMod;
00135
00136
00137
00138
00139
00140
00141
00142
00143
00144
00145
00146
00147
00148
00149
00150
00151 #include <ConversionException.h>
00152 #include <DuplicateKey.h>
00153 #include <UniquenessViolationException.h>
00154 #include <NoSuchRow.h>
00155 #include <DuplicateKey.h>
00156 using asdm::DuplicateKey;
00157 using asdm::ConversionException;
00158 using asdm::NoSuchRow;
00159 using asdm::DuplicateKey;
00160
00161 #ifndef WITHOUT_ACS
00162 #include <asdmIDLC.h>
00163 using asdmIDL::SourceTableIDL;
00164 #endif
00165
00166 #include <Representable.h>
00167
00168 namespace asdm {
00169
00170
00171
00172
00173 class ASDM;
00174 class SourceRow;
00425 class SourceTable : public Representable {
00426 friend class ASDM;
00427
00428 public:
00429
00430
00436 static vector<string> getKeyName();
00437
00438
00439 virtual ~SourceTable();
00440
00446 ASDM &getContainer() const;
00447
00453 unsigned int size() ;
00454
00460 string getName() const;
00461
00467 static const vector<string>& getAttributesNames();
00468
00472 Entity getEntity() const;
00473
00478 void setEntity(Entity e);
00479
00487 string toXML() ;
00488
00489 #ifndef WITHOUT_ACS
00490
00496 SourceTableIDL *toIDL() ;
00497 #endif
00498
00499 #ifndef WITHOUT_ACS
00500
00506 void fromIDL(SourceTableIDL x) ;
00507 #endif
00508
00509
00510
00511
00512
00517 SourceRow *newRow();
00518
00519
00537 SourceRow *newRow(ArrayTimeInterval timeInterval, Tag spectralWindowId, string code, vector<Angle > direction, vector<AngularRate > properMotion, string sourceName);
00538
00539
00540
00553 SourceRow *newRow(SourceRow *row);
00554
00555
00556
00557
00558
00559
00560
00561
00562
00572 SourceRow* add(SourceRow* x) ;
00573
00574
00575
00576
00577
00578
00579
00585 vector<SourceRow *> get() ;
00586
00587
00588
00589
00590
00604 SourceRow* getRowByKey(int sourceId, ArrayTimeInterval timeInterval, Tag spectralWindowId);
00605
00606
00607
00615 vector <SourceRow *> getRowBySourceId(int);
00616
00617
00618
00638 SourceRow* lookup(ArrayTimeInterval timeInterval, Tag spectralWindowId, string code, vector<Angle > direction, vector<AngularRate > properMotion, string sourceName);
00639
00640
00641 private:
00642
00651 SourceTable (ASDM & container);
00652
00653 ASDM & container;
00654
00655 bool archiveAsBin;
00656 bool fileAsBin ;
00657
00658 Entity entity;
00659
00660
00661
00665 static string tableName;
00666
00670 static const vector<string> attributesNames;
00671
00675 static vector<string> initAttributesNames();
00676
00677
00681 static vector<string> key;
00682
00683
00693 SourceRow* checkAndAdd(SourceRow* x) ;
00694
00695
00696
00697
00705 SourceRow * insertByStartTime(SourceRow* x, vector<SourceRow* >& row);
00706
00707
00708
00709
00710
00711
00712 vector<SourceRow * > privateRows;
00713
00714
00715
00716
00717
00718
00719
00720
00721 typedef vector <vector <SourceRow* > > ID_TIME_ROWS;
00722 map<string, ID_TIME_ROWS > context;
00723
00728 string Key(Tag spectralWindowId) ;
00729
00730
00731
00732
00738 void getByKeyNoAutoIncNoTime(vector <SourceRow*>& vin, vector <SourceRow*>& vout, Tag spectralWindowId);
00739
00740
00741
00742 void error() ;
00743
00744
00751 void fromXML(string xmlDoc) ;
00752
00757 void setFromMIMEFile(const string& directory);
00758 void setFromXMLFile(const string& directory);
00759
00767 string toMIME(const asdm::ByteOrder* byteOrder=asdm::ByteOrder::Machine_Endianity);
00768
00769
00776 void setFromMIME(const string & mimeMsg);
00777
00781 string MIMEXMLPart(const asdm::ByteOrder* byteOrder=asdm::ByteOrder::Machine_Endianity);
00782
00792 void toFile(string directory);
00793
00802 void setFromFile(const string& directory);
00803
00804 };
00805
00806 }
00807
00808 #endif