CalDelayTable.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 CalDelayTable_CLASS
00035 #define CalDelayTable_CLASS
00036
00037 #include <string>
00038 #include <vector>
00039 #include <map>
00040
00041
00042
00043
00044 #include <ArrayTime.h>
00045
00046
00047
00048 #include <Angle.h>
00049
00050
00051
00052 #include <Tag.h>
00053
00054
00055
00056 #include <Frequency.h>
00057
00058
00059
00060
00061
00062
00063
00064
00065 #include "CAtmPhaseCorrection.h"
00066
00067
00068
00069 #include "CBasebandName.h"
00070
00071
00072
00073 #include "CReceiverBand.h"
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089 #include "CPolarizationType.h"
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107 #include "CReceiverSideband.h"
00108
00109
00110
00111
00112 #include <ConversionException.h>
00113 #include <DuplicateKey.h>
00114 #include <UniquenessViolationException.h>
00115 #include <NoSuchRow.h>
00116 #include <DuplicateKey.h>
00117
00118
00119 #ifndef WITHOUT_ACS
00120 #include <asdmIDLC.h>
00121 #endif
00122
00123 #include <Representable.h>
00124
00125 #include <pthread.h>
00126
00127 namespace asdm {
00128
00129
00130
00131
00132 class ASDM;
00133 class CalDelayRow;
00320 class CalDelayTable : public Representable {
00321 friend class ASDM;
00322
00323 public:
00324
00325
00331 static const std::vector<std::string>& getKeyName();
00332
00333
00334 virtual ~CalDelayTable();
00335
00341 ASDM &getContainer() const;
00342
00348 unsigned int size() const;
00349
00357 std::string getName() const;
00358
00366 static std::string name() ;
00367
00372 std::string getVersion() const ;
00373
00379 static const std::vector<std::string>& getAttributesNames();
00380
00386 static const std::vector<std::string>& defaultAttributesNamesInBin();
00387
00391 Entity getEntity() const;
00392
00397 void setEntity(Entity e);
00398
00406 std::string toXML() ;
00407
00408 #ifndef WITHOUT_ACS
00409
00415 asdmIDL::CalDelayTableIDL *toIDL() ;
00416
00424 void toIDL(asdmIDL::CalDelayTableIDL& x) const;
00425
00426 #endif
00427
00428 #ifndef WITHOUT_ACS
00429
00435 void fromIDL(asdmIDL::CalDelayTableIDL x) ;
00436 #endif
00437
00438
00439
00440
00441
00446 CalDelayRow *newRow();
00447
00448
00484 CalDelayRow *newRow(string antennaName, AtmPhaseCorrectionMod::AtmPhaseCorrection atmPhaseCorrection, BasebandNameMod::BasebandName basebandName, ReceiverBandMod::ReceiverBand receiverBand, Tag calDataId, Tag calReductionId, ArrayTime startValidTime, ArrayTime endValidTime, string refAntennaName, int numReceptor, vector<double > delayError, vector<double > delayOffset, vector<PolarizationTypeMod::PolarizationType > polarizationTypes, vector<double > reducedChiSquared, vector<double > appliedDelay);
00485
00486
00487
00500 CalDelayRow *newRow(CalDelayRow *row);
00501
00502
00503
00504
00505
00506
00519 CalDelayRow* add(CalDelayRow* x) ;
00520
00521
00522
00523
00524
00525
00526
00527
00528
00534 std::vector<CalDelayRow *> get() ;
00535
00542 const std::vector<CalDelayRow *>& get() const ;
00543
00544
00545
00546
00547
00567 CalDelayRow* getRowByKey(string antennaName, AtmPhaseCorrectionMod::AtmPhaseCorrection atmPhaseCorrection, BasebandNameMod::BasebandName basebandName, ReceiverBandMod::ReceiverBand receiverBand, Tag calDataId, Tag calReductionId);
00568
00569
00570
00571
00572
00610 CalDelayRow* lookup(string antennaName, AtmPhaseCorrectionMod::AtmPhaseCorrection atmPhaseCorrection, BasebandNameMod::BasebandName basebandName, ReceiverBandMod::ReceiverBand receiverBand, Tag calDataId, Tag calReductionId, ArrayTime startValidTime, ArrayTime endValidTime, string refAntennaName, int numReceptor, vector<double > delayError, vector<double > delayOffset, vector<PolarizationTypeMod::PolarizationType > polarizationTypes, vector<double > reducedChiSquared, vector<double > appliedDelay);
00611
00612
00613 void setUnknownAttributeBinaryReader(const std::string& attributeName, BinaryAttributeReaderFunctor* barFctr);
00614 BinaryAttributeReaderFunctor* getUnknownAttributeBinaryReader(const std::string& attributeName) const;
00615
00616 private:
00617
00626 CalDelayTable (ASDM & container);
00627
00628 ASDM & container;
00629
00630 bool archiveAsBin;
00631 bool fileAsBin ;
00632
00633 std::string version ;
00634
00635 Entity entity;
00636
00637
00638
00646 CalDelayRow* checkAndAdd(CalDelayRow* x, bool skipCheckUniqueness=false) ;
00647
00653 void append(CalDelayRow* x) ;
00654
00660 void addWithoutCheckingUnique(CalDelayRow* x) ;
00661
00662
00663
00664
00665
00666
00667
00668
00669 std::vector<CalDelayRow * > privateRows;
00670
00671
00672
00673 std::vector<CalDelayRow *> row;
00674
00675
00676 void error() ;
00677
00678
00685 void fromXML(std::string& xmlDoc) ;
00686
00687 std::map<std::string, BinaryAttributeReaderFunctor *> unknownAttributes2Functors;
00688
00693 void setFromMIMEFile(const std::string& directory);
00694
00695
00696
00697 void setFromXMLFile(const std::string& directory);
00698
00706 std::string toMIME(const asdm::ByteOrder* byteOrder=asdm::ByteOrder::Machine_Endianity);
00707
00708
00715 void setFromMIME(const std::string & mimeMsg);
00716
00720 std::string MIMEXMLPart(const asdm::ByteOrder* byteOrder=asdm::ByteOrder::Machine_Endianity);
00721
00731 void toFile(std::string directory);
00732
00736 bool loadInProgress;
00737 void checkPresenceInMemory() {
00738 if (!presentInMemory && !loadInProgress) {
00739 loadInProgress = true;
00740 setFromFile(getContainer().getDirectory());
00741 presentInMemory = true;
00742 loadInProgress = false;
00743 }
00744 }
00753 void setFromFile(const std::string& directory);
00754
00755 };
00756
00757 }
00758
00759 #endif