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 MainTable_CLASS
00035 #define MainTable_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 <Interval.h>
00051 using asdm::Interval;
00052
00053 #include <Tag.h>
00054 using asdm::Tag;
00055
00056 #include <EntityRef.h>
00057 using asdm::EntityRef;
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067 #include "CTimeSampling.h"
00068 using namespace TimeSamplingMod;
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087 #include <ConversionException.h>
00088 #include <DuplicateKey.h>
00089 #include <UniquenessViolationException.h>
00090 #include <NoSuchRow.h>
00091 #include <DuplicateKey.h>
00092 using asdm::DuplicateKey;
00093 using asdm::ConversionException;
00094 using asdm::NoSuchRow;
00095 using asdm::DuplicateKey;
00096
00097 #ifndef WITHOUT_ACS
00098 #include <asdmIDLC.h>
00099 using asdmIDL::MainTableIDL;
00100 #endif
00101
00102 #include <Representable.h>
00103
00104 namespace asdm {
00105
00106
00107
00108
00109 class ASDM;
00110 class MainRow;
00243 class MainTable : public Representable {
00244 friend class ASDM;
00245
00246 public:
00247
00248
00254 static vector<string> getKeyName();
00255
00256
00257 virtual ~MainTable();
00258
00264 ASDM &getContainer() const;
00265
00271 unsigned int size() ;
00272
00278 string getName() const;
00279
00285 static const vector<string>& getAttributesNames();
00286
00290 Entity getEntity() const;
00291
00296 void setEntity(Entity e);
00297
00305 string toXML() ;
00306
00307 #ifndef WITHOUT_ACS
00308
00314 MainTableIDL *toIDL() ;
00315 #endif
00316
00317 #ifndef WITHOUT_ACS
00318
00324 void fromIDL(MainTableIDL x) ;
00325 #endif
00326
00327
00328
00329
00330
00335 MainRow *newRow();
00336
00337
00369 MainRow *newRow(ArrayTime time, Tag configDescriptionId, Tag fieldId, int numAntenna, TimeSamplingMod::TimeSampling timeSampling, Interval interval, int numIntegration, int scanNumber, int subscanNumber, int dataSize, EntityRef dataOid, vector<Tag> stateId, Tag execBlockId);
00370
00371
00372
00385 MainRow *newRow(MainRow *row);
00386
00387
00388
00389
00390
00391
00408 MainRow* add(MainRow* x) ;
00409
00410
00411
00412
00413
00414
00415
00416
00417
00423 vector<MainRow *> get() ;
00424
00425
00433 vector <MainRow*> *getByContext(Tag configDescriptionId, Tag fieldId);
00434
00435
00436
00437
00438
00452 MainRow* getRowByKey(ArrayTime time, Tag configDescriptionId, Tag fieldId);
00453
00454
00455
00456
00457
00491 MainRow* lookup(ArrayTime time, Tag configDescriptionId, Tag fieldId, int numAntenna, TimeSamplingMod::TimeSampling timeSampling, Interval interval, int numIntegration, int scanNumber, int subscanNumber, int dataSize, EntityRef dataOid, vector<Tag> stateId, Tag execBlockId);
00492
00493
00494 private:
00495
00504 MainTable (ASDM & container);
00505
00506 ASDM & container;
00507
00508 bool archiveAsBin;
00509 bool fileAsBin ;
00510
00511 Entity entity;
00512
00513
00514
00518 static string tableName;
00519
00523 static const vector<string> attributesNames;
00524
00528 static vector<string> initAttributesNames();
00529
00530
00534 static vector<string> key;
00535
00536
00544 MainRow* checkAndAdd(MainRow* x) ;
00545
00546
00547
00548
00556 MainRow * insertByTime(MainRow* x, vector<MainRow *>&row );
00557
00558
00559
00560
00561
00562
00563 vector<MainRow * > privateRows;
00564
00565
00566
00567
00568
00569
00570
00571
00572 typedef vector <MainRow* > TIME_ROWS;
00573 map<string, TIME_ROWS > context;
00574
00579 string Key(Tag configDescriptionId, Tag fieldId) ;
00580
00581
00582
00583
00589 void getByKeyNoAutoIncNoTime(vector <MainRow*>& vin, vector <MainRow*>& vout, Tag configDescriptionId, Tag fieldId);
00590
00591
00592
00593 void error() ;
00594
00595
00602 void fromXML(string xmlDoc) ;
00603
00608 void setFromMIMEFile(const string& directory);
00609 void setFromXMLFile(const string& directory);
00610
00618 string toMIME(const asdm::ByteOrder* byteOrder=asdm::ByteOrder::Machine_Endianity);
00619
00620
00627 void setFromMIME(const string & mimeMsg);
00628
00632 string MIMEXMLPart(const asdm::ByteOrder* byteOrder=asdm::ByteOrder::Machine_Endianity);
00633
00643 void toFile(string directory);
00644
00653 void setFromFile(const string& directory);
00654
00655 };
00656
00657 }
00658
00659 #endif