casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
FlagRow.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 FlagRow.h
00032  */
00033  
00034 #ifndef FlagRow_CLASS
00035 #define FlagRow_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 <ArrayTime.h>
00052         
00053 
00054          
00055 #include <Tag.h>
00056         
00057 
00058 
00059 
00060 
00061         
00062 
00063         
00064 
00065         
00066 
00067         
00068 
00069         
00070 
00071         
00072 
00073         
00074 
00075         
00076 
00077         
00078 #include "CPolarizationType.h"
00079         
00080 
00081 
00082 
00083 #include <ConversionException.h>
00084 #include <NoSuchRow.h>
00085 #include <IllegalAccessException.h>
00086 
00087 #include <RowTransformer.h>
00088 //#include <TableStreamReader.h>
00089 
00090 /*\file Flag.h
00091     \brief Generated from model's revision "1.61", branch "HEAD"
00092 */
00093 
00094 namespace asdm {
00095 
00096 //class asdm::FlagTable;
00097 
00098 
00099 // class asdm::AntennaRow;
00100 class AntennaRow;
00101 
00102 // class asdm::AntennaRow;
00103 class AntennaRow;
00104 
00105 // class asdm::SpectralWindowRow;
00106 class SpectralWindowRow;
00107         
00108 
00109 class FlagRow;
00110 typedef void (FlagRow::*FlagAttributeFromBin) (EndianIStream& eis);
00111 typedef void (FlagRow::*FlagAttributeFromText) (const string& s);
00112 
00119 class FlagRow {
00120 friend class asdm::FlagTable;
00121 friend class asdm::RowTransformer<FlagRow>;
00122 //friend class asdm::TableStreamReader<FlagTable, FlagRow>;
00123 
00124 public:
00125 
00126         virtual ~FlagRow();
00127 
00131         FlagTable &getTable() const;
00132         
00137         bool isAdded() const;
00138                 
00140         // Intrinsic Table Attributes //
00142         
00143         
00144         // ===> Attribute flagId
00145         
00146         
00147         
00148 
00149         
00154         Tag getFlagId() const;
00155         
00156  
00157         
00158         
00159         
00160         
00161 
00162 
00163         
00164         // ===> Attribute startTime
00165         
00166         
00167         
00168 
00169         
00174         ArrayTime getStartTime() const;
00175         
00176  
00177         
00178         
00186         void setStartTime (ArrayTime startTime);
00187                 
00188         
00189         
00190         
00191 
00192 
00193         
00194         // ===> Attribute endTime
00195         
00196         
00197         
00198 
00199         
00204         ArrayTime getEndTime() const;
00205         
00206  
00207         
00208         
00216         void setEndTime (ArrayTime endTime);
00217                 
00218         
00219         
00220         
00221 
00222 
00223         
00224         // ===> Attribute reason
00225         
00226         
00227         
00228 
00229         
00234         string getReason() const;
00235         
00236  
00237         
00238         
00246         void setReason (string reason);
00247                 
00248         
00249         
00250         
00251 
00252 
00253         
00254         // ===> Attribute numAntenna
00255         
00256         
00257         
00258 
00259         
00264         int getNumAntenna() const;
00265         
00266  
00267         
00268         
00276         void setNumAntenna (int numAntenna);
00277                 
00278         
00279         
00280         
00281 
00282 
00283         
00284         // ===> Attribute numPolarizationType, which is optional
00285         
00286         
00287         
00292         bool isNumPolarizationTypeExists() const;
00293         
00294 
00295         
00301         int getNumPolarizationType() const;
00302         
00303  
00304         
00305         
00312         void setNumPolarizationType (int numPolarizationType);
00313                 
00314         
00315         
00316         
00320         void clearNumPolarizationType ();
00321         
00322 
00323 
00324         
00325         // ===> Attribute numSpectralWindow, which is optional
00326         
00327         
00328         
00333         bool isNumSpectralWindowExists() const;
00334         
00335 
00336         
00342         int getNumSpectralWindow() const;
00343         
00344  
00345         
00346         
00353         void setNumSpectralWindow (int numSpectralWindow);
00354                 
00355         
00356         
00357         
00361         void clearNumSpectralWindow ();
00362         
00363 
00364 
00365         
00366         // ===> Attribute numPairedAntenna, which is optional
00367         
00368         
00369         
00374         bool isNumPairedAntennaExists() const;
00375         
00376 
00377         
00383         int getNumPairedAntenna() const;
00384         
00385  
00386         
00387         
00394         void setNumPairedAntenna (int numPairedAntenna);
00395                 
00396         
00397         
00398         
00402         void clearNumPairedAntenna ();
00403         
00404 
00405 
00406         
00407         // ===> Attribute polarizationType, which is optional
00408         
00409         
00410         
00415         bool isPolarizationTypeExists() const;
00416         
00417 
00418         
00424         vector<PolarizationTypeMod::PolarizationType > getPolarizationType() const;
00425         
00426  
00427         
00428         
00435         void setPolarizationType (vector<PolarizationTypeMod::PolarizationType > polarizationType);
00436                 
00437         
00438         
00439         
00443         void clearPolarizationType ();
00444         
00445 
00446 
00448         // Extrinsic Table Attributes //
00450         
00451         
00452         // ===> Attribute antennaId
00453         
00454         
00455         
00456 
00457         
00462         vector<Tag>  getAntennaId() const;
00463         
00464  
00465         
00466         
00474         void setAntennaId (vector<Tag>  antennaId);
00475                 
00476         
00477         
00478         
00479 
00480 
00481         
00482         // ===> Attribute pairedAntennaId, which is optional
00483         
00484         
00485         
00490         bool isPairedAntennaIdExists() const;
00491         
00492 
00493         
00499         vector<Tag>  getPairedAntennaId() const;
00500         
00501  
00502         
00503         
00510         void setPairedAntennaId (vector<Tag>  pairedAntennaId);
00511                 
00512         
00513         
00514         
00518         void clearPairedAntennaId ();
00519         
00520 
00521 
00522         
00523         // ===> Attribute spectralWindowId, which is optional
00524         
00525         
00526         
00531         bool isSpectralWindowIdExists() const;
00532         
00533 
00534         
00540         vector<Tag>  getSpectralWindowId() const;
00541         
00542  
00543         
00544         
00551         void setSpectralWindowId (vector<Tag>  spectralWindowId);
00552                 
00553         
00554         
00555         
00559         void clearSpectralWindowId ();
00560         
00561 
00562 
00564         // Links //
00566         
00567         
00568                 
00576         void setAntennaId (int i, Tag antennaId); 
00577                         
00578         
00579 
00580         
00581                  
00586  void addAntennaId(Tag id); 
00587 
00592  void addAntennaId(const vector<Tag> & id); 
00593  
00594 
00600  const Tag getAntennaId(int i);
00601  
00609  AntennaRow* getAntennaUsingAntennaId(int i); 
00610  
00615  vector<AntennaRow *> getAntennasUsingAntennaId(); 
00616   
00617 
00618         
00619 
00620         
00621                 
00628         void setPairedAntennaId (int i, Tag pairedAntennaId)  ;
00629                         
00630         
00631 
00632         
00633                  
00638  void addPairedAntennaId(Tag id); 
00639 
00644  void addPairedAntennaId(const vector<Tag> & id); 
00645  
00646 
00652  const Tag getPairedAntennaId(int i);
00653  
00661  AntennaRow* getAntennaUsingPairedAntennaId(int i); 
00662  
00667  vector<AntennaRow *> getAntennasUsingPairedAntennaId(); 
00668   
00669 
00670         
00671 
00672         
00673                 
00680         void setSpectralWindowId (int i, Tag spectralWindowId)  ;
00681                         
00682         
00683 
00684         
00685                  
00690  void addSpectralWindowId(Tag id); 
00691 
00696  void addSpectralWindowId(const vector<Tag> & id); 
00697  
00698 
00704  const Tag getSpectralWindowId(int i);
00705  
00713  SpectralWindowRow* getSpectralWindowUsingSpectralWindowId(int i); 
00714  
00719  vector<SpectralWindowRow *> getSpectralWindowsUsingSpectralWindowId(); 
00720   
00721 
00722         
00723 
00724         
00725         
00726         
00742         bool compareNoAutoInc(ArrayTime startTime, ArrayTime endTime, string reason, int numAntenna, vector<Tag>  antennaId);
00743         
00744         
00745 
00746         
00762         bool compareRequiredValue(ArrayTime startTime, ArrayTime endTime, string reason, int numAntenna, vector<Tag>  antennaId); 
00763                  
00764         
00773         bool equalByRequiredValue(FlagRow* x) ;
00774         
00775 #ifndef WITHOUT_ACS
00776 
00780         asdmIDL::FlagRowIDL *toIDL() const;
00781 #endif
00782         
00783 #ifndef WITHOUT_ACS
00784 
00789         void setFromIDL (asdmIDL::FlagRowIDL x) ;
00790 #endif
00791         
00796         std::string toXML() const;
00797 
00804         void setFromXML (std::string rowDoc) ;
00805 
00808         // binary-deserialization material from an EndianIStream  //
00810 
00811         std::map<std::string, FlagAttributeFromBin> fromBinMethods;
00812 void flagIdFromBin( EndianIStream& eis);
00813 void startTimeFromBin( EndianIStream& eis);
00814 void endTimeFromBin( EndianIStream& eis);
00815 void reasonFromBin( EndianIStream& eis);
00816 void numAntennaFromBin( EndianIStream& eis);
00817 void antennaIdFromBin( EndianIStream& eis);
00818 
00819 void numPolarizationTypeFromBin( EndianIStream& eis);
00820 void numSpectralWindowFromBin( EndianIStream& eis);
00821 void numPairedAntennaFromBin( EndianIStream& eis);
00822 void polarizationTypeFromBin( EndianIStream& eis);
00823 void pairedAntennaIdFromBin( EndianIStream& eis);
00824 void spectralWindowIdFromBin( EndianIStream& eis);
00825 
00826 
00834          static FlagRow* fromBin(EndianIStream& eis, FlagTable& table, const std::vector<std::string>& attributesSeq);   
00836 
00837 private:
00841         FlagTable &table;
00845         bool hasBeenAdded;
00846 
00847         // This method is used by the Table class when this row is added to the table.
00848         void isAdded(bool added);
00849 
00850 
00859         FlagRow (FlagTable &table);
00860 
00878          FlagRow (FlagTable &table, FlagRow &row);
00879                 
00881         // Intrinsic Table Attributes //
00883         
00884         
00885         // ===> Attribute flagId
00886         
00887         
00888 
00889         Tag flagId;
00890 
00891         
00892         
00893         
00903         void setFlagId (Tag flagId);
00904                 
00905         
00906 
00907         
00908         // ===> Attribute startTime
00909         
00910         
00911 
00912         ArrayTime startTime;
00913 
00914         
00915         
00916         
00917 
00918         
00919         // ===> Attribute endTime
00920         
00921         
00922 
00923         ArrayTime endTime;
00924 
00925         
00926         
00927         
00928 
00929         
00930         // ===> Attribute reason
00931         
00932         
00933 
00934         string reason;
00935 
00936         
00937         
00938         
00939 
00940         
00941         // ===> Attribute numAntenna
00942         
00943         
00944 
00945         int numAntenna;
00946 
00947         
00948         
00949         
00950 
00951         
00952         // ===> Attribute numPolarizationType, which is optional
00953         
00954         
00955         bool numPolarizationTypeExists;
00956         
00957 
00958         int numPolarizationType;
00959 
00960         
00961         
00962         
00963 
00964         
00965         // ===> Attribute numSpectralWindow, which is optional
00966         
00967         
00968         bool numSpectralWindowExists;
00969         
00970 
00971         int numSpectralWindow;
00972 
00973         
00974         
00975         
00976 
00977         
00978         // ===> Attribute numPairedAntenna, which is optional
00979         
00980         
00981         bool numPairedAntennaExists;
00982         
00983 
00984         int numPairedAntenna;
00985 
00986         
00987         
00988         
00989 
00990         
00991         // ===> Attribute polarizationType, which is optional
00992         
00993         
00994         bool polarizationTypeExists;
00995         
00996 
00997         vector<PolarizationTypeMod::PolarizationType > polarizationType;
00998 
00999         
01000         
01001         
01002 
01004         // Extrinsic Table Attributes //
01006         
01007         
01008         // ===> Attribute antennaId
01009         
01010         
01011 
01012         vector<Tag>  antennaId;
01013 
01014         
01015         
01016         
01017 
01018         
01019         // ===> Attribute pairedAntennaId, which is optional
01020         
01021         
01022         bool pairedAntennaIdExists;
01023         
01024 
01025         vector<Tag>  pairedAntennaId;
01026 
01027         
01028         
01029         
01030 
01031         
01032         // ===> Attribute spectralWindowId, which is optional
01033         
01034         
01035         bool spectralWindowIdExists;
01036         
01037 
01038         vector<Tag>  spectralWindowId;
01039 
01040         
01041         
01042         
01043 
01045         // Links //
01047         
01048         
01049                 
01050 
01051 
01052         
01053 
01054         
01055                 
01056 
01057 
01058         
01059 
01060         
01061                 
01062 
01063 
01064         
01065 
01066         
01067 /*
01069         // binary-deserialization material from an EndianIStream  //
01071         std::map<std::string, FlagAttributeFromBin> fromBinMethods;
01072 void flagIdFromBin( EndianIStream& eis);
01073 void startTimeFromBin( EndianIStream& eis);
01074 void endTimeFromBin( EndianIStream& eis);
01075 void reasonFromBin( EndianIStream& eis);
01076 void numAntennaFromBin( EndianIStream& eis);
01077 void antennaIdFromBin( EndianIStream& eis);
01078 
01079 void numPolarizationTypeFromBin( EndianIStream& eis);
01080 void numSpectralWindowFromBin( EndianIStream& eis);
01081 void numPairedAntennaFromBin( EndianIStream& eis);
01082 void polarizationTypeFromBin( EndianIStream& eis);
01083 void pairedAntennaIdFromBin( EndianIStream& eis);
01084 void spectralWindowIdFromBin( EndianIStream& eis);
01085 
01086 */
01087         
01089         // text-deserialization material //
01091         std::map<std::string, FlagAttributeFromText> fromTextMethods;
01092         
01093 void flagIdFromText (const string & s);
01094         
01095         
01096 void startTimeFromText (const string & s);
01097         
01098         
01099 void endTimeFromText (const string & s);
01100         
01101         
01102 void reasonFromText (const string & s);
01103         
01104         
01105 void numAntennaFromText (const string & s);
01106         
01107         
01108 void antennaIdFromText (const string & s);
01109         
01110 
01111         
01112 void numPolarizationTypeFromText (const string & s);
01113         
01114         
01115 void numSpectralWindowFromText (const string & s);
01116         
01117         
01118 void numPairedAntennaFromText (const string & s);
01119         
01120         
01121 void polarizationTypeFromText (const string & s);
01122         
01123         
01124 void pairedAntennaIdFromText (const string & s);
01125         
01126         
01127 void spectralWindowIdFromText (const string & s);
01128         
01129         
01130         
01131         void fromText(const std::string& attributeName, const std::string&  t);
01132         
01137          void toBin(EndianOSStream& eoss);
01138                  
01148 };
01149 
01150 } // End namespace asdm
01151 
01152 #endif /* Flag_CLASS */