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 ReceiverTable_CLASS
00035 #define ReceiverTable_CLASS
00036
00037 #include <string>
00038 #include <vector>
00039 #include <map>
00040 #include <set>
00041 using std::string;
00042 using std::vector;
00043 using std::map;
00044
00045
00046
00047 #include <Tag.h>
00048 using asdm::Tag;
00049
00050 #include <Frequency.h>
00051 using asdm::Frequency;
00052
00053 #include <ArrayTimeInterval.h>
00054 using asdm::ArrayTimeInterval;
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068 #include "CReceiverBand.h"
00069 using namespace ReceiverBandMod;
00070
00071
00072
00073
00074
00075 #include "CReceiverSideband.h"
00076 using namespace ReceiverSidebandMod;
00077
00078
00079
00080 #include "CNetSideband.h"
00081 using namespace NetSidebandMod;
00082
00083
00084
00085
00086 #include <ConversionException.h>
00087 #include <DuplicateKey.h>
00088 #include <UniquenessViolationException.h>
00089 #include <NoSuchRow.h>
00090 #include <DuplicateKey.h>
00091 using asdm::DuplicateKey;
00092 using asdm::ConversionException;
00093 using asdm::NoSuchRow;
00094 using asdm::DuplicateKey;
00095
00096 #ifndef WITHOUT_ACS
00097 #include <asdmIDLC.h>
00098 using asdmIDL::ReceiverTableIDL;
00099 #endif
00100
00101 #include <Representable.h>
00102
00103 namespace asdm {
00104
00105
00106
00107
00108 class ASDM;
00109 class ReceiverRow;
00203 class ReceiverTable : public Representable {
00204 friend class ASDM;
00205
00206 public:
00207
00208
00214 static vector<string> getKeyName();
00215
00216
00217 virtual ~ReceiverTable();
00218
00224 ASDM &getContainer() const;
00225
00231 unsigned int size() ;
00232
00238 string getName() const;
00239
00245 static const vector<string>& getAttributesNames();
00246
00250 Entity getEntity() const;
00251
00256 void setEntity(Entity e);
00257
00265 string toXML() ;
00266
00267 #ifndef WITHOUT_ACS
00268
00274 ReceiverTableIDL *toIDL() ;
00275 #endif
00276
00277 #ifndef WITHOUT_ACS
00278
00284 void fromIDL(ReceiverTableIDL x) ;
00285 #endif
00286
00287
00288
00289
00290
00295 ReceiverRow *newRow();
00296
00297
00319 ReceiverRow *newRow(Tag spectralWindowId, ArrayTimeInterval timeInterval, string name, int numLO, ReceiverBandMod::ReceiverBand frequencyBand, vector<Frequency > freqLO, ReceiverSidebandMod::ReceiverSideband receiverSideband, vector<NetSidebandMod::NetSideband > sidebandLO);
00320
00321
00322
00335 ReceiverRow *newRow(ReceiverRow *row);
00336
00337
00338
00339
00340
00341
00342
00343
00344
00354 ReceiverRow* add(ReceiverRow* x) ;
00355
00356
00357
00358
00359
00360
00361
00367 vector<ReceiverRow *> get() ;
00368
00369
00370
00371
00372
00386 ReceiverRow* getRowByKey(int receiverId, Tag spectralWindowId, ArrayTimeInterval timeInterval);
00387
00388
00389
00397 vector <ReceiverRow *> getRowByReceiverId(int);
00398
00399
00400
00424 ReceiverRow* lookup(Tag spectralWindowId, ArrayTimeInterval timeInterval, string name, int numLO, ReceiverBandMod::ReceiverBand frequencyBand, vector<Frequency > freqLO, ReceiverSidebandMod::ReceiverSideband receiverSideband, vector<NetSidebandMod::NetSideband > sidebandLO);
00425
00426
00427 private:
00428
00437 ReceiverTable (ASDM & container);
00438
00439 ASDM & container;
00440
00441 bool archiveAsBin;
00442 bool fileAsBin ;
00443
00444 Entity entity;
00445
00446
00447
00451 static string tableName;
00452
00456 static const vector<string> attributesNames;
00457
00461 static vector<string> initAttributesNames();
00462
00463
00467 static vector<string> key;
00468
00469
00479 ReceiverRow* checkAndAdd(ReceiverRow* x) ;
00480
00481
00482
00483
00491 ReceiverRow * insertByStartTime(ReceiverRow* x, vector<ReceiverRow* >& row);
00492
00493
00494
00495
00496
00497
00498 vector<ReceiverRow * > privateRows;
00499
00500
00501
00502
00503
00504
00505
00506
00507 typedef vector <vector <ReceiverRow* > > ID_TIME_ROWS;
00508 map<string, ID_TIME_ROWS > context;
00509
00514 string Key(Tag spectralWindowId) ;
00515
00516
00517
00518
00524 void getByKeyNoAutoIncNoTime(vector <ReceiverRow*>& vin, vector <ReceiverRow*>& vout, Tag spectralWindowId);
00525
00526
00527
00528 void error() ;
00529
00530
00537 void fromXML(string xmlDoc) ;
00538
00543 void setFromMIMEFile(const string& directory);
00544 void setFromXMLFile(const string& directory);
00545
00553 string toMIME(const asdm::ByteOrder* byteOrder=asdm::ByteOrder::Machine_Endianity);
00554
00555
00562 void setFromMIME(const string & mimeMsg);
00563
00567 string MIMEXMLPart(const asdm::ByteOrder* byteOrder=asdm::ByteOrder::Machine_Endianity);
00568
00578 void toFile(string directory);
00579
00588 void setFromFile(const string& directory);
00589
00590 };
00591
00592 }
00593
00594 #endif