casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
StateRow.h
Go to the documentation of this file.
00001 
00002 /*
00003  * ALMA - Atacama Large Millimeter Array
00004  * (c) European Southern Observatory, 2002
00005  * (c) Associated Universities Inc., 2002
00006  * Copyright by ESO (in the framework of the ALMA collaboration),
00007  * Copyright by AUI (in the framework of the ALMA collaboration),
00008  * All rights reserved.
00009  * 
00010  * This library is free software; you can redistribute it and/or
00011  * modify it under the terms of the GNU Lesser General Public
00012  * License as published by the Free software Foundation; either
00013  * version 2.1 of the License, or (at your option) any later version.
00014  * 
00015  * This library is distributed in the hope that it will be useful,
00016  * but WITHOUT ANY WARRANTY, without even the implied warranty of
00017  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00018  * Lesser General Public License for more details.
00019  * 
00020  * You should have received a copy of the GNU Lesser General Public
00021  * License along with this library; if not, write to the Free Software
00022  * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
00023  * MA 02111-1307  USA
00024  *
00025  * Warning!
00026  *  -------------------------------------------------------------------- 
00027  * | This is generated code!  Do not modify this file.                  |
00028  * | If you do, all changes will be lost when the file is re-generated. |
00029  *  --------------------------------------------------------------------
00030  *
00031  * File StateRow.h
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 //#include <TableStreamReader.h>
00079 
00080 /*\file State.h
00081     \brief Generated from model's revision "1.61", branch "HEAD"
00082 */
00083 
00084 namespace asdm {
00085 
00086 //class asdm::StateTable;
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 //friend class asdm::TableStreamReader<StateTable, StateRow>;
00104 
00105 public:
00106 
00107         virtual ~StateRow();
00108 
00112         StateTable &getTable() const;
00113         
00118         bool isAdded() const;
00119                 
00121         // Intrinsic Table Attributes //
00123         
00124         
00125         // ===> Attribute stateId
00126         
00127         
00128         
00129 
00130         
00135         Tag getStateId() const;
00136         
00137  
00138         
00139         
00140         
00141         
00142 
00143 
00144         
00145         // ===> Attribute calDeviceName
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         // ===> Attribute sig
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         // ===> Attribute ref
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         // ===> Attribute onSky
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         // ===> Attribute weight, which is optional
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         // Extrinsic Table Attributes //
00308         
00310         // Links //
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 #endif
00367         
00368 #ifndef WITHOUT_ACS
00369 
00374         void setFromIDL (asdmIDL::StateRowIDL x) ;
00375 #endif
00376         
00381         std::string toXML() const;
00382 
00389         void setFromXML (std::string rowDoc) ;
00390 
00393         // binary-deserialization material from an EndianIStream  //
00395 
00396         std::map<std::string, StateAttributeFromBin> fromBinMethods;
00397 void stateIdFromBin( EndianIStream& eis);
00398 void calDeviceNameFromBin( EndianIStream& eis);
00399 void sigFromBin( EndianIStream& eis);
00400 void refFromBin( EndianIStream& eis);
00401 void onSkyFromBin( EndianIStream& eis);
00402 
00403 void weightFromBin( EndianIStream& eis);
00404 
00405 
00413          static StateRow* fromBin(EndianIStream& eis, StateTable& table, const std::vector<std::string>& attributesSeq);         
00415 
00416 private:
00420         StateTable &table;
00424         bool hasBeenAdded;
00425 
00426         // This method is used by the Table class when this row is added to the table.
00427         void isAdded(bool added);
00428 
00429 
00438         StateRow (StateTable &table);
00439 
00457          StateRow (StateTable &table, StateRow &row);
00458                 
00460         // Intrinsic Table Attributes //
00462         
00463         
00464         // ===> Attribute stateId
00465         
00466         
00467 
00468         Tag stateId;
00469 
00470         
00471         
00472         
00482         void setStateId (Tag stateId);
00483                 
00484         
00485 
00486         
00487         // ===> Attribute calDeviceName
00488         
00489         
00490 
00491         CalibrationDeviceMod::CalibrationDevice calDeviceName;
00492 
00493         
00494         
00495         
00496 
00497         
00498         // ===> Attribute sig
00499         
00500         
00501 
00502         bool sig;
00503 
00504         
00505         
00506         
00507 
00508         
00509         // ===> Attribute ref
00510         
00511         
00512 
00513         bool ref;
00514 
00515         
00516         
00517         
00518 
00519         
00520         // ===> Attribute onSky
00521         
00522         
00523 
00524         bool onSky;
00525 
00526         
00527         
00528         
00529 
00530         
00531         // ===> Attribute weight, which is optional
00532         
00533         
00534         bool weightExists;
00535         
00536 
00537         float weight;
00538 
00539         
00540         
00541         
00542 
00544         // Extrinsic Table Attributes //
00546         
00548         // Links //
00550         
00551         
00552 /*
00554         // binary-deserialization material from an EndianIStream  //
00556         std::map<std::string, StateAttributeFromBin> fromBinMethods;
00557 void stateIdFromBin( EndianIStream& eis);
00558 void calDeviceNameFromBin( EndianIStream& eis);
00559 void sigFromBin( EndianIStream& eis);
00560 void refFromBin( EndianIStream& eis);
00561 void onSkyFromBin( EndianIStream& eis);
00562 
00563 void weightFromBin( EndianIStream& eis);
00564 
00565 */
00566         
00568         // text-deserialization material //
00570         std::map<std::string, StateAttributeFromText> fromTextMethods;
00571         
00572 void stateIdFromText (const string & s);
00573         
00574         
00575 void calDeviceNameFromText (const string & s);
00576         
00577         
00578 void sigFromText (const string & s);
00579         
00580         
00581 void refFromText (const string & s);
00582         
00583         
00584 void onSkyFromText (const string & s);
00585         
00586 
00587         
00588 void weightFromText (const string & s);
00589         
00590         
00591         
00592         void fromText(const std::string& attributeName, const std::string&  t);
00593         
00598          void toBin(EndianOSStream& eoss);
00599                  
00609 };
00610 
00611 } // End namespace asdm
00612 
00613 #endif /* State_CLASS */