CalSeeingTable.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 CalSeeingTable_CLASS
00035 #define CalSeeingTable_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 <Interval.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 #include "CAtmPhaseCorrection.h"
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100 #include <ConversionException.h>
00101 #include <DuplicateKey.h>
00102 #include <UniquenessViolationException.h>
00103 #include <NoSuchRow.h>
00104 #include <DuplicateKey.h>
00105
00106
00107 #ifndef WITHOUT_ACS
00108 #include <asdmIDLC.h>
00109 #endif
00110
00111 #include <Representable.h>
00112
00113 #include <pthread.h>
00114
00115 namespace asdm {
00116
00117
00118
00119
00120 class ASDM;
00121 class CalSeeingRow;
00260 class CalSeeingTable : public Representable {
00261 friend class ASDM;
00262
00263 public:
00264
00265
00271 static const std::vector<std::string>& getKeyName();
00272
00273
00274 virtual ~CalSeeingTable();
00275
00281 ASDM &getContainer() const;
00282
00288 unsigned int size() const;
00289
00297 std::string getName() const;
00298
00306 static std::string name() ;
00307
00312 std::string getVersion() const ;
00313
00319 static const std::vector<std::string>& getAttributesNames();
00320
00326 static const std::vector<std::string>& defaultAttributesNamesInBin();
00327
00331 Entity getEntity() const;
00332
00337 void setEntity(Entity e);
00338
00346 std::string toXML() ;
00347
00348 #ifndef WITHOUT_ACS
00349
00355 asdmIDL::CalSeeingTableIDL *toIDL() ;
00356
00364 void toIDL(asdmIDL::CalSeeingTableIDL& x) const;
00365
00366 #endif
00367
00368 #ifndef WITHOUT_ACS
00369
00375 void fromIDL(asdmIDL::CalSeeingTableIDL x) ;
00376 #endif
00377
00378
00379
00380
00381
00386 CalSeeingRow *newRow();
00387
00388
00418 CalSeeingRow *newRow(AtmPhaseCorrectionMod::AtmPhaseCorrection atmPhaseCorrection, Tag calDataId, Tag calReductionId, ArrayTime startValidTime, ArrayTime endValidTime, vector<Frequency > frequencyRange, Interval integrationTime, int numBaseLengths, vector<Length > baselineLengths, vector<Angle > phaseRMS, Angle seeing, Angle seeingError);
00419
00420
00421
00434 CalSeeingRow *newRow(CalSeeingRow *row);
00435
00436
00437
00438
00439
00440
00453 CalSeeingRow* add(CalSeeingRow* x) ;
00454
00455
00456
00457
00458
00459
00460
00461
00462
00468 std::vector<CalSeeingRow *> get() ;
00469
00476 const std::vector<CalSeeingRow *>& get() const ;
00477
00478
00479
00480
00481
00495 CalSeeingRow* getRowByKey(AtmPhaseCorrectionMod::AtmPhaseCorrection atmPhaseCorrection, Tag calDataId, Tag calReductionId);
00496
00497
00498
00499
00500
00532 CalSeeingRow* lookup(AtmPhaseCorrectionMod::AtmPhaseCorrection atmPhaseCorrection, Tag calDataId, Tag calReductionId, ArrayTime startValidTime, ArrayTime endValidTime, vector<Frequency > frequencyRange, Interval integrationTime, int numBaseLengths, vector<Length > baselineLengths, vector<Angle > phaseRMS, Angle seeing, Angle seeingError);
00533
00534
00535 void setUnknownAttributeBinaryReader(const std::string& attributeName, BinaryAttributeReaderFunctor* barFctr);
00536 BinaryAttributeReaderFunctor* getUnknownAttributeBinaryReader(const std::string& attributeName) const;
00537
00538 private:
00539
00548 CalSeeingTable (ASDM & container);
00549
00550 ASDM & container;
00551
00552 bool archiveAsBin;
00553 bool fileAsBin ;
00554
00555 std::string version ;
00556
00557 Entity entity;
00558
00559
00560
00568 CalSeeingRow* checkAndAdd(CalSeeingRow* x, bool skipCheckUniqueness=false) ;
00569
00575 void append(CalSeeingRow* x) ;
00576
00582 void addWithoutCheckingUnique(CalSeeingRow* x) ;
00583
00584
00585
00586
00587
00588
00589
00590
00591 std::vector<CalSeeingRow * > privateRows;
00592
00593
00594
00595 std::vector<CalSeeingRow *> row;
00596
00597
00598 void error() ;
00599
00600
00607 void fromXML(std::string& xmlDoc) ;
00608
00609 std::map<std::string, BinaryAttributeReaderFunctor *> unknownAttributes2Functors;
00610
00615 void setFromMIMEFile(const std::string& directory);
00616
00617
00618
00619 void setFromXMLFile(const std::string& directory);
00620
00628 std::string toMIME(const asdm::ByteOrder* byteOrder=asdm::ByteOrder::Machine_Endianity);
00629
00630
00637 void setFromMIME(const std::string & mimeMsg);
00638
00642 std::string MIMEXMLPart(const asdm::ByteOrder* byteOrder=asdm::ByteOrder::Machine_Endianity);
00643
00653 void toFile(std::string directory);
00654
00658 bool loadInProgress;
00659 void checkPresenceInMemory() {
00660 if (!presentInMemory && !loadInProgress) {
00661 loadInProgress = true;
00662 setFromFile(getContainer().getDirectory());
00663 presentInMemory = true;
00664 loadInProgress = false;
00665 }
00666 }
00675 void setFromFile(const std::string& directory);
00676
00677 };
00678
00679 }
00680
00681 #endif