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.64", 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         
00789          void toIDL(asdmIDL::FlagRowIDL& x) const;
00790 #endif
00791         
00792 #ifndef WITHOUT_ACS
00793 
00798         void setFromIDL (asdmIDL::FlagRowIDL x) ;
00799 #endif
00800         
00805         std::string toXML() const;
00806 
00813         void setFromXML (std::string rowDoc) ;
00814 
00817         // binary-deserialization material from an EndianIStream  //
00819 
00820         std::map<std::string, FlagAttributeFromBin> fromBinMethods;
00821 void flagIdFromBin( EndianIStream& eis);
00822 void startTimeFromBin( EndianIStream& eis);
00823 void endTimeFromBin( EndianIStream& eis);
00824 void reasonFromBin( EndianIStream& eis);
00825 void numAntennaFromBin( EndianIStream& eis);
00826 void antennaIdFromBin( EndianIStream& eis);
00827 
00828 void numPolarizationTypeFromBin( EndianIStream& eis);
00829 void numSpectralWindowFromBin( EndianIStream& eis);
00830 void numPairedAntennaFromBin( EndianIStream& eis);
00831 void polarizationTypeFromBin( EndianIStream& eis);
00832 void pairedAntennaIdFromBin( EndianIStream& eis);
00833 void spectralWindowIdFromBin( EndianIStream& eis);
00834 
00835 
00843          static FlagRow* fromBin(EndianIStream& eis, FlagTable& table, const std::vector<std::string>& attributesSeq);   
00844  
00851          void fromText(const std::string& attributeName, const std::string&  t);
00853 
00854 private:
00858         FlagTable &table;
00862         bool hasBeenAdded;
00863 
00864         // This method is used by the Table class when this row is added to the table.
00865         void isAdded(bool added);
00866 
00867 
00876         FlagRow (FlagTable &table);
00877 
00895          FlagRow (FlagTable &table, FlagRow &row);
00896                 
00898         // Intrinsic Table Attributes //
00900         
00901         
00902         // ===> Attribute flagId
00903         
00904         
00905 
00906         Tag flagId;
00907 
00908         
00909         
00910         
00920         void setFlagId (Tag flagId);
00921                 
00922         
00923 
00924         
00925         // ===> Attribute startTime
00926         
00927         
00928 
00929         ArrayTime startTime;
00930 
00931         
00932         
00933         
00934 
00935         
00936         // ===> Attribute endTime
00937         
00938         
00939 
00940         ArrayTime endTime;
00941 
00942         
00943         
00944         
00945 
00946         
00947         // ===> Attribute reason
00948         
00949         
00950 
00951         string reason;
00952 
00953         
00954         
00955         
00956 
00957         
00958         // ===> Attribute numAntenna
00959         
00960         
00961 
00962         int numAntenna;
00963 
00964         
00965         
00966         
00967 
00968         
00969         // ===> Attribute numPolarizationType, which is optional
00970         
00971         
00972         bool numPolarizationTypeExists;
00973         
00974 
00975         int numPolarizationType;
00976 
00977         
00978         
00979         
00980 
00981         
00982         // ===> Attribute numSpectralWindow, which is optional
00983         
00984         
00985         bool numSpectralWindowExists;
00986         
00987 
00988         int numSpectralWindow;
00989 
00990         
00991         
00992         
00993 
00994         
00995         // ===> Attribute numPairedAntenna, which is optional
00996         
00997         
00998         bool numPairedAntennaExists;
00999         
01000 
01001         int numPairedAntenna;
01002 
01003         
01004         
01005         
01006 
01007         
01008         // ===> Attribute polarizationType, which is optional
01009         
01010         
01011         bool polarizationTypeExists;
01012         
01013 
01014         vector<PolarizationTypeMod::PolarizationType > polarizationType;
01015 
01016         
01017         
01018         
01019 
01021         // Extrinsic Table Attributes //
01023         
01024         
01025         // ===> Attribute antennaId
01026         
01027         
01028 
01029         vector<Tag>  antennaId;
01030 
01031         
01032         
01033         
01034 
01035         
01036         // ===> Attribute pairedAntennaId, which is optional
01037         
01038         
01039         bool pairedAntennaIdExists;
01040         
01041 
01042         vector<Tag>  pairedAntennaId;
01043 
01044         
01045         
01046         
01047 
01048         
01049         // ===> Attribute spectralWindowId, which is optional
01050         
01051         
01052         bool spectralWindowIdExists;
01053         
01054 
01055         vector<Tag>  spectralWindowId;
01056 
01057         
01058         
01059         
01060 
01062         // Links //
01064         
01065         
01066                 
01067 
01068 
01069         
01070 
01071         
01072                 
01073 
01074 
01075         
01076 
01077         
01078                 
01079 
01080 
01081         
01082 
01083         
01084 /*
01086         // binary-deserialization material from an EndianIStream  //
01088         std::map<std::string, FlagAttributeFromBin> fromBinMethods;
01089 void flagIdFromBin( EndianIStream& eis);
01090 void startTimeFromBin( EndianIStream& eis);
01091 void endTimeFromBin( EndianIStream& eis);
01092 void reasonFromBin( EndianIStream& eis);
01093 void numAntennaFromBin( EndianIStream& eis);
01094 void antennaIdFromBin( EndianIStream& eis);
01095 
01096 void numPolarizationTypeFromBin( EndianIStream& eis);
01097 void numSpectralWindowFromBin( EndianIStream& eis);
01098 void numPairedAntennaFromBin( EndianIStream& eis);
01099 void polarizationTypeFromBin( EndianIStream& eis);
01100 void pairedAntennaIdFromBin( EndianIStream& eis);
01101 void spectralWindowIdFromBin( EndianIStream& eis);
01102 
01103 */
01104         
01106         // text-deserialization material //
01108         std::map<std::string, FlagAttributeFromText> fromTextMethods;
01109         
01110 void flagIdFromText (const string & s);
01111         
01112         
01113 void startTimeFromText (const string & s);
01114         
01115         
01116 void endTimeFromText (const string & s);
01117         
01118         
01119 void reasonFromText (const string & s);
01120         
01121         
01122 void numAntennaFromText (const string & s);
01123         
01124         
01125 void antennaIdFromText (const string & s);
01126         
01127 
01128         
01129 void numPolarizationTypeFromText (const string & s);
01130         
01131         
01132 void numSpectralWindowFromText (const string & s);
01133         
01134         
01135 void numPairedAntennaFromText (const string & s);
01136         
01137         
01138 void polarizationTypeFromText (const string & s);
01139         
01140         
01141 void pairedAntennaIdFromText (const string & s);
01142         
01143         
01144 void spectralWindowIdFromText (const string & s);
01145         
01146         
01147         
01152          void toBin(EndianOSStream& eoss);
01153                  
01163 };
01164 
01165 } // End namespace asdm
01166 
01167 #endif /* Flag_CLASS */