casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
FieldRow.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 FieldRow.h
00032  */
00033  
00034 #ifndef FieldRow_CLASS
00035 #define FieldRow_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 <Angle.h>
00056         
00057 
00058          
00059 #include <Tag.h>
00060         
00061 
00062 
00063 
00064 
00065         
00066 
00067         
00068 
00069         
00070 
00071         
00072 
00073         
00074 
00075         
00076 
00077         
00078 
00079         
00080 
00081         
00082 #include "CDirectionReferenceCode.h"
00083         
00084 
00085         
00086 
00087         
00088 
00089 
00090 
00091 #include <ConversionException.h>
00092 #include <NoSuchRow.h>
00093 #include <IllegalAccessException.h>
00094 
00095 #include <RowTransformer.h>
00096 //#include <TableStreamReader.h>
00097 
00098 /*\file Field.h
00099     \brief Generated from model's revision "1.64", branch "HEAD"
00100 */
00101 
00102 namespace asdm {
00103 
00104 //class asdm::FieldTable;
00105 
00106 
00107 // class asdm::EphemerisRow;
00108 class EphemerisRow;
00109 
00110 // class asdm::SourceRow;
00111 class SourceRow;
00112 
00113 // class asdm::FieldRow;
00114 class FieldRow;
00115         
00116 
00117 class FieldRow;
00118 typedef void (FieldRow::*FieldAttributeFromBin) (EndianIStream& eis);
00119 typedef void (FieldRow::*FieldAttributeFromText) (const string& s);
00120 
00127 class FieldRow {
00128 friend class asdm::FieldTable;
00129 friend class asdm::RowTransformer<FieldRow>;
00130 //friend class asdm::TableStreamReader<FieldTable, FieldRow>;
00131 
00132 public:
00133 
00134         virtual ~FieldRow();
00135 
00139         FieldTable &getTable() const;
00140         
00145         bool isAdded() const;
00146                 
00148         // Intrinsic Table Attributes //
00150         
00151         
00152         // ===> Attribute fieldId
00153         
00154         
00155         
00156 
00157         
00162         Tag getFieldId() const;
00163         
00164  
00165         
00166         
00167         
00168         
00169 
00170 
00171         
00172         // ===> Attribute fieldName
00173         
00174         
00175         
00176 
00177         
00182         string getFieldName() const;
00183         
00184  
00185         
00186         
00194         void setFieldName (string fieldName);
00195                 
00196         
00197         
00198         
00199 
00200 
00201         
00202         // ===> Attribute numPoly
00203         
00204         
00205         
00206 
00207         
00212         int getNumPoly() const;
00213         
00214  
00215         
00216         
00224         void setNumPoly (int numPoly);
00225                 
00226         
00227         
00228         
00229 
00230 
00231         
00232         // ===> Attribute delayDir
00233         
00234         
00235         
00236 
00237         
00242         vector<vector<Angle > > getDelayDir() const;
00243         
00244  
00245         
00246         
00254         void setDelayDir (vector<vector<Angle > > delayDir);
00255                 
00256         
00257         
00258         
00259 
00260 
00261         
00262         // ===> Attribute phaseDir
00263         
00264         
00265         
00266 
00267         
00272         vector<vector<Angle > > getPhaseDir() const;
00273         
00274  
00275         
00276         
00284         void setPhaseDir (vector<vector<Angle > > phaseDir);
00285                 
00286         
00287         
00288         
00289 
00290 
00291         
00292         // ===> Attribute referenceDir
00293         
00294         
00295         
00296 
00297         
00302         vector<vector<Angle > > getReferenceDir() const;
00303         
00304  
00305         
00306         
00314         void setReferenceDir (vector<vector<Angle > > referenceDir);
00315                 
00316         
00317         
00318         
00319 
00320 
00321         
00322         // ===> Attribute time, which is optional
00323         
00324         
00325         
00330         bool isTimeExists() const;
00331         
00332 
00333         
00339         ArrayTime getTime() const;
00340         
00341  
00342         
00343         
00350         void setTime (ArrayTime time);
00351                 
00352         
00353         
00354         
00358         void clearTime ();
00359         
00360 
00361 
00362         
00363         // ===> Attribute code, which is optional
00364         
00365         
00366         
00371         bool isCodeExists() const;
00372         
00373 
00374         
00380         string getCode() const;
00381         
00382  
00383         
00384         
00391         void setCode (string code);
00392                 
00393         
00394         
00395         
00399         void clearCode ();
00400         
00401 
00402 
00403         
00404         // ===> Attribute directionCode, which is optional
00405         
00406         
00407         
00412         bool isDirectionCodeExists() const;
00413         
00414 
00415         
00421         DirectionReferenceCodeMod::DirectionReferenceCode getDirectionCode() const;
00422         
00423  
00424         
00425         
00432         void setDirectionCode (DirectionReferenceCodeMod::DirectionReferenceCode directionCode);
00433                 
00434         
00435         
00436         
00440         void clearDirectionCode ();
00441         
00442 
00443 
00444         
00445         // ===> Attribute directionEquinox, which is optional
00446         
00447         
00448         
00453         bool isDirectionEquinoxExists() const;
00454         
00455 
00456         
00462         ArrayTime getDirectionEquinox() const;
00463         
00464  
00465         
00466         
00473         void setDirectionEquinox (ArrayTime directionEquinox);
00474                 
00475         
00476         
00477         
00481         void clearDirectionEquinox ();
00482         
00483 
00484 
00485         
00486         // ===> Attribute assocNature, which is optional
00487         
00488         
00489         
00494         bool isAssocNatureExists() const;
00495         
00496 
00497         
00503         string getAssocNature() const;
00504         
00505  
00506         
00507         
00514         void setAssocNature (string assocNature);
00515                 
00516         
00517         
00518         
00522         void clearAssocNature ();
00523         
00524 
00525 
00527         // Extrinsic Table Attributes //
00529         
00530         
00531         // ===> Attribute assocFieldId, which is optional
00532         
00533         
00534         
00539         bool isAssocFieldIdExists() const;
00540         
00541 
00542         
00548         Tag getAssocFieldId() const;
00549         
00550  
00551         
00552         
00559         void setAssocFieldId (Tag assocFieldId);
00560                 
00561         
00562         
00563         
00567         void clearAssocFieldId ();
00568         
00569 
00570 
00571         
00572         // ===> Attribute ephemerisId, which is optional
00573         
00574         
00575         
00580         bool isEphemerisIdExists() const;
00581         
00582 
00583         
00589         Tag getEphemerisId() const;
00590         
00591  
00592         
00593         
00600         void setEphemerisId (Tag ephemerisId);
00601                 
00602         
00603         
00604         
00608         void clearEphemerisId ();
00609         
00610 
00611 
00612         
00613         // ===> Attribute sourceId, which is optional
00614         
00615         
00616         
00621         bool isSourceIdExists() const;
00622         
00623 
00624         
00630         int getSourceId() const;
00631         
00632  
00633         
00634         
00641         void setSourceId (int sourceId);
00642                 
00643         
00644         
00645         
00649         void clearSourceId ();
00650         
00651 
00652 
00654         // Links //
00656         
00657         
00658 
00659         
00660                 
00669          EphemerisRow* getEphemerisUsingEphemerisId();
00670          
00671 
00672         
00673 
00674         
00675 
00676         
00677                 
00678         // ===> Slice link from a row of Field table to a collection of row of Source table.
00679         
00685         vector <SourceRow *> getSources();
00686         
00687         
00688 
00689         
00690 
00691         
00692 
00693         
00694                 
00703          FieldRow* getFieldUsingAssocFieldId();
00704          
00705 
00706         
00707 
00708         
00709         
00710         
00726         bool compareNoAutoInc(string fieldName, int numPoly, vector<vector<Angle > > delayDir, vector<vector<Angle > > phaseDir, vector<vector<Angle > > referenceDir);
00727         
00728         
00729 
00730         
00746         bool compareRequiredValue(string fieldName, int numPoly, vector<vector<Angle > > delayDir, vector<vector<Angle > > phaseDir, vector<vector<Angle > > referenceDir); 
00747                  
00748         
00757         bool equalByRequiredValue(FieldRow* x) ;
00758         
00759 #ifndef WITHOUT_ACS
00760 
00764         asdmIDL::FieldRowIDL *toIDL() const;
00765         
00773          void toIDL(asdmIDL::FieldRowIDL& x) const;
00774 #endif
00775         
00776 #ifndef WITHOUT_ACS
00777 
00782         void setFromIDL (asdmIDL::FieldRowIDL x) ;
00783 #endif
00784         
00789         std::string toXML() const;
00790 
00797         void setFromXML (std::string rowDoc) ;
00798 
00801         // binary-deserialization material from an EndianIStream  //
00803 
00804         std::map<std::string, FieldAttributeFromBin> fromBinMethods;
00805 void fieldIdFromBin( EndianIStream& eis);
00806 void fieldNameFromBin( EndianIStream& eis);
00807 void numPolyFromBin( EndianIStream& eis);
00808 void delayDirFromBin( EndianIStream& eis);
00809 void phaseDirFromBin( EndianIStream& eis);
00810 void referenceDirFromBin( EndianIStream& eis);
00811 
00812 void timeFromBin( EndianIStream& eis);
00813 void codeFromBin( EndianIStream& eis);
00814 void directionCodeFromBin( EndianIStream& eis);
00815 void directionEquinoxFromBin( EndianIStream& eis);
00816 void assocNatureFromBin( EndianIStream& eis);
00817 void ephemerisIdFromBin( EndianIStream& eis);
00818 void sourceIdFromBin( EndianIStream& eis);
00819 void assocFieldIdFromBin( EndianIStream& eis);
00820 
00821 
00829          static FieldRow* fromBin(EndianIStream& eis, FieldTable& table, const std::vector<std::string>& attributesSeq);         
00830  
00837          void fromText(const std::string& attributeName, const std::string&  t);
00839 
00840 private:
00844         FieldTable &table;
00848         bool hasBeenAdded;
00849 
00850         // This method is used by the Table class when this row is added to the table.
00851         void isAdded(bool added);
00852 
00853 
00862         FieldRow (FieldTable &table);
00863 
00881          FieldRow (FieldTable &table, FieldRow &row);
00882                 
00884         // Intrinsic Table Attributes //
00886         
00887         
00888         // ===> Attribute fieldId
00889         
00890         
00891 
00892         Tag fieldId;
00893 
00894         
00895         
00896         
00906         void setFieldId (Tag fieldId);
00907                 
00908         
00909 
00910         
00911         // ===> Attribute fieldName
00912         
00913         
00914 
00915         string fieldName;
00916 
00917         
00918         
00919         
00920 
00921         
00922         // ===> Attribute numPoly
00923         
00924         
00925 
00926         int numPoly;
00927 
00928         
00929         
00930         
00931 
00932         
00933         // ===> Attribute delayDir
00934         
00935         
00936 
00937         vector<vector<Angle > > delayDir;
00938 
00939         
00940         
00941         
00942 
00943         
00944         // ===> Attribute phaseDir
00945         
00946         
00947 
00948         vector<vector<Angle > > phaseDir;
00949 
00950         
00951         
00952         
00953 
00954         
00955         // ===> Attribute referenceDir
00956         
00957         
00958 
00959         vector<vector<Angle > > referenceDir;
00960 
00961         
00962         
00963         
00964 
00965         
00966         // ===> Attribute time, which is optional
00967         
00968         
00969         bool timeExists;
00970         
00971 
00972         ArrayTime time;
00973 
00974         
00975         
00976         
00977 
00978         
00979         // ===> Attribute code, which is optional
00980         
00981         
00982         bool codeExists;
00983         
00984 
00985         string code;
00986 
00987         
00988         
00989         
00990 
00991         
00992         // ===> Attribute directionCode, which is optional
00993         
00994         
00995         bool directionCodeExists;
00996         
00997 
00998         DirectionReferenceCodeMod::DirectionReferenceCode directionCode;
00999 
01000         
01001         
01002         
01003 
01004         
01005         // ===> Attribute directionEquinox, which is optional
01006         
01007         
01008         bool directionEquinoxExists;
01009         
01010 
01011         ArrayTime directionEquinox;
01012 
01013         
01014         
01015         
01016 
01017         
01018         // ===> Attribute assocNature, which is optional
01019         
01020         
01021         bool assocNatureExists;
01022         
01023 
01024         string assocNature;
01025 
01026         
01027         
01028         
01029 
01031         // Extrinsic Table Attributes //
01033         
01034         
01035         // ===> Attribute assocFieldId, which is optional
01036         
01037         
01038         bool assocFieldIdExists;
01039         
01040 
01041         Tag assocFieldId;
01042 
01043         
01044         
01045         
01046 
01047         
01048         // ===> Attribute ephemerisId, which is optional
01049         
01050         
01051         bool ephemerisIdExists;
01052         
01053 
01054         Tag ephemerisId;
01055 
01056         
01057         
01058         
01059 
01060         
01061         // ===> Attribute sourceId, which is optional
01062         
01063         
01064         bool sourceIdExists;
01065         
01066 
01067         int sourceId;
01068 
01069         
01070         
01071         
01072 
01074         // Links //
01076         
01077         
01078                 
01079 
01080          
01081 
01082         
01083 
01084         
01085                 
01086 
01087 
01088         
01089 
01090         
01091                 
01092 
01093          
01094 
01095         
01096 
01097         
01098 /*
01100         // binary-deserialization material from an EndianIStream  //
01102         std::map<std::string, FieldAttributeFromBin> fromBinMethods;
01103 void fieldIdFromBin( EndianIStream& eis);
01104 void fieldNameFromBin( EndianIStream& eis);
01105 void numPolyFromBin( EndianIStream& eis);
01106 void delayDirFromBin( EndianIStream& eis);
01107 void phaseDirFromBin( EndianIStream& eis);
01108 void referenceDirFromBin( EndianIStream& eis);
01109 
01110 void timeFromBin( EndianIStream& eis);
01111 void codeFromBin( EndianIStream& eis);
01112 void directionCodeFromBin( EndianIStream& eis);
01113 void directionEquinoxFromBin( EndianIStream& eis);
01114 void assocNatureFromBin( EndianIStream& eis);
01115 void ephemerisIdFromBin( EndianIStream& eis);
01116 void sourceIdFromBin( EndianIStream& eis);
01117 void assocFieldIdFromBin( EndianIStream& eis);
01118 
01119 */
01120         
01122         // text-deserialization material //
01124         std::map<std::string, FieldAttributeFromText> fromTextMethods;
01125         
01126 void fieldIdFromText (const string & s);
01127         
01128         
01129 void fieldNameFromText (const string & s);
01130         
01131         
01132 void numPolyFromText (const string & s);
01133         
01134         
01135 void delayDirFromText (const string & s);
01136         
01137         
01138 void phaseDirFromText (const string & s);
01139         
01140         
01141 void referenceDirFromText (const string & s);
01142         
01143 
01144         
01145 void timeFromText (const string & s);
01146         
01147         
01148 void codeFromText (const string & s);
01149         
01150         
01151 void directionCodeFromText (const string & s);
01152         
01153         
01154 void directionEquinoxFromText (const string & s);
01155         
01156         
01157 void assocNatureFromText (const string & s);
01158         
01159         
01160 void ephemerisIdFromText (const string & s);
01161         
01162         
01163 void sourceIdFromText (const string & s);
01164         
01165         
01166 void assocFieldIdFromText (const string & s);
01167         
01168         
01169         
01174          void toBin(EndianOSStream& eoss);
01175                  
01185 };
01186 
01187 } // End namespace asdm
01188 
01189 #endif /* Field_CLASS */