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 AnnotationTable_CLASS
00035 #define AnnotationTable_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
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070 #include "CBasebandName.h"
00071 using namespace BasebandNameMod;
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092 #include <ConversionException.h>
00093 #include <DuplicateKey.h>
00094 #include <UniquenessViolationException.h>
00095 #include <NoSuchRow.h>
00096 #include <DuplicateKey.h>
00097 using asdm::DuplicateKey;
00098 using asdm::ConversionException;
00099 using asdm::NoSuchRow;
00100 using asdm::DuplicateKey;
00101
00102 #ifndef WITHOUT_ACS
00103 #include <asdmIDLC.h>
00104 using asdmIDL::AnnotationTableIDL;
00105 #endif
00106
00107 #include <Representable.h>
00108
00109 namespace asdm {
00110
00111
00112
00113
00114 class ASDM;
00115 class AnnotationRow;
00250 class AnnotationTable : public Representable {
00251 friend class ASDM;
00252
00253 public:
00254
00255
00261 static vector<string> getKeyName();
00262
00263
00264 virtual ~AnnotationTable();
00265
00271 ASDM &getContainer() const;
00272
00278 unsigned int size() ;
00279
00285 string getName() const;
00286
00292 static const vector<string>& getAttributesNames();
00293
00297 Entity getEntity() const;
00298
00303 void setEntity(Entity e);
00304
00312 string toXML() ;
00313
00314 #ifndef WITHOUT_ACS
00315
00321 AnnotationTableIDL *toIDL() ;
00322 #endif
00323
00324 #ifndef WITHOUT_ACS
00325
00331 void fromIDL(AnnotationTableIDL x) ;
00332 #endif
00333
00334
00335
00336
00337
00342 AnnotationRow *newRow();
00343
00344
00356 AnnotationRow *newRow(ArrayTime time, string issue, string details);
00357
00358
00359
00372 AnnotationRow *newRow(AnnotationRow *row);
00373
00374
00375
00376
00377
00378
00379
00380
00390 AnnotationRow* add(AnnotationRow* x) ;
00391
00392
00393
00394
00395
00396
00397
00403 vector<AnnotationRow *> get() ;
00404
00405
00406
00407
00408
00418 AnnotationRow* getRowByKey(Tag annotationId);
00419
00420
00421
00422
00423
00437 AnnotationRow* lookup(ArrayTime time, string issue, string details);
00438
00439
00440 private:
00441
00450 AnnotationTable (ASDM & container);
00451
00452 ASDM & container;
00453
00454 bool archiveAsBin;
00455 bool fileAsBin ;
00456
00457 Entity entity;
00458
00459
00460
00461 map<string,int> noAutoIncIds;
00462 void autoIncrement(string key, AnnotationRow* x);
00463
00464
00468 static string tableName;
00469
00473 static const vector<string> attributesNames;
00474
00478 static vector<string> initAttributesNames();
00479
00480
00484 static vector<string> key;
00485
00486
00496 AnnotationRow* checkAndAdd(AnnotationRow* x) ;
00497
00498
00499
00500
00501
00502
00503 vector<AnnotationRow * > privateRows;
00504
00505
00506
00507 vector<AnnotationRow *> row;
00508
00509
00510 void error() ;
00511
00512
00519 void fromXML(string xmlDoc) ;
00520
00525 void setFromMIMEFile(const string& directory);
00526 void setFromXMLFile(const string& directory);
00527
00535 string toMIME(const asdm::ByteOrder* byteOrder=asdm::ByteOrder::Machine_Endianity);
00536
00537
00544 void setFromMIME(const string & mimeMsg);
00545
00549 string MIMEXMLPart(const asdm::ByteOrder* byteOrder=asdm::ByteOrder::Machine_Endianity);
00550
00560 void toFile(string directory);
00561
00570 void setFromFile(const string& directory);
00571
00572 };
00573
00574 }
00575
00576 #endif