casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
StationRow.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 StationRow.h
32  */
33 
34 #ifndef StationRow_CLASS
35 #define StationRow_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/Length.h>
52 
53 
54 
55 #include <alma/ASDM/ArrayTime.h>
56 
57 
58 
59 #include <alma/ASDM/Tag.h>
60 
61 
62 
63 
64 
65 
66 
67 
68 
69 
70 
71 
73 
74 
75 
76 
77 
78 
80 #include <alma/ASDM/NoSuchRow.h>
82 
84 //#include <alma/ASDM/TableStreamReader.h>
85 
86 /*\file Station.h
87  \brief Generated from model's revision "-1", branch ""
88 */
89 
90 namespace asdm {
91 
92 //class asdm::StationTable;
93 
94 
95 
96 class StationRow;
98 typedef void (StationRow::*StationAttributeFromText) (const std::string& s);
99 
106 class StationRow {
107 friend class asdm::StationTable;
109 //friend class asdm::TableStreamReader<StationTable, StationRow>;
110 
111 public:
112 
113  virtual ~StationRow();
114 
118  StationTable &getTable() const;
119 
124  bool isAdded() const;
125 
127  // Intrinsic Table Attributes //
129 
130 
131  // ===> Attribute stationId
132 
133 
134 
135 
136 
141  Tag getStationId() const;
142 
143 
144 
145 
146 
147 
148 
149 
150 
151  // ===> Attribute name
152 
153 
154 
155 
156 
161  std::string getName() const;
162 
163 
164 
165 
173  void setName (std::string name);
174 
175 
176 
177 
178 
179 
180 
181  // ===> Attribute position
182 
183 
184 
185 
186 
191  std::vector<Length > getPosition() const;
192 
193 
194 
195 
203  void setPosition (std::vector<Length > position);
204 
205 
206 
207 
208 
209 
210 
211  // ===> Attribute type
212 
213 
214 
215 
216 
221  StationTypeMod::StationType getType() const;
222 
223 
224 
225 
233  void setType (StationTypeMod::StationType type);
234 
235 
236 
237 
238 
239 
240 
241  // ===> Attribute time, which is optional
242 
243 
244 
249  bool isTimeExists() const;
250 
251 
252 
258  ArrayTime getTime() const;
259 
260 
261 
262 
269  void setTime (ArrayTime time);
270 
271 
272 
273 
277  void clearTime ();
278 
279 
280 
282  // Extrinsic Table Attributes //
284 
286  // Links //
288 
289 
290 
291 
303  bool compareNoAutoInc(std::string name, std::vector<Length > position, StationTypeMod::StationType type);
304 
305 
306 
307 
319  bool compareRequiredValue(std::string name, std::vector<Length > position, StationTypeMod::StationType type);
320 
321 
331 
332 #ifndef WITHOUT_ACS
333 
337  asdmIDL::StationRowIDL *toIDL() const;
338 
346  void toIDL(asdmIDL::StationRowIDL& x) const;
347 #endif
348 
349 #ifndef WITHOUT_ACS
350 
355  void setFromIDL (asdmIDL::StationRowIDL x) ;
356 #endif
357 
362  std::string toXML() const;
363 
370  void setFromXML (std::string rowDoc) ;
371 
374  // binary-deserialization material from an EndianIStream //
376 
377  std::map<std::string, StationAttributeFromBin> fromBinMethods;
378 void stationIdFromBin( EndianIStream& eis);
379 void nameFromBin( EndianIStream& eis);
380 void positionFromBin( EndianIStream& eis);
381 void typeFromBin( EndianIStream& eis);
382 
383 void timeFromBin( EndianIStream& eis);
384 
385 
393  static StationRow* fromBin(EndianIStream& eis, StationTable& table, const std::vector<std::string>& attributesSeq);
394 
401  void fromText(const std::string& attributeName, const std::string& t);
403 
404 private:
413 
414  // This method is used by the Table class when this row is added to the table.
415  void isAdded(bool added);
416 
417 
427 
446 
448  // Intrinsic Table Attributes //
450 
451 
452  // ===> Attribute stationId
453 
454 
455 
456  Tag stationId;
457 
458 
459 
460 
470  void setStationId (Tag stationId);
471 
472 
473 
474 
475  // ===> Attribute name
476 
477 
478 
479  std::string name;
480 
481 
482 
483 
484 
485 
486  // ===> Attribute position
487 
488 
489 
490  std::vector<Length > position;
491 
492 
493 
494 
495 
496 
497  // ===> Attribute type
498 
499 
500 
501  StationTypeMod::StationType type;
502 
503 
504 
505 
506 
507 
508  // ===> Attribute time, which is optional
509 
510 
512 
513 
515 
516 
517 
518 
519 
521  // Extrinsic Table Attributes //
523 
525  // Links //
527 
528 
529 /*
531  // binary-deserialization material from an EndianIStream //
533  std::map<std::string, StationAttributeFromBin> fromBinMethods;
534 void stationIdFromBin( EndianIStream& eis);
535 void nameFromBin( EndianIStream& eis);
536 void positionFromBin( EndianIStream& eis);
537 void typeFromBin( EndianIStream& eis);
538 
539 void timeFromBin( EndianIStream& eis);
540 
541 */
542 
544  // text-deserialization material //
546  std::map<std::string, StationAttributeFromText> fromTextMethods;
547 
548 void stationIdFromText (const std::string & s);
549 
550 
551 void nameFromText (const std::string & s);
552 
553 
554 void positionFromText (const std::string & s);
555 
556 
557 void typeFromText (const std::string & s);
558 
559 
560 
561 void timeFromText (const std::string & s);
562 
563 
564 
569  void toBin(EndianOSStream& eoss);
570 
580 };
581 
582 } // End namespace asdm
583 
584 #endif /* Station_CLASS */
std::vector< Length > position
===&gt; Attribute position
Definition: StationRow.h:490
bool timeExists
===&gt; Attribute time, which is optional
Definition: StationRow.h:511
bool hasBeenAdded
Whether this row has been added to the table or not.
Definition: StationRow.h:412
bool isAdded() const
Has this row been added to its table ?
ArrayTime getTime() const
Get time, which is optional.
void(StationRow::* StationAttributeFromBin)(EndianIStream &eis)
Definition: StationRow.h:97
void setName(std::string name)
Set name with the specified std::string.
StationTypeMod::StationType type
===&gt; Attribute type
Definition: StationRow.h:501
void(StationRow::* StationAttributeFromText)(const std::string &s)
Definition: StationRow.h:98
asdmIDL::StationRowIDL * toIDL() const
Return this row in the form of an IDL struct.
void setFromXML(std::string rowDoc)
Fill the values of this row from an XML string that was produced by the toXML() method.
void nameFromText(const std::string &s)
ArrayTime time
Definition: StationRow.h:514
StationTypeMod::StationType getType() const
===&gt; Attribute type
void timeFromText(const std::string &s)
void nameFromBin(EndianIStream &eis)
void positionFromText(const std::string &s)
Extrinsic Table Attributes Links *binary deserialization material from an EndianIStream std::map< std::string, StationAttributeFromBin > fromBinMethods
Definition: StationRow.h:533
std::string toXML() const
Return this row in the form of an XML string.
void positionFromBin(EndianIStream &eis)
The StationTable class is an Alma table.
Definition: StationTable.h:158
std::string name
===&gt; Attribute name
Definition: StationRow.h:479
std::vector< Length > getPosition() const
===&gt; Attribute position
void toBin(EndianOSStream &eoss)
Serialize this into a stream of bytes written to an EndianOSStream.
bool equalByRequiredValue(StationRow *x)
Return true if all required attributes of the value part are equal to their homologues in x and false...
void typeFromText(const std::string &s)
Extrinsic Table Attributes Links *bool compareNoAutoInc(std::string name, std::vector< Length > position, StationTypeMod::StationType type)
Compare each mandatory attribute except the autoincrementable one of this StationRow with the corresp...
The ArrayTime class implements the concept of a point in time, implemented as an Interval of time sin...
Definition: ArrayTime.h:89
void setTime(ArrayTime time)
Set time with the specified ArrayTime.
void setPosition(std::vector< Length > position)
Set position with the specified std::vector&lt;Length &gt;.
The Tag class is an implementation of a unique index identifying a row of an ASDM table...
Definition: Tag.h:73
void timeFromBin(EndianIStream &eis)
void setStationId(Tag stationId)
Set stationId with the specified Tag value.
void typeFromBin(EndianIStream &eis)
void stationIdFromText(const std::string &s)
StationTable & table
The table to which this row belongs.
Definition: StationRow.h:408
void stationIdFromBin(EndianIStream &eis)
bool compareRequiredValue(std::string name, std::vector< Length > position, StationTypeMod::StationType type)
Compare each mandatory value (i.e.
bool isTimeExists() const
===&gt; Attribute time, which is optional
void setType(StationTypeMod::StationType type)
Set type with the specified StationTypeMod::StationType.
void clearTime()
Mark time, which is an optional field, as non-existent.
std::string getName() const
===&gt; Attribute name
The StationRow class is a row of a StationTable.
Definition: StationRow.h:106
StationTable & getTable() const
Return the table to which this row belongs.
void setFromIDL(asdmIDL::StationRowIDL x)
Fill the values of this row from the IDL struct StationRowIDL.
*text deserialization material std::map< std::string, StationAttributeFromText > fromTextMethods
Definition: StationRow.h:546
virtual ~StationRow()
friend class asdm::TableStreamReader&lt;StationTable, StationRow&gt;;
StationRow(StationTable &table)
Create a StationRow.