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 FieldTable_CLASS
00035 #define FieldTable_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 <Angle.h>
00051 using asdm::Angle;
00052
00053 #include <Tag.h>
00054 using asdm::Tag;
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076 #include "CDirectionReferenceCode.h"
00077 using namespace DirectionReferenceCodeMod;
00078
00079
00080
00081
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::FieldTableIDL;
00099 #endif
00100
00101 #include <Representable.h>
00102
00103 namespace asdm {
00104
00105
00106
00107
00108 class ASDM;
00109 class FieldRow;
00237 class FieldTable : public Representable {
00238 friend class ASDM;
00239
00240 public:
00241
00242
00248 static vector<string> getKeyName();
00249
00250
00251 virtual ~FieldTable();
00252
00258 ASDM &getContainer() const;
00259
00265 unsigned int size() ;
00266
00272 string getName() const;
00273
00279 static const vector<string>& getAttributesNames();
00280
00284 Entity getEntity() const;
00285
00290 void setEntity(Entity e);
00291
00299 string toXML() ;
00300
00301 #ifndef WITHOUT_ACS
00302
00308 FieldTableIDL *toIDL() ;
00309 #endif
00310
00311 #ifndef WITHOUT_ACS
00312
00318 void fromIDL(FieldTableIDL x) ;
00319 #endif
00320
00321
00322
00323
00324
00329 FieldRow *newRow();
00330
00331
00349 FieldRow *newRow(string fieldName, string code, int numPoly, vector<vector<Angle > > delayDir, vector<vector<Angle > > phaseDir, vector<vector<Angle > > referenceDir);
00350
00351
00352
00365 FieldRow *newRow(FieldRow *row);
00366
00367
00368
00369
00370
00371
00372
00373
00383 FieldRow* add(FieldRow* x) ;
00384
00385
00386
00387
00388
00389
00390
00396 vector<FieldRow *> get() ;
00397
00398
00399
00400
00401
00411 FieldRow* getRowByKey(Tag fieldId);
00412
00413
00414
00415
00416
00436 FieldRow* lookup(string fieldName, string code, int numPoly, vector<vector<Angle > > delayDir, vector<vector<Angle > > phaseDir, vector<vector<Angle > > referenceDir);
00437
00438
00439 private:
00440
00449 FieldTable (ASDM & container);
00450
00451 ASDM & container;
00452
00453 bool archiveAsBin;
00454 bool fileAsBin ;
00455
00456 Entity entity;
00457
00458
00459
00460 map<string,int> noAutoIncIds;
00461 void autoIncrement(string key, FieldRow* x);
00462
00463
00467 static string tableName;
00468
00472 static const vector<string> attributesNames;
00473
00477 static vector<string> initAttributesNames();
00478
00479
00483 static vector<string> key;
00484
00485
00495 FieldRow* checkAndAdd(FieldRow* x) ;
00496
00497
00498
00499
00500
00501
00502 vector<FieldRow * > privateRows;
00503
00504
00505
00506 vector<FieldRow *> row;
00507
00508
00509 void error() ;
00510
00511
00518 void fromXML(string xmlDoc) ;
00519
00524 void setFromMIMEFile(const string& directory);
00525 void setFromXMLFile(const string& directory);
00526
00534 string toMIME(const asdm::ByteOrder* byteOrder=asdm::ByteOrder::Machine_Endianity);
00535
00536
00543 void setFromMIME(const string & mimeMsg);
00544
00548 string MIMEXMLPart(const asdm::ByteOrder* byteOrder=asdm::ByteOrder::Machine_Endianity);
00549
00559 void toFile(string directory);
00560
00569 void setFromFile(const string& directory);
00570
00571 };
00572
00573 }
00574
00575 #endif