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 StationTable_CLASS
00035 #define StationTable_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 #include <Length.h>
00051 using asdm::Length;
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063 #include "CStationType.h"
00064 using namespace StationTypeMod;
00065
00066
00067
00068
00069 #include <ConversionException.h>
00070 #include <DuplicateKey.h>
00071 #include <UniquenessViolationException.h>
00072 #include <NoSuchRow.h>
00073 #include <DuplicateKey.h>
00074 using asdm::DuplicateKey;
00075 using asdm::ConversionException;
00076 using asdm::NoSuchRow;
00077 using asdm::DuplicateKey;
00078
00079 #ifndef WITHOUT_ACS
00080 #include <asdmIDLC.h>
00081 using asdmIDL::StationTableIDL;
00082 #endif
00083
00084 #include <Representable.h>
00085
00086 namespace asdm {
00087
00088
00089
00090
00091 class ASDM;
00092 class StationRow;
00147 class StationTable : public Representable {
00148 friend class ASDM;
00149
00150 public:
00151
00152
00158 static vector<string> getKeyName();
00159
00160
00161 virtual ~StationTable();
00162
00168 ASDM &getContainer() const;
00169
00175 unsigned int size() ;
00176
00182 string getName() const;
00183
00189 static const vector<string>& getAttributesNames();
00190
00194 Entity getEntity() const;
00195
00200 void setEntity(Entity e);
00201
00209 string toXML() ;
00210
00211 #ifndef WITHOUT_ACS
00212
00218 StationTableIDL *toIDL() ;
00219 #endif
00220
00221 #ifndef WITHOUT_ACS
00222
00228 void fromIDL(StationTableIDL x) ;
00229 #endif
00230
00231
00232
00233
00234
00239 StationRow *newRow();
00240
00241
00253 StationRow *newRow(string name, vector<Length > position, StationTypeMod::StationType type);
00254
00255
00256
00269 StationRow *newRow(StationRow *row);
00270
00271
00272
00273
00274
00275
00276
00277
00287 StationRow* add(StationRow* x) ;
00288
00289
00290
00291
00292
00293
00294
00300 vector<StationRow *> get() ;
00301
00302
00303
00304
00305
00315 StationRow* getRowByKey(Tag stationId);
00316
00317
00318
00319
00320
00334 StationRow* lookup(string name, vector<Length > position, StationTypeMod::StationType type);
00335
00336
00337 private:
00338
00347 StationTable (ASDM & container);
00348
00349 ASDM & container;
00350
00351 bool archiveAsBin;
00352 bool fileAsBin ;
00353
00354 Entity entity;
00355
00356
00357
00358 map<string,int> noAutoIncIds;
00359 void autoIncrement(string key, StationRow* x);
00360
00361
00365 static string tableName;
00366
00370 static const vector<string> attributesNames;
00371
00375 static vector<string> initAttributesNames();
00376
00377
00381 static vector<string> key;
00382
00383
00393 StationRow* checkAndAdd(StationRow* x) ;
00394
00395
00396
00397
00398
00399
00400 vector<StationRow * > privateRows;
00401
00402
00403
00404 vector<StationRow *> row;
00405
00406
00407 void error() ;
00408
00409
00416 void fromXML(string xmlDoc) ;
00417
00422 void setFromMIMEFile(const string& directory);
00423 void setFromXMLFile(const string& directory);
00424
00432 string toMIME(const asdm::ByteOrder* byteOrder=asdm::ByteOrder::Machine_Endianity);
00433
00434
00441 void setFromMIME(const string & mimeMsg);
00442
00446 string MIMEXMLPart(const asdm::ByteOrder* byteOrder=asdm::ByteOrder::Machine_Endianity);
00447
00457 void toFile(string directory);
00458
00467 void setFromFile(const string& directory);
00468
00469 };
00470
00471 }
00472
00473 #endif