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 CalDataTable_CLASS
00035 #define CalDataTable_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 #include <EntityRef.h>
00054 using asdm::EntityRef;
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068 #include "CCalDataOrigin.h"
00069 using namespace CalDataOriginMod;
00070
00071
00072
00073 #include "CCalType.h"
00074 using namespace CalTypeMod;
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084 #include "CAssociatedCalNature.h"
00085 using namespace AssociatedCalNatureMod;
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095 #include "CScanIntent.h"
00096 using namespace ScanIntentMod;
00097
00098
00099
00100
00101 #include <ConversionException.h>
00102 #include <DuplicateKey.h>
00103 #include <UniquenessViolationException.h>
00104 #include <NoSuchRow.h>
00105 #include <DuplicateKey.h>
00106 using asdm::DuplicateKey;
00107 using asdm::ConversionException;
00108 using asdm::NoSuchRow;
00109 using asdm::DuplicateKey;
00110
00111 #ifndef WITHOUT_ACS
00112 #include <asdmIDLC.h>
00113 using asdmIDL::CalDataTableIDL;
00114 #endif
00115
00116 #include <Representable.h>
00117
00118 namespace asdm {
00119
00120
00121
00122
00123 class ASDM;
00124 class CalDataRow;
00252 class CalDataTable : public Representable {
00253 friend class ASDM;
00254
00255 public:
00256
00257
00263 static vector<string> getKeyName();
00264
00265
00266 virtual ~CalDataTable();
00267
00273 ASDM &getContainer() const;
00274
00280 unsigned int size() ;
00281
00287 string getName() const;
00288
00294 static const vector<string>& getAttributesNames();
00295
00299 Entity getEntity() const;
00300
00305 void setEntity(Entity e);
00306
00314 string toXML() ;
00315
00316 #ifndef WITHOUT_ACS
00317
00323 CalDataTableIDL *toIDL() ;
00324 #endif
00325
00326 #ifndef WITHOUT_ACS
00327
00333 void fromIDL(CalDataTableIDL x) ;
00334 #endif
00335
00336
00337
00338
00339
00344 CalDataRow *newRow();
00345
00346
00366 CalDataRow *newRow(ArrayTime startTimeObserved, ArrayTime endTimeObserved, EntityRef execBlockUID, CalDataOriginMod::CalDataOrigin calDataType, CalTypeMod::CalType calType, int numScan, vector<int > scanSet);
00367
00368
00369
00382 CalDataRow *newRow(CalDataRow *row);
00383
00384
00385
00386
00387
00388
00389
00390
00400 CalDataRow* add(CalDataRow* x) ;
00401
00402
00403
00404
00405
00406
00407
00413 vector<CalDataRow *> get() ;
00414
00415
00416
00417
00418
00428 CalDataRow* getRowByKey(Tag calDataId);
00429
00430
00431
00432
00433
00455 CalDataRow* lookup(ArrayTime startTimeObserved, ArrayTime endTimeObserved, EntityRef execBlockUID, CalDataOriginMod::CalDataOrigin calDataType, CalTypeMod::CalType calType, int numScan, vector<int > scanSet);
00456
00457
00458 private:
00459
00468 CalDataTable (ASDM & container);
00469
00470 ASDM & container;
00471
00472 bool archiveAsBin;
00473 bool fileAsBin ;
00474
00475 Entity entity;
00476
00477
00478
00479 map<string,int> noAutoIncIds;
00480 void autoIncrement(string key, CalDataRow* x);
00481
00482
00486 static string tableName;
00487
00491 static const vector<string> attributesNames;
00492
00496 static vector<string> initAttributesNames();
00497
00498
00502 static vector<string> key;
00503
00504
00514 CalDataRow* checkAndAdd(CalDataRow* x) ;
00515
00516
00517
00518
00519
00520
00521 vector<CalDataRow * > privateRows;
00522
00523
00524
00525 vector<CalDataRow *> row;
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