StateRow.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 StateRow_CLASS
00035 #define StateRow_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 <Tag.h>
00052
00053
00054
00055
00056
00057
00058
00059
00060 #include "CCalibrationDevice.h"
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073 #include <ConversionException.h>
00074 #include <NoSuchRow.h>
00075 #include <IllegalAccessException.h>
00076
00077 #include <RowTransformer.h>
00078
00079
00080
00081
00082
00083
00084 namespace asdm {
00085
00086
00087
00088
00089
00090 class StateRow;
00091 typedef void (StateRow::*StateAttributeFromBin) (EndianIStream& eis);
00092 typedef void (StateRow::*StateAttributeFromText) (const string& s);
00093
00100 class StateRow {
00101 friend class asdm::StateTable;
00102 friend class asdm::RowTransformer<StateRow>;
00103
00104
00105 public:
00106
00107 virtual ~StateRow();
00108
00112 StateTable &getTable() const;
00113
00118 bool isAdded() const;
00119
00121
00123
00124
00125
00126
00127
00128
00129
00130
00135 Tag getStateId() const;
00136
00137
00138
00139
00140
00141
00142
00143
00144
00145
00146
00147
00148
00149
00150
00155 CalibrationDeviceMod::CalibrationDevice getCalDeviceName() const;
00156
00157
00158
00159
00167 void setCalDeviceName (CalibrationDeviceMod::CalibrationDevice calDeviceName);
00168
00169
00170
00171
00172
00173
00174
00175
00176
00177
00178
00179
00180
00185 bool getSig() const;
00186
00187
00188
00189
00197 void setSig (bool sig);
00198
00199
00200
00201
00202
00203
00204
00205
00206
00207
00208
00209
00210
00215 bool getRef() const;
00216
00217
00218
00219
00227 void setRef (bool ref);
00228
00229
00230
00231
00232
00233
00234
00235
00236
00237
00238
00239
00240
00245 bool getOnSky() const;
00246
00247
00248
00249
00257 void setOnSky (bool onSky);
00258
00259
00260
00261
00262
00263
00264
00265
00266
00267
00268
00273 bool isWeightExists() const;
00274
00275
00276
00282 float getWeight() const;
00283
00284
00285
00286
00293 void setWeight (float weight);
00294
00295
00296
00297
00301 void clearWeight ();
00302
00303
00304
00306
00308
00310
00312
00313
00314
00315
00329 bool compareNoAutoInc(CalibrationDeviceMod::CalibrationDevice calDeviceName, bool sig, bool ref, bool onSky);
00330
00331
00332
00333
00347 bool compareRequiredValue(CalibrationDeviceMod::CalibrationDevice calDeviceName, bool sig, bool ref, bool onSky);
00348
00349
00358 bool equalByRequiredValue(StateRow* x) ;
00359
00360 #ifndef WITHOUT_ACS
00361
00365 asdmIDL::StateRowIDL *toIDL() const;
00366
00374 void toIDL(asdmIDL::StateRowIDL& x) const;
00375 #endif
00376
00377 #ifndef WITHOUT_ACS
00378
00383 void setFromIDL (asdmIDL::StateRowIDL x) ;
00384 #endif
00385
00390 std::string toXML() const;
00391
00398 void setFromXML (std::string rowDoc) ;
00399
00402
00404
00405 std::map<std::string, StateAttributeFromBin> fromBinMethods;
00406 void stateIdFromBin( EndianIStream& eis);
00407 void calDeviceNameFromBin( EndianIStream& eis);
00408 void sigFromBin( EndianIStream& eis);
00409 void refFromBin( EndianIStream& eis);
00410 void onSkyFromBin( EndianIStream& eis);
00411
00412 void weightFromBin( EndianIStream& eis);
00413
00414
00422 static StateRow* fromBin(EndianIStream& eis, StateTable& table, const std::vector<std::string>& attributesSeq);
00423
00430 void fromText(const std::string& attributeName, const std::string& t);
00432
00433 private:
00437 StateTable &table;
00441 bool hasBeenAdded;
00442
00443
00444 void isAdded(bool added);
00445
00446
00455 StateRow (StateTable &table);
00456
00474 StateRow (StateTable &table, StateRow &row);
00475
00477
00479
00480
00481
00482
00483
00484
00485 Tag stateId;
00486
00487
00488
00489
00499 void setStateId (Tag stateId);
00500
00501
00502
00503
00504
00505
00506
00507
00508 CalibrationDeviceMod::CalibrationDevice calDeviceName;
00509
00510
00511
00512
00513
00514
00515
00516
00517
00518
00519 bool sig;
00520
00521
00522
00523
00524
00525
00526
00527
00528
00529
00530 bool ref;
00531
00532
00533
00534
00535
00536
00537
00538
00539
00540
00541 bool onSky;
00542
00543
00544
00545
00546
00547
00548
00549
00550
00551 bool weightExists;
00552
00553
00554 float weight;
00555
00556
00557
00558
00559
00561
00563
00565
00567
00568
00569
00571
00573
00574
00575
00576
00577
00578
00579
00580
00581
00582
00583
00585
00587 std::map<std::string, StateAttributeFromText> fromTextMethods;
00588
00589 void stateIdFromText (const string & s);
00590
00591
00592 void calDeviceNameFromText (const string & s);
00593
00594
00595 void sigFromText (const string & s);
00596
00597
00598 void refFromText (const string & s);
00599
00600
00601 void onSkyFromText (const string & s);
00602
00603
00604
00605 void weightFromText (const string & s);
00606
00607
00608
00613 void toBin(EndianOSStream& eoss);
00614
00624 };
00625
00626 }
00627
00628 #endif