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 SquareLawDetectorTable_CLASS
00035 #define SquareLawDetectorTable_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 <Tag.h>
00048 using asdm::Tag;
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058 #include "CDetectorBandType.h"
00059 using namespace DetectorBandTypeMod;
00060
00061
00062
00063
00064 #include <ConversionException.h>
00065 #include <DuplicateKey.h>
00066 #include <UniquenessViolationException.h>
00067 #include <NoSuchRow.h>
00068 #include <DuplicateKey.h>
00069 using asdm::DuplicateKey;
00070 using asdm::ConversionException;
00071 using asdm::NoSuchRow;
00072 using asdm::DuplicateKey;
00073
00074 #ifndef WITHOUT_ACS
00075 #include <asdmIDLC.h>
00076 using asdmIDL::SquareLawDetectorTableIDL;
00077 #endif
00078
00079 #include <Representable.h>
00080
00081 namespace asdm {
00082
00083
00084
00085
00086 class ASDM;
00087 class SquareLawDetectorRow;
00135 class SquareLawDetectorTable : public Representable {
00136 friend class ASDM;
00137
00138 public:
00139
00140
00146 static vector<string> getKeyName();
00147
00148
00149 virtual ~SquareLawDetectorTable();
00150
00156 ASDM &getContainer() const;
00157
00163 unsigned int size() ;
00164
00170 string getName() const;
00171
00177 static const vector<string>& getAttributesNames();
00178
00182 Entity getEntity() const;
00183
00188 void setEntity(Entity e);
00189
00197 string toXML() ;
00198
00199 #ifndef WITHOUT_ACS
00200
00206 SquareLawDetectorTableIDL *toIDL() ;
00207 #endif
00208
00209 #ifndef WITHOUT_ACS
00210
00216 void fromIDL(SquareLawDetectorTableIDL x) ;
00217 #endif
00218
00219
00220
00221
00222
00227 SquareLawDetectorRow *newRow();
00228
00229
00239 SquareLawDetectorRow *newRow(int numBand, DetectorBandTypeMod::DetectorBandType bandType);
00240
00241
00242
00255 SquareLawDetectorRow *newRow(SquareLawDetectorRow *row);
00256
00257
00258
00259
00260
00261
00262
00263
00273 SquareLawDetectorRow* add(SquareLawDetectorRow* x) ;
00274
00275
00276
00277
00278
00279
00280
00286 vector<SquareLawDetectorRow *> get() ;
00287
00288
00289
00290
00291
00301 SquareLawDetectorRow* getRowByKey(Tag squareLawDetectorId);
00302
00303
00304
00305
00306
00318 SquareLawDetectorRow* lookup(int numBand, DetectorBandTypeMod::DetectorBandType bandType);
00319
00320
00321 private:
00322
00331 SquareLawDetectorTable (ASDM & container);
00332
00333 ASDM & container;
00334
00335 bool archiveAsBin;
00336 bool fileAsBin ;
00337
00338 Entity entity;
00339
00340
00341
00342 map<string,int> noAutoIncIds;
00343 void autoIncrement(string key, SquareLawDetectorRow* x);
00344
00345
00349 static string tableName;
00350
00354 static const vector<string> attributesNames;
00355
00359 static vector<string> initAttributesNames();
00360
00361
00365 static vector<string> key;
00366
00367
00377 SquareLawDetectorRow* checkAndAdd(SquareLawDetectorRow* x) ;
00378
00379
00380
00381
00382
00383
00384 vector<SquareLawDetectorRow * > privateRows;
00385
00386
00387
00388 vector<SquareLawDetectorRow *> row;
00389
00390
00391 void error() ;
00392
00393
00400 void fromXML(string xmlDoc) ;
00401
00406 void setFromMIMEFile(const string& directory);
00407 void setFromXMLFile(const string& directory);
00408
00416 string toMIME(const asdm::ByteOrder* byteOrder=asdm::ByteOrder::Machine_Endianity);
00417
00418
00425 void setFromMIME(const string & mimeMsg);
00426
00430 string MIMEXMLPart(const asdm::ByteOrder* byteOrder=asdm::ByteOrder::Machine_Endianity);
00431
00441 void toFile(string directory);
00442
00451 void setFromFile(const string& directory);
00452
00453 };
00454
00455 }
00456
00457 #endif