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 FlagTable_CLASS
00035 #define FlagTable_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
00070
00071
00072
00073 #include "CPolarizationType.h"
00074 using namespace PolarizationTypeMod;
00075
00076
00077
00078
00079 #include <ConversionException.h>
00080 #include <DuplicateKey.h>
00081 #include <UniquenessViolationException.h>
00082 #include <NoSuchRow.h>
00083 #include <DuplicateKey.h>
00084 using asdm::DuplicateKey;
00085 using asdm::ConversionException;
00086 using asdm::NoSuchRow;
00087 using asdm::DuplicateKey;
00088
00089 #ifndef WITHOUT_ACS
00090 #include <asdmIDLC.h>
00091 using asdmIDL::FlagTableIDL;
00092 #endif
00093
00094 #include <Representable.h>
00095
00096 namespace asdm {
00097
00098
00099
00100
00101 class ASDM;
00102 class FlagRow;
00216 class FlagTable : public Representable {
00217 friend class ASDM;
00218
00219 public:
00220
00221
00227 static vector<string> getKeyName();
00228
00229
00230 virtual ~FlagTable();
00231
00237 ASDM &getContainer() const;
00238
00244 unsigned int size() ;
00245
00251 string getName() const;
00252
00258 static const vector<string>& getAttributesNames();
00259
00263 Entity getEntity() const;
00264
00269 void setEntity(Entity e);
00270
00278 string toXML() ;
00279
00280 #ifndef WITHOUT_ACS
00281
00287 FlagTableIDL *toIDL() ;
00288 #endif
00289
00290 #ifndef WITHOUT_ACS
00291
00297 void fromIDL(FlagTableIDL x) ;
00298 #endif
00299
00300
00301
00302
00303
00308 FlagRow *newRow();
00309
00310
00326 FlagRow *newRow(ArrayTime startTime, ArrayTime endTime, string reason, int numAntenna, vector<Tag> antennaId);
00327
00328
00329
00342 FlagRow *newRow(FlagRow *row);
00343
00344
00345
00346
00347
00348
00349
00350
00360 FlagRow* add(FlagRow* x) ;
00361
00362
00363
00364
00365
00366
00367
00373 vector<FlagRow *> get() ;
00374
00375
00376
00377
00378
00388 FlagRow* getRowByKey(Tag flagId);
00389
00390
00391
00392
00393
00411 FlagRow* lookup(ArrayTime startTime, ArrayTime endTime, string reason, int numAntenna, vector<Tag> antennaId);
00412
00413
00414 private:
00415
00424 FlagTable (ASDM & container);
00425
00426 ASDM & container;
00427
00428 bool archiveAsBin;
00429 bool fileAsBin ;
00430
00431 Entity entity;
00432
00433
00434
00435 map<string,int> noAutoIncIds;
00436 void autoIncrement(string key, FlagRow* x);
00437
00438
00442 static string tableName;
00443
00447 static const vector<string> attributesNames;
00448
00452 static vector<string> initAttributesNames();
00453
00454
00458 static vector<string> key;
00459
00460
00470 FlagRow* checkAndAdd(FlagRow* x) ;
00471
00472
00473
00474
00475
00476
00477 vector<FlagRow * > privateRows;
00478
00479
00480
00481 vector<FlagRow *> row;
00482
00483
00484 void error() ;
00485
00486
00493 void fromXML(string xmlDoc) ;
00494
00499 void setFromMIMEFile(const string& directory);
00500 void setFromXMLFile(const string& directory);
00501
00509 string toMIME(const asdm::ByteOrder* byteOrder=asdm::ByteOrder::Machine_Endianity);
00510
00511
00518 void setFromMIME(const string & mimeMsg);
00519
00523 string MIMEXMLPart(const asdm::ByteOrder* byteOrder=asdm::ByteOrder::Machine_Endianity);
00524
00534 void toFile(string directory);
00535
00544 void setFromFile(const string& directory);
00545
00546 };
00547
00548 }
00549
00550 #endif