CalAmpliTable.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 CalAmpliTable_CLASS
00035 #define CalAmpliTable_CLASS
00036
00037 #include <string>
00038 #include <vector>
00039 #include <map>
00040
00041
00042
00043
00044 #include <ArrayTime.h>
00045
00046
00047
00048 #include <Tag.h>
00049
00050
00051
00052 #include <Frequency.h>
00053
00054
00055
00056
00057
00058
00059
00060
00061 #include "CAtmPhaseCorrection.h"
00062
00063
00064
00065 #include "CReceiverBand.h"
00066
00067
00068
00069 #include "CBasebandName.h"
00070
00071
00072
00073
00074
00075 #include "CPolarizationType.h"
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092 #include <ConversionException.h>
00093 #include <DuplicateKey.h>
00094 #include <UniquenessViolationException.h>
00095 #include <NoSuchRow.h>
00096 #include <DuplicateKey.h>
00097
00098
00099 #ifndef WITHOUT_ACS
00100 #include <asdmIDLC.h>
00101 #endif
00102
00103 #include <Representable.h>
00104
00105 #include <pthread.h>
00106
00107 namespace asdm {
00108
00109
00110
00111
00112 class ASDM;
00113 class CalAmpliRow;
00251 class CalAmpliTable : public Representable {
00252 friend class ASDM;
00253
00254 public:
00255
00256
00262 static const std::vector<std::string>& getKeyName();
00263
00264
00265 virtual ~CalAmpliTable();
00266
00272 ASDM &getContainer() const;
00273
00279 unsigned int size() const;
00280
00288 std::string getName() const;
00289
00297 static std::string name() ;
00298
00303 std::string getVersion() const ;
00304
00310 static const std::vector<std::string>& getAttributesNames();
00311
00317 static const std::vector<std::string>& defaultAttributesNamesInBin();
00318
00322 Entity getEntity() const;
00323
00328 void setEntity(Entity e);
00329
00337 std::string toXML() ;
00338
00339 #ifndef WITHOUT_ACS
00340
00346 asdmIDL::CalAmpliTableIDL *toIDL() ;
00347
00355 void toIDL(asdmIDL::CalAmpliTableIDL& x) const;
00356
00357 #endif
00358
00359 #ifndef WITHOUT_ACS
00360
00366 void fromIDL(asdmIDL::CalAmpliTableIDL x) ;
00367 #endif
00368
00369
00370
00371
00372
00377 CalAmpliRow *newRow();
00378
00379
00411 CalAmpliRow *newRow(string antennaName, AtmPhaseCorrectionMod::AtmPhaseCorrection atmPhaseCorrection, ReceiverBandMod::ReceiverBand receiverBand, BasebandNameMod::BasebandName basebandName, Tag calDataId, Tag calReductionId, int numReceptor, vector<PolarizationTypeMod::PolarizationType > polarizationTypes, ArrayTime startValidTime, ArrayTime endValidTime, vector<Frequency > frequencyRange, vector<float > apertureEfficiency, vector<float > apertureEfficiencyError);
00412
00413
00414
00427 CalAmpliRow *newRow(CalAmpliRow *row);
00428
00429
00430
00431
00432
00433
00446 CalAmpliRow* add(CalAmpliRow* x) ;
00447
00448
00449
00450
00451
00452
00453
00454
00455
00461 std::vector<CalAmpliRow *> get() ;
00462
00469 const std::vector<CalAmpliRow *>& get() const ;
00470
00471
00472
00473
00474
00494 CalAmpliRow* getRowByKey(string antennaName, AtmPhaseCorrectionMod::AtmPhaseCorrection atmPhaseCorrection, ReceiverBandMod::ReceiverBand receiverBand, BasebandNameMod::BasebandName basebandName, Tag calDataId, Tag calReductionId);
00495
00496
00497
00498
00499
00533 CalAmpliRow* lookup(string antennaName, AtmPhaseCorrectionMod::AtmPhaseCorrection atmPhaseCorrection, ReceiverBandMod::ReceiverBand receiverBand, BasebandNameMod::BasebandName basebandName, Tag calDataId, Tag calReductionId, int numReceptor, vector<PolarizationTypeMod::PolarizationType > polarizationTypes, ArrayTime startValidTime, ArrayTime endValidTime, vector<Frequency > frequencyRange, vector<float > apertureEfficiency, vector<float > apertureEfficiencyError);
00534
00535
00536 void setUnknownAttributeBinaryReader(const std::string& attributeName, BinaryAttributeReaderFunctor* barFctr);
00537 BinaryAttributeReaderFunctor* getUnknownAttributeBinaryReader(const std::string& attributeName) const;
00538
00539 private:
00540
00549 CalAmpliTable (ASDM & container);
00550
00551 ASDM & container;
00552
00553 bool archiveAsBin;
00554 bool fileAsBin ;
00555
00556 std::string version ;
00557
00558 Entity entity;
00559
00560
00561
00569 CalAmpliRow* checkAndAdd(CalAmpliRow* x, bool skipCheckUniqueness=false) ;
00570
00576 void append(CalAmpliRow* x) ;
00577
00583 void addWithoutCheckingUnique(CalAmpliRow* x) ;
00584
00585
00586
00587
00588
00589
00590
00591
00592 std::vector<CalAmpliRow * > privateRows;
00593
00594
00595
00596 std::vector<CalAmpliRow *> row;
00597
00598
00599 void error() ;
00600
00601
00608 void fromXML(std::string& xmlDoc) ;
00609
00610 std::map<std::string, BinaryAttributeReaderFunctor *> unknownAttributes2Functors;
00611
00616 void setFromMIMEFile(const std::string& directory);
00617
00618
00619
00620 void setFromXMLFile(const std::string& directory);
00621
00629 std::string toMIME(const asdm::ByteOrder* byteOrder=asdm::ByteOrder::Machine_Endianity);
00630
00631
00638 void setFromMIME(const std::string & mimeMsg);
00639
00643 std::string MIMEXMLPart(const asdm::ByteOrder* byteOrder=asdm::ByteOrder::Machine_Endianity);
00644
00654 void toFile(std::string directory);
00655
00659 bool loadInProgress;
00660 void checkPresenceInMemory() {
00661 if (!presentInMemory && !loadInProgress) {
00662 loadInProgress = true;
00663 setFromFile(getContainer().getDirectory());
00664 presentInMemory = true;
00665 loadInProgress = false;
00666 }
00667 }
00676 void setFromFile(const std::string& directory);
00677
00678 };
00679
00680 }
00681
00682 #endif