casa  $Rev:20696$
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.62", 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);         
00414  
00421          void fromText(const std::string& attributeName, const std::string&  t);
00423 
00424 private:
00428         StateTable &table;
00432         bool hasBeenAdded;
00433 
00434         // This method is used by the Table class when this row is added to the table.
00435         void isAdded(bool added);
00436 
00437 
00446         StateRow (StateTable &table);
00447 
00465          StateRow (StateTable &table, StateRow &row);
00466                 
00468         // Intrinsic Table Attributes //
00470         
00471         
00472         // ===> Attribute stateId
00473         
00474         
00475 
00476         Tag stateId;
00477 
00478         
00479         
00480         
00490         void setStateId (Tag stateId);
00491                 
00492         
00493 
00494         
00495         // ===> Attribute calDeviceName
00496         
00497         
00498 
00499         CalibrationDeviceMod::CalibrationDevice calDeviceName;
00500 
00501         
00502         
00503         
00504 
00505         
00506         // ===> Attribute sig
00507         
00508         
00509 
00510         bool sig;
00511 
00512         
00513         
00514         
00515 
00516         
00517         // ===> Attribute ref
00518         
00519         
00520 
00521         bool ref;
00522 
00523         
00524         
00525         
00526 
00527         
00528         // ===> Attribute onSky
00529         
00530         
00531 
00532         bool onSky;
00533 
00534         
00535         
00536         
00537 
00538         
00539         // ===> Attribute weight, which is optional
00540         
00541         
00542         bool weightExists;
00543         
00544 
00545         float weight;
00546 
00547         
00548         
00549         
00550 
00552         // Extrinsic Table Attributes //
00554         
00556         // Links //
00558         
00559         
00560 /*
00562         // binary-deserialization material from an EndianIStream  //
00564         std::map<std::string, StateAttributeFromBin> fromBinMethods;
00565 void stateIdFromBin( EndianIStream& eis);
00566 void calDeviceNameFromBin( EndianIStream& eis);
00567 void sigFromBin( EndianIStream& eis);
00568 void refFromBin( EndianIStream& eis);
00569 void onSkyFromBin( EndianIStream& eis);
00570 
00571 void weightFromBin( EndianIStream& eis);
00572 
00573 */
00574         
00576         // text-deserialization material //
00578         std::map<std::string, StateAttributeFromText> fromTextMethods;
00579         
00580 void stateIdFromText (const string & s);
00581         
00582         
00583 void calDeviceNameFromText (const string & s);
00584         
00585         
00586 void sigFromText (const string & s);
00587         
00588         
00589 void refFromText (const string & s);
00590         
00591         
00592 void onSkyFromText (const string & s);
00593         
00594 
00595         
00596 void weightFromText (const string & s);
00597         
00598         
00599         
00604          void toBin(EndianOSStream& eoss);
00605                  
00615 };
00616 
00617 } // End namespace asdm
00618 
00619 #endif /* State_CLASS */
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines