casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
StateRow.h
Go to the documentation of this file.
1 
2 /*
3  * ALMA - Atacama Large Millimeter Array
4  * (c) European Southern Observatory, 2002
5  * (c) Associated Universities Inc., 2002
6  * Copyright by ESO (in the framework of the ALMA collaboration),
7  * Copyright by AUI (in the framework of the ALMA collaboration),
8  * All rights reserved.
9  *
10  * This library is free software; you can redistribute it and/or
11  * modify it under the terms of the GNU Lesser General Public
12  * License as published by the Free software Foundation; either
13  * version 2.1 of the License, or (at your option) any later version.
14  *
15  * This library is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY, without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18  * Lesser General Public License for more details.
19  *
20  * You should have received a copy of the GNU Lesser General Public
21  * License along with this library; if not, write to the Free Software
22  * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
23  * MA 02111-1307 USA
24  *
25  * Warning!
26  * --------------------------------------------------------------------
27  * | This is generated code! Do not modify this file. |
28  * | If you do, all changes will be lost when the file is re-generated. |
29  * --------------------------------------------------------------------
30  *
31  * File StateRow.h
32  */
33 
34 #ifndef StateRow_CLASS
35 #define StateRow_CLASS
36 
37 #include <vector>
38 #include <string>
39 #include <set>
40 
41 #ifndef WITHOUT_ACS
42 #include <asdmIDLC.h>
43 #endif
44 
45 
46 
47 
48 
49 
50 
51 #include <alma/ASDM/Tag.h>
52 
53 
54 
55 
56 
57 
58 
59 
61 
62 
63 
64 
65 
66 
67 
68 
69 
70 
71 
72 
74 #include <alma/ASDM/NoSuchRow.h>
76 
78 //#include <alma/ASDM/TableStreamReader.h>
79 
80 /*\file State.h
81  \brief Generated from model's revision "-1", branch ""
82 */
83 
84 namespace asdm {
85 
86 //class asdm::StateTable;
87 
88 
89 
90 class StateRow;
92 typedef void (StateRow::*StateAttributeFromText) (const std::string& s);
93 
100 class StateRow {
101 friend class asdm::StateTable;
103 //friend class asdm::TableStreamReader<StateTable, StateRow>;
104 
105 public:
106 
107  virtual ~StateRow();
108 
112  StateTable &getTable() const;
113 
118  bool isAdded() const;
119 
121  // Intrinsic Table Attributes //
123 
124 
125  // ===> Attribute stateId
126 
127 
128 
129 
130 
135  Tag getStateId() const;
136 
137 
138 
139 
140 
141 
142 
143 
144 
145  // ===> Attribute calDeviceName
146 
147 
148 
149 
150 
155  CalibrationDeviceMod::CalibrationDevice getCalDeviceName() const;
156 
157 
158 
159 
167  void setCalDeviceName (CalibrationDeviceMod::CalibrationDevice calDeviceName);
168 
169 
170 
171 
172 
173 
174 
175  // ===> Attribute sig
176 
177 
178 
179 
180 
185  bool getSig() const;
186 
187 
188 
189 
197  void setSig (bool sig);
198 
199 
200 
201 
202 
203 
204 
205  // ===> Attribute ref
206 
207 
208 
209 
210 
215  bool getRef() const;
216 
217 
218 
219 
227  void setRef (bool ref);
228 
229 
230 
231 
232 
233 
234 
235  // ===> Attribute onSky
236 
237 
238 
239 
240 
245  bool getOnSky() const;
246 
247 
248 
249 
257  void setOnSky (bool onSky);
258 
259 
260 
261 
262 
263 
264 
265  // ===> Attribute weight, which is optional
266 
267 
268 
273  bool isWeightExists() const;
274 
275 
276 
282  float getWeight() const;
283 
284 
285 
286 
293  void setWeight (float weight);
294 
295 
296 
297 
301  void clearWeight ();
302 
303 
304 
306  // Extrinsic Table Attributes //
308 
310  // Links //
312 
313 
314 
315 
329  bool compareNoAutoInc(CalibrationDeviceMod::CalibrationDevice calDeviceName, bool sig, bool ref, bool onSky);
330 
331 
332 
333 
347  bool compareRequiredValue(CalibrationDeviceMod::CalibrationDevice calDeviceName, bool sig, bool ref, bool onSky);
348 
349 
358  bool equalByRequiredValue(StateRow* x) ;
359 
360 #ifndef WITHOUT_ACS
361 
365  asdmIDL::StateRowIDL *toIDL() const;
366 
374  void toIDL(asdmIDL::StateRowIDL& x) const;
375 #endif
376 
377 #ifndef WITHOUT_ACS
378 
383  void setFromIDL (asdmIDL::StateRowIDL x) ;
384 #endif
385 
390  std::string toXML() const;
391 
398  void setFromXML (std::string rowDoc) ;
399 
402  // binary-deserialization material from an EndianIStream //
404 
405  std::map<std::string, StateAttributeFromBin> fromBinMethods;
406 void stateIdFromBin( EndianIStream& eis);
408 void sigFromBin( EndianIStream& eis);
409 void refFromBin( EndianIStream& eis);
410 void onSkyFromBin( EndianIStream& eis);
411 
412 void weightFromBin( EndianIStream& eis);
413 
414 
422  static StateRow* fromBin(EndianIStream& eis, StateTable& table, const std::vector<std::string>& attributesSeq);
423 
430  void fromText(const std::string& attributeName, const std::string& t);
432 
433 private:
442 
443  // This method is used by the Table class when this row is added to the table.
444  void isAdded(bool added);
445 
446 
456 
475 
477  // Intrinsic Table Attributes //
479 
480 
481  // ===> Attribute stateId
482 
483 
484 
485  Tag stateId;
486 
487 
488 
489 
499  void setStateId (Tag stateId);
500 
501 
502 
503 
504  // ===> Attribute calDeviceName
505 
506 
507 
508  CalibrationDeviceMod::CalibrationDevice calDeviceName;
509 
510 
511 
512 
513 
514 
515  // ===> Attribute sig
516 
517 
518 
519  bool sig;
520 
521 
522 
523 
524 
525 
526  // ===> Attribute ref
527 
528 
529 
530  bool ref;
531 
532 
533 
534 
535 
536 
537  // ===> Attribute onSky
538 
539 
540 
541  bool onSky;
542 
543 
544 
545 
546 
547 
548  // ===> Attribute weight, which is optional
549 
550 
552 
553 
554  float weight;
555 
556 
557 
558 
559 
561  // Extrinsic Table Attributes //
563 
565  // Links //
567 
568 
569 /*
571  // binary-deserialization material from an EndianIStream //
573  std::map<std::string, StateAttributeFromBin> fromBinMethods;
574 void stateIdFromBin( EndianIStream& eis);
575 void calDeviceNameFromBin( EndianIStream& eis);
576 void sigFromBin( EndianIStream& eis);
577 void refFromBin( EndianIStream& eis);
578 void onSkyFromBin( EndianIStream& eis);
579 
580 void weightFromBin( EndianIStream& eis);
581 
582 */
583 
585  // text-deserialization material //
587  std::map<std::string, StateAttributeFromText> fromTextMethods;
588 
589 void stateIdFromText (const std::string & s);
590 
591 
592 void calDeviceNameFromText (const std::string & s);
593 
594 
595 void sigFromText (const std::string & s);
596 
597 
598 void refFromText (const std::string & s);
599 
600 
601 void onSkyFromText (const std::string & s);
602 
603 
604 
605 void weightFromText (const std::string & s);
606 
607 
608 
613  void toBin(EndianOSStream& eoss);
614 
624 };
625 
626 } // End namespace asdm
627 
628 #endif /* State_CLASS */
void stateIdFromText(const std::string &s)
void(StateRow::* StateAttributeFromText)(const std::string &s)
Definition: StateRow.h:92
bool isAdded() const
Has this row been added to its table ?
bool onSky
===&gt; Attribute onSky
Definition: StateRow.h:541
void(StateRow::* StateAttributeFromBin)(EndianIStream &eis)
Definition: StateRow.h:91
void sigFromBin(EndianIStream &eis)
void calDeviceNameFromText(const std::string &s)
bool getSig() const
===&gt; Attribute sig
float weight
Definition: StateRow.h:554
std::string toXML() const
Return this row in the form of an XML string.
void setWeight(float weight)
Set weight with the specified float.
void setFromXML(std::string rowDoc)
Fill the values of this row from an XML string that was produced by the toXML() method.
asdmIDL::StateRowIDL * toIDL() const
Return this row in the form of an IDL struct.
void weightFromText(const std::string &s)
bool weightExists
===&gt; Attribute weight, which is optional
Definition: StateRow.h:551
CalibrationDeviceMod::CalibrationDevice getCalDeviceName() const
===&gt; Attribute calDeviceName
The StateRow class is a row of a StateTable.
Definition: StateRow.h:100
Extrinsic Table Attributes Links *binary deserialization material from an EndianIStream std::map< std::string, StateAttributeFromBin > fromBinMethods
Definition: StateRow.h:573
virtual ~StateRow()
friend class asdm::TableStreamReader&lt;StateTable, StateRow&gt;;
bool compareRequiredValue(CalibrationDeviceMod::CalibrationDevice calDeviceName, bool sig, bool ref, bool onSky)
Compare each mandatory value (i.e.
Extrinsic Table Attributes Links *bool compareNoAutoInc(CalibrationDeviceMod::CalibrationDevice calDeviceName, bool sig, bool ref, bool onSky)
Compare each mandatory attribute except the autoincrementable one of this StateRow with the correspon...
void onSkyFromText(const std::string &s)
void setSig(bool sig)
Set sig with the specified bool.
bool sig
===&gt; Attribute sig
Definition: StateRow.h:519
void onSkyFromBin(EndianIStream &eis)
void setStateId(Tag stateId)
Set stateId with the specified Tag value.
The StateTable class is an Alma table.
Definition: StateTable.h:159
void setOnSky(bool onSky)
Set onSky with the specified bool.
void setCalDeviceName(CalibrationDeviceMod::CalibrationDevice calDeviceName)
Set calDeviceName with the specified CalibrationDeviceMod::CalibrationDevice.
void toBin(EndianOSStream &eoss)
Serialize this into a stream of bytes written to an EndianOSStream.
bool getRef() const
===&gt; Attribute ref
bool equalByRequiredValue(StateRow *x)
Return true if all required attributes of the value part are equal to their homologues in x and false...
float getWeight() const
Get weight, which is optional.
CalibrationDeviceMod::CalibrationDevice calDeviceName
===&gt; Attribute calDeviceName
Definition: StateRow.h:508
void setRef(bool ref)
Set ref with the specified bool.
void stateIdFromBin(EndianIStream &eis)
void sigFromText(const std::string &s)
bool getOnSky() const
===&gt; Attribute onSky
bool isWeightExists() const
===&gt; Attribute weight, which is optional
bool ref
===&gt; Attribute ref
Definition: StateRow.h:530
void refFromBin(EndianIStream &eis)
The Tag class is an implementation of a unique index identifying a row of an ASDM table...
Definition: Tag.h:73
StateTable & table
The table to which this row belongs.
Definition: StateRow.h:437
void weightFromBin(EndianIStream &eis)
void calDeviceNameFromBin(EndianIStream &eis)
*text deserialization material std::map< std::string, StateAttributeFromText > fromTextMethods
Definition: StateRow.h:587
void setFromIDL(asdmIDL::StateRowIDL x)
Fill the values of this row from the IDL struct StateRowIDL.
void clearWeight()
Mark weight, which is an optional field, as non-existent.
bool hasBeenAdded
Whether this row has been added to the table or not.
Definition: StateRow.h:441
StateRow(StateTable &table)
Create a StateRow.
StateTable & getTable() const
Return the table to which this row belongs.
void refFromText(const std::string &s)