CalFocusTable.h
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 CalFocusTable_CLASS
00035 #define CalFocusTable_CLASS
00036
00037 #include <string>
00038 #include <vector>
00039 #include <map>
00040
00041
00042
00043
00044 #include <ArrayTime.h>
00045
00046
00047
00048 #include <Temperature.h>
00049
00050
00051
00052 #include <Angle.h>
00053
00054
00055
00056 #include <Tag.h>
00057
00058
00059
00060 #include <Length.h>
00061
00062
00063
00064 #include <Frequency.h>
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077 #include "CReceiverBand.h"
00078
00079
00080
00081
00082
00083 #include "CAtmPhaseCorrection.h"
00084
00085
00086
00087 #include "CFocusMethod.h"
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097 #include "CPolarizationType.h"
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109
00110
00111
00112
00113
00114
00115
00116
00117
00118
00119
00120
00121
00122
00123
00124
00125
00126
00127
00128
00129
00130
00131
00132
00133
00134
00135
00136
00137
00138
00139
00140
00141
00142
00143
00144
00145
00146
00147
00148 #include <ConversionException.h>
00149 #include <DuplicateKey.h>
00150 #include <UniquenessViolationException.h>
00151 #include <NoSuchRow.h>
00152 #include <DuplicateKey.h>
00153
00154
00155 #ifndef WITHOUT_ACS
00156 #include <asdmIDLC.h>
00157 #endif
00158
00159 #include <Representable.h>
00160
00161 #include <pthread.h>
00162
00163 namespace asdm {
00164
00165
00166
00167
00168 class ASDM;
00169 class CalFocusRow;
00457 class CalFocusTable : public Representable {
00458 friend class ASDM;
00459
00460 public:
00461
00462
00468 static const std::vector<std::string>& getKeyName();
00469
00470
00471 virtual ~CalFocusTable();
00472
00478 ASDM &getContainer() const;
00479
00485 unsigned int size() const;
00486
00494 std::string getName() const;
00495
00503 static std::string name() ;
00504
00509 std::string getVersion() const ;
00510
00516 static const std::vector<std::string>& getAttributesNames();
00517
00523 static const std::vector<std::string>& defaultAttributesNamesInBin();
00524
00528 Entity getEntity() const;
00529
00534 void setEntity(Entity e);
00535
00543 std::string toXML() ;
00544
00545 #ifndef WITHOUT_ACS
00546
00552 asdmIDL::CalFocusTableIDL *toIDL() ;
00553
00561 void toIDL(asdmIDL::CalFocusTableIDL& x) const;
00562
00563 #endif
00564
00565 #ifndef WITHOUT_ACS
00566
00572 void fromIDL(asdmIDL::CalFocusTableIDL x) ;
00573 #endif
00574
00575
00576
00577
00578
00583 CalFocusRow *newRow();
00584
00585
00629 CalFocusRow *newRow(string antennaName, ReceiverBandMod::ReceiverBand receiverBand, Tag calDataId, Tag calReductionId, ArrayTime startValidTime, ArrayTime endValidTime, Temperature ambientTemperature, AtmPhaseCorrectionMod::AtmPhaseCorrection atmPhaseCorrection, FocusMethodMod::FocusMethod focusMethod, vector<Frequency > frequencyRange, vector<Angle > pointingDirection, int numReceptor, vector<PolarizationTypeMod::PolarizationType > polarizationTypes, vector<bool > wereFixed, vector<vector<Length > > offset, vector<vector<Length > > offsetError, vector<vector<bool > > offsetWasTied, vector<vector<double > > reducedChiSquared, vector<vector<Length > > position);
00630
00631
00632
00645 CalFocusRow *newRow(CalFocusRow *row);
00646
00647
00648
00649
00650
00651
00664 CalFocusRow* add(CalFocusRow* x) ;
00665
00666
00667
00668
00669
00670
00671
00672
00673
00679 std::vector<CalFocusRow *> get() ;
00680
00687 const std::vector<CalFocusRow *>& get() const ;
00688
00689
00690
00691
00692
00708 CalFocusRow* getRowByKey(string antennaName, ReceiverBandMod::ReceiverBand receiverBand, Tag calDataId, Tag calReductionId);
00709
00710
00711
00712
00713
00759 CalFocusRow* lookup(string antennaName, ReceiverBandMod::ReceiverBand receiverBand, Tag calDataId, Tag calReductionId, ArrayTime startValidTime, ArrayTime endValidTime, Temperature ambientTemperature, AtmPhaseCorrectionMod::AtmPhaseCorrection atmPhaseCorrection, FocusMethodMod::FocusMethod focusMethod, vector<Frequency > frequencyRange, vector<Angle > pointingDirection, int numReceptor, vector<PolarizationTypeMod::PolarizationType > polarizationTypes, vector<bool > wereFixed, vector<vector<Length > > offset, vector<vector<Length > > offsetError, vector<vector<bool > > offsetWasTied, vector<vector<double > > reducedChiSquared, vector<vector<Length > > position);
00760
00761
00762 void setUnknownAttributeBinaryReader(const std::string& attributeName, BinaryAttributeReaderFunctor* barFctr);
00763 BinaryAttributeReaderFunctor* getUnknownAttributeBinaryReader(const std::string& attributeName) const;
00764
00765 private:
00766
00775 CalFocusTable (ASDM & container);
00776
00777 ASDM & container;
00778
00779 bool archiveAsBin;
00780 bool fileAsBin ;
00781
00782 std::string version ;
00783
00784 Entity entity;
00785
00786
00787
00788
00789
00790
00798 CalFocusRow* checkAndAdd(CalFocusRow* x, bool skipCheckUniqueness=false) ;
00799
00805 void append(CalFocusRow* x) ;
00806
00812 void addWithoutCheckingUnique(CalFocusRow* x) ;
00813
00814
00815
00816
00817
00818
00819
00820
00821 std::vector<CalFocusRow * > privateRows;
00822
00823
00824
00825 std::vector<CalFocusRow *> row;
00826
00827
00828 void error() ;
00829
00830
00837 void fromXML(std::string& xmlDoc) ;
00838
00839 std::map<std::string, BinaryAttributeReaderFunctor *> unknownAttributes2Functors;
00840
00845 void setFromMIMEFile(const std::string& directory);
00846
00847
00848
00849 void setFromXMLFile(const std::string& directory);
00850
00858 std::string toMIME(const asdm::ByteOrder* byteOrder=asdm::ByteOrder::Machine_Endianity);
00859
00860
00867 void setFromMIME(const std::string & mimeMsg);
00868
00872 std::string MIMEXMLPart(const asdm::ByteOrder* byteOrder=asdm::ByteOrder::Machine_Endianity);
00873
00883 void toFile(std::string directory);
00884
00888 bool loadInProgress;
00889 void checkPresenceInMemory() {
00890 if (!presentInMemory && !loadInProgress) {
00891 loadInProgress = true;
00892 setFromFile(getContainer().getDirectory());
00893 presentInMemory = true;
00894 loadInProgress = false;
00895 }
00896 }
00905 void setFromFile(const std::string& directory);
00906
00907 };
00908
00909 }
00910
00911 #endif