StationRow.h
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 StationRow_CLASS
00035 #define StationRow_CLASS
00036
00037 #include <vector>
00038 #include <string>
00039 #include <set>
00040
00041 #ifndef WITHOUT_ACS
00042 #include <asdmIDLC.h>
00043 #endif
00044
00045
00046
00047
00048
00049
00050
00051 #include <ArrayTime.h>
00052
00053
00054
00055 #include <Tag.h>
00056
00057
00058
00059 #include <Length.h>
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072 #include "CStationType.h"
00073
00074
00075
00076
00077
00078
00079 #include <ConversionException.h>
00080 #include <NoSuchRow.h>
00081 #include <IllegalAccessException.h>
00082
00083 #include <RowTransformer.h>
00084
00085
00086
00087
00088
00089
00090 namespace asdm {
00091
00092
00093
00094
00095
00096 class StationRow;
00097 typedef void (StationRow::*StationAttributeFromBin) (EndianIStream& eis);
00098 typedef void (StationRow::*StationAttributeFromText) (const string& s);
00099
00106 class StationRow {
00107 friend class asdm::StationTable;
00108 friend class asdm::RowTransformer<StationRow>;
00109
00110
00111 public:
00112
00113 virtual ~StationRow();
00114
00118 StationTable &getTable() const;
00119
00124 bool isAdded() const;
00125
00127
00129
00130
00131
00132
00133
00134
00135
00136
00141 Tag getStationId() const;
00142
00143
00144
00145
00146
00147
00148
00149
00150
00151
00152
00153
00154
00155
00156
00161 string getName() const;
00162
00163
00164
00165
00173 void setName (string name);
00174
00175
00176
00177
00178
00179
00180
00181
00182
00183
00184
00185
00186
00191 vector<Length > getPosition() const;
00192
00193
00194
00195
00203 void setPosition (vector<Length > position);
00204
00205
00206
00207
00208
00209
00210
00211
00212
00213
00214
00215
00216
00221 StationTypeMod::StationType getType() const;
00222
00223
00224
00225
00233 void setType (StationTypeMod::StationType type);
00234
00235
00236
00237
00238
00239
00240
00241
00242
00243
00244
00249 bool isTimeExists() const;
00250
00251
00252
00258 ArrayTime getTime() const;
00259
00260
00261
00262
00269 void setTime (ArrayTime time);
00270
00271
00272
00273
00277 void clearTime ();
00278
00279
00280
00282
00284
00286
00288
00289
00290
00291
00303 bool compareNoAutoInc(string name, vector<Length > position, StationTypeMod::StationType type);
00304
00305
00306
00307
00319 bool compareRequiredValue(string name, vector<Length > position, StationTypeMod::StationType type);
00320
00321
00330 bool equalByRequiredValue(StationRow* x) ;
00331
00332 #ifndef WITHOUT_ACS
00333
00337 asdmIDL::StationRowIDL *toIDL() const;
00338
00346 void toIDL(asdmIDL::StationRowIDL& x) const;
00347 #endif
00348
00349 #ifndef WITHOUT_ACS
00350
00355 void setFromIDL (asdmIDL::StationRowIDL x) ;
00356 #endif
00357
00362 std::string toXML() const;
00363
00370 void setFromXML (std::string rowDoc) ;
00371
00374
00376
00377 std::map<std::string, StationAttributeFromBin> fromBinMethods;
00378 void stationIdFromBin( EndianIStream& eis);
00379 void nameFromBin( EndianIStream& eis);
00380 void positionFromBin( EndianIStream& eis);
00381 void typeFromBin( EndianIStream& eis);
00382
00383 void timeFromBin( EndianIStream& eis);
00384
00385
00393 static StationRow* fromBin(EndianIStream& eis, StationTable& table, const std::vector<std::string>& attributesSeq);
00394
00401 void fromText(const std::string& attributeName, const std::string& t);
00403
00404 private:
00408 StationTable &table;
00412 bool hasBeenAdded;
00413
00414
00415 void isAdded(bool added);
00416
00417
00426 StationRow (StationTable &table);
00427
00445 StationRow (StationTable &table, StationRow &row);
00446
00448
00450
00451
00452
00453
00454
00455
00456 Tag stationId;
00457
00458
00459
00460
00470 void setStationId (Tag stationId);
00471
00472
00473
00474
00475
00476
00477
00478
00479 string name;
00480
00481
00482
00483
00484
00485
00486
00487
00488
00489
00490 vector<Length > position;
00491
00492
00493
00494
00495
00496
00497
00498
00499
00500
00501 StationTypeMod::StationType type;
00502
00503
00504
00505
00506
00507
00508
00509
00510
00511 bool timeExists;
00512
00513
00514 ArrayTime time;
00515
00516
00517
00518
00519
00521
00523
00525
00527
00528
00529
00531
00533
00534
00535
00536
00537
00538
00539
00540
00541
00542
00544
00546 std::map<std::string, StationAttributeFromText> fromTextMethods;
00547
00548 void stationIdFromText (const string & s);
00549
00550
00551 void nameFromText (const string & s);
00552
00553
00554 void positionFromText (const string & s);
00555
00556
00557 void typeFromText (const string & s);
00558
00559
00560
00561 void timeFromText (const string & s);
00562
00563
00564
00569 void toBin(EndianOSStream& eoss);
00570
00580 };
00581
00582 }
00583
00584 #endif