CalPointingModelTable.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 CalPointingModelTable_CLASS
00035 #define CalPointingModelTable_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
00057
00058
00059
00060
00061 #include "CReceiverBand.h"
00062
00063
00064
00065
00066
00067
00068
00069 #include "CAntennaMake.h"
00070
00071
00072
00073 #include "CPointingModelMode.h"
00074
00075
00076
00077 #include "CPolarizationType.h"
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104 #include <ConversionException.h>
00105 #include <DuplicateKey.h>
00106 #include <UniquenessViolationException.h>
00107 #include <NoSuchRow.h>
00108 #include <DuplicateKey.h>
00109
00110
00111 #ifndef WITHOUT_ACS
00112 #include <asdmIDLC.h>
00113 #endif
00114
00115 #include <Representable.h>
00116
00117 #include <pthread.h>
00118
00119 namespace asdm {
00120
00121
00122
00123
00124 class ASDM;
00125 class CalPointingModelRow;
00301 class CalPointingModelTable : public Representable {
00302 friend class ASDM;
00303
00304 public:
00305
00306
00312 static const std::vector<std::string>& getKeyName();
00313
00314
00315 virtual ~CalPointingModelTable();
00316
00322 ASDM &getContainer() const;
00323
00329 unsigned int size() const;
00330
00338 std::string getName() const;
00339
00347 static std::string name() ;
00348
00353 std::string getVersion() const ;
00354
00360 static const std::vector<std::string>& getAttributesNames();
00361
00367 static const std::vector<std::string>& defaultAttributesNamesInBin();
00368
00372 Entity getEntity() const;
00373
00378 void setEntity(Entity e);
00379
00387 std::string toXML() ;
00388
00389 #ifndef WITHOUT_ACS
00390
00396 asdmIDL::CalPointingModelTableIDL *toIDL() ;
00397
00405 void toIDL(asdmIDL::CalPointingModelTableIDL& x) const;
00406
00407 #endif
00408
00409 #ifndef WITHOUT_ACS
00410
00416 void fromIDL(asdmIDL::CalPointingModelTableIDL x) ;
00417 #endif
00418
00419
00420
00421
00422
00427 CalPointingModelRow *newRow();
00428
00429
00471 CalPointingModelRow *newRow(string antennaName, ReceiverBandMod::ReceiverBand receiverBand, Tag calDataId, Tag calReductionId, ArrayTime startValidTime, ArrayTime endValidTime, AntennaMakeMod::AntennaMake antennaMake, PointingModelModeMod::PointingModelMode pointingModelMode, PolarizationTypeMod::PolarizationType polarizationType, int numCoeff, vector<string > coeffName, vector<float > coeffVal, vector<float > coeffError, vector<bool > coeffFixed, Angle azimuthRMS, Angle elevationRms, Angle skyRMS, double reducedChiSquared);
00472
00473
00474
00487 CalPointingModelRow *newRow(CalPointingModelRow *row);
00488
00489
00490
00491
00492
00493
00506 CalPointingModelRow* add(CalPointingModelRow* x) ;
00507
00508
00509
00510
00511
00512
00513
00514
00515
00521 std::vector<CalPointingModelRow *> get() ;
00522
00529 const std::vector<CalPointingModelRow *>& get() const ;
00530
00531
00532
00533
00534
00550 CalPointingModelRow* getRowByKey(string antennaName, ReceiverBandMod::ReceiverBand receiverBand, Tag calDataId, Tag calReductionId);
00551
00552
00553
00554
00555
00599 CalPointingModelRow* lookup(string antennaName, ReceiverBandMod::ReceiverBand receiverBand, Tag calDataId, Tag calReductionId, ArrayTime startValidTime, ArrayTime endValidTime, AntennaMakeMod::AntennaMake antennaMake, PointingModelModeMod::PointingModelMode pointingModelMode, PolarizationTypeMod::PolarizationType polarizationType, int numCoeff, vector<string > coeffName, vector<float > coeffVal, vector<float > coeffError, vector<bool > coeffFixed, Angle azimuthRMS, Angle elevationRms, Angle skyRMS, double reducedChiSquared);
00600
00601
00602 void setUnknownAttributeBinaryReader(const std::string& attributeName, BinaryAttributeReaderFunctor* barFctr);
00603 BinaryAttributeReaderFunctor* getUnknownAttributeBinaryReader(const std::string& attributeName) const;
00604
00605 private:
00606
00615 CalPointingModelTable (ASDM & container);
00616
00617 ASDM & container;
00618
00619 bool archiveAsBin;
00620 bool fileAsBin ;
00621
00622 std::string version ;
00623
00624 Entity entity;
00625
00626
00627
00635 CalPointingModelRow* checkAndAdd(CalPointingModelRow* x, bool skipCheckUniqueness=false) ;
00636
00642 void append(CalPointingModelRow* x) ;
00643
00649 void addWithoutCheckingUnique(CalPointingModelRow* x) ;
00650
00651
00652
00653
00654
00655
00656
00657
00658 std::vector<CalPointingModelRow * > privateRows;
00659
00660
00661
00662 std::vector<CalPointingModelRow *> row;
00663
00664
00665 void error() ;
00666
00667
00674 void fromXML(std::string& xmlDoc) ;
00675
00676 std::map<std::string, BinaryAttributeReaderFunctor *> unknownAttributes2Functors;
00677
00682 void setFromMIMEFile(const std::string& directory);
00683
00684
00685
00686 void setFromXMLFile(const std::string& directory);
00687
00695 std::string toMIME(const asdm::ByteOrder* byteOrder=asdm::ByteOrder::Machine_Endianity);
00696
00697
00704 void setFromMIME(const std::string & mimeMsg);
00705
00709 std::string MIMEXMLPart(const asdm::ByteOrder* byteOrder=asdm::ByteOrder::Machine_Endianity);
00710
00720 void toFile(std::string directory);
00721
00725 bool loadInProgress;
00726 void checkPresenceInMemory() {
00727 if (!presentInMemory && !loadInProgress) {
00728 loadInProgress = true;
00729 setFromFile(getContainer().getDirectory());
00730 presentInMemory = true;
00731 loadInProgress = false;
00732 }
00733 }
00742 void setFromFile(const std::string& directory);
00743
00744 };
00745
00746 }
00747
00748 #endif