CalPrimaryBeamTable.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 CalPrimaryBeamTable_CLASS
00035 #define CalPrimaryBeamTable_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 #include <EntityRef.h>
00061
00062
00063
00064
00065
00066
00067
00068
00069 #include "CReceiverBand.h"
00070
00071
00072
00073
00074
00075
00076
00077 #include "CAntennaMake.h"
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087 #include "CPolarizationType.h"
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103 #include "CPrimaryBeamDescription.h"
00104
00105
00106
00107
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 CalPrimaryBeamRow;
00306 class CalPrimaryBeamTable : public Representable {
00307 friend class ASDM;
00308
00309 public:
00310
00311
00317 static const std::vector<std::string>& getKeyName();
00318
00319
00320 virtual ~CalPrimaryBeamTable();
00321
00327 ASDM &getContainer() const;
00328
00334 unsigned int size() const;
00335
00343 std::string getName() const;
00344
00352 static std::string name() ;
00353
00358 std::string getVersion() const ;
00359
00365 static const std::vector<std::string>& getAttributesNames();
00366
00372 static const std::vector<std::string>& defaultAttributesNamesInBin();
00373
00377 Entity getEntity() const;
00378
00383 void setEntity(Entity e);
00384
00392 std::string toXML() ;
00393
00394 #ifndef WITHOUT_ACS
00395
00401 asdmIDL::CalPrimaryBeamTableIDL *toIDL() ;
00402
00410 void toIDL(asdmIDL::CalPrimaryBeamTableIDL& x) const;
00411
00412 #endif
00413
00414 #ifndef WITHOUT_ACS
00415
00421 void fromIDL(asdmIDL::CalPrimaryBeamTableIDL x) ;
00422 #endif
00423
00424
00425
00426
00427
00432 CalPrimaryBeamRow *newRow();
00433
00434
00480 CalPrimaryBeamRow *newRow(string antennaName, ReceiverBandMod::ReceiverBand receiverBand, Tag calDataId, Tag calReductionId, ArrayTime startValidTime, ArrayTime endValidTime, AntennaMakeMod::AntennaMake antennaMake, int numSubband, vector<vector<Frequency > > frequencyRange, int numReceptor, vector<PolarizationTypeMod::PolarizationType > polarizationTypes, vector<double > mainBeamEfficiency, EntityRef beamDescriptionUID, float relativeAmplitudeRms, vector<Angle > direction, vector<Angle > minValidDirection, vector<Angle > maxValidDirection, PrimaryBeamDescriptionMod::PrimaryBeamDescription descriptionType, vector<int > imageChannelNumber, vector<Frequency > imageNominalFrequency);
00481
00482
00483
00496 CalPrimaryBeamRow *newRow(CalPrimaryBeamRow *row);
00497
00498
00499
00500
00501
00502
00515 CalPrimaryBeamRow* add(CalPrimaryBeamRow* x) ;
00516
00517
00518
00519
00520
00521
00522
00523
00524
00530 std::vector<CalPrimaryBeamRow *> get() ;
00531
00538 const std::vector<CalPrimaryBeamRow *>& get() const ;
00539
00540
00541
00542
00543
00559 CalPrimaryBeamRow* getRowByKey(string antennaName, ReceiverBandMod::ReceiverBand receiverBand, Tag calDataId, Tag calReductionId);
00560
00561
00562
00563
00564
00612 CalPrimaryBeamRow* lookup(string antennaName, ReceiverBandMod::ReceiverBand receiverBand, Tag calDataId, Tag calReductionId, ArrayTime startValidTime, ArrayTime endValidTime, AntennaMakeMod::AntennaMake antennaMake, int numSubband, vector<vector<Frequency > > frequencyRange, int numReceptor, vector<PolarizationTypeMod::PolarizationType > polarizationTypes, vector<double > mainBeamEfficiency, EntityRef beamDescriptionUID, float relativeAmplitudeRms, vector<Angle > direction, vector<Angle > minValidDirection, vector<Angle > maxValidDirection, PrimaryBeamDescriptionMod::PrimaryBeamDescription descriptionType, vector<int > imageChannelNumber, vector<Frequency > imageNominalFrequency);
00613
00614
00615 void setUnknownAttributeBinaryReader(const std::string& attributeName, BinaryAttributeReaderFunctor* barFctr);
00616 BinaryAttributeReaderFunctor* getUnknownAttributeBinaryReader(const std::string& attributeName) const;
00617
00618 private:
00619
00628 CalPrimaryBeamTable (ASDM & container);
00629
00630 ASDM & container;
00631
00632 bool archiveAsBin;
00633 bool fileAsBin ;
00634
00635 std::string version ;
00636
00637 Entity entity;
00638
00639
00640
00648 CalPrimaryBeamRow* checkAndAdd(CalPrimaryBeamRow* x, bool skipCheckUniqueness=false) ;
00649
00655 void append(CalPrimaryBeamRow* x) ;
00656
00662 void addWithoutCheckingUnique(CalPrimaryBeamRow* x) ;
00663
00664
00665
00666
00667
00668
00669
00670
00671 std::vector<CalPrimaryBeamRow * > privateRows;
00672
00673
00674
00675 std::vector<CalPrimaryBeamRow *> row;
00676
00677
00678 void error() ;
00679
00680
00687 void fromXML(std::string& xmlDoc) ;
00688
00689 std::map<std::string, BinaryAttributeReaderFunctor *> unknownAttributes2Functors;
00690
00695 void setFromMIMEFile(const std::string& directory);
00696
00697
00698
00699 void setFromXMLFile(const std::string& directory);
00700
00708 std::string toMIME(const asdm::ByteOrder* byteOrder=asdm::ByteOrder::Machine_Endianity);
00709
00710
00717 void setFromMIME(const std::string & mimeMsg);
00718
00722 std::string MIMEXMLPart(const asdm::ByteOrder* byteOrder=asdm::ByteOrder::Machine_Endianity);
00723
00733 void toFile(std::string directory);
00734
00738 bool loadInProgress;
00739 void checkPresenceInMemory() {
00740 if (!presentInMemory && !loadInProgress) {
00741 loadInProgress = true;
00742 setFromFile(getContainer().getDirectory());
00743 presentInMemory = true;
00744 loadInProgress = false;
00745 }
00746 }
00755 void setFromFile(const std::string& directory);
00756
00757 };
00758
00759 }
00760
00761 #endif