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 CalReductionTable_CLASS
00035 #define CalReductionTable_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 <ArrayTime.h>
00048 using asdm::ArrayTime;
00049
00050 #include <Tag.h>
00051 using asdm::Tag;
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069 #include "CInvalidatingCondition.h"
00070 using namespace InvalidatingConditionMod;
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083 #include <ConversionException.h>
00084 #include <DuplicateKey.h>
00085 #include <UniquenessViolationException.h>
00086 #include <NoSuchRow.h>
00087 #include <DuplicateKey.h>
00088 using asdm::DuplicateKey;
00089 using asdm::ConversionException;
00090 using asdm::NoSuchRow;
00091 using asdm::DuplicateKey;
00092
00093 #ifndef WITHOUT_ACS
00094 #include <asdmIDLC.h>
00095 using asdmIDL::CalReductionTableIDL;
00096 #endif
00097
00098 #include <Representable.h>
00099
00100 namespace asdm {
00101
00102
00103
00104
00105 class ASDM;
00106 class CalReductionRow;
00210 class CalReductionTable : public Representable {
00211 friend class ASDM;
00212
00213 public:
00214
00215
00221 static vector<string> getKeyName();
00222
00223
00224 virtual ~CalReductionTable();
00225
00231 ASDM &getContainer() const;
00232
00238 unsigned int size() ;
00239
00245 string getName() const;
00246
00252 static const vector<string>& getAttributesNames();
00253
00257 Entity getEntity() const;
00258
00263 void setEntity(Entity e);
00264
00272 string toXML() ;
00273
00274 #ifndef WITHOUT_ACS
00275
00281 CalReductionTableIDL *toIDL() ;
00282 #endif
00283
00284 #ifndef WITHOUT_ACS
00285
00291 void fromIDL(CalReductionTableIDL x) ;
00292 #endif
00293
00294
00295
00296
00297
00302 CalReductionRow *newRow();
00303
00304
00330 CalReductionRow *newRow(int numApplied, vector<string > appliedCalibrations, int numParam, vector<string > paramSet, int numInvalidConditions, vector<InvalidatingConditionMod::InvalidatingCondition > invalidConditions, ArrayTime timeReduced, string messages, string software, string softwareVersion);
00331
00332
00333
00346 CalReductionRow *newRow(CalReductionRow *row);
00347
00348
00349
00350
00351
00352
00353
00354
00364 CalReductionRow* add(CalReductionRow* x) ;
00365
00366
00367
00368
00369
00370
00371
00377 vector<CalReductionRow *> get() ;
00378
00379
00380
00381
00382
00392 CalReductionRow* getRowByKey(Tag calReductionId);
00393
00394
00395
00396
00397
00425 CalReductionRow* lookup(int numApplied, vector<string > appliedCalibrations, int numParam, vector<string > paramSet, int numInvalidConditions, vector<InvalidatingConditionMod::InvalidatingCondition > invalidConditions, ArrayTime timeReduced, string messages, string software, string softwareVersion);
00426
00427
00428 private:
00429
00438 CalReductionTable (ASDM & container);
00439
00440 ASDM & container;
00441
00442 bool archiveAsBin;
00443 bool fileAsBin ;
00444
00445 Entity entity;
00446
00447
00448
00449 map<string,int> noAutoIncIds;
00450 void autoIncrement(string key, CalReductionRow* x);
00451
00452
00456 static string tableName;
00457
00461 static const vector<string> attributesNames;
00462
00466 static vector<string> initAttributesNames();
00467
00468
00472 static vector<string> key;
00473
00474
00484 CalReductionRow* checkAndAdd(CalReductionRow* x) ;
00485
00486
00487
00488
00489
00490
00491 vector<CalReductionRow * > privateRows;
00492
00493
00494
00495 vector<CalReductionRow *> row;
00496
00497
00498 void error() ;
00499
00500
00507 void fromXML(string xmlDoc) ;
00508
00513 void setFromMIMEFile(const string& directory);
00514 void setFromXMLFile(const string& directory);
00515
00523 string toMIME(const asdm::ByteOrder* byteOrder=asdm::ByteOrder::Machine_Endianity);
00524
00525
00532 void setFromMIME(const string & mimeMsg);
00533
00537 string MIMEXMLPart(const asdm::ByteOrder* byteOrder=asdm::ByteOrder::Machine_Endianity);
00538
00548 void toFile(string directory);
00549
00558 void setFromFile(const string& directory);
00559
00560 };
00561
00562 }
00563
00564 #endif