FeedTable.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 FeedTable.h
00032  */
00033  
00034 #ifndef FeedTable_CLASS
00035 #define FeedTable_CLASS
00036 
00037 #include <string>
00038 #include <vector>
00039 #include <map>
00040 #include <set>
00041 using std::string;
00042 using std::vector;
00043 using std::map;
00044 
00045 
00046 
00047 #include <Angle.h>
00048 using  asdm::Angle;
00049 
00050 #include <Tag.h>
00051 using  asdm::Tag;
00052 
00053 #include <Length.h>
00054 using  asdm::Length;
00055 
00056 #include <ArrayTimeInterval.h>
00057 using  asdm::ArrayTimeInterval;
00058 
00059 #include <Complex.h>
00060 using  asdm::Complex;
00061 
00062 
00063 
00064 
00065         
00066 
00067         
00068 
00069         
00070 
00071         
00072 
00073         
00074 
00075         
00076 #include "CPolarizationType.h"
00077 using namespace PolarizationTypeMod;
00078         
00079 
00080         
00081 
00082         
00083 
00084         
00085 
00086         
00087 
00088         
00089 
00090 
00091 
00092 #include <ConversionException.h>
00093 #include <DuplicateKey.h>
00094 #include <UniquenessViolationException.h>
00095 #include <NoSuchRow.h>
00096 #include <DuplicateKey.h>
00097 using asdm::DuplicateKey;
00098 using asdm::ConversionException;
00099 using asdm::NoSuchRow;
00100 using asdm::DuplicateKey;
00101 
00102 #ifndef WITHOUT_ACS
00103 #include <asdmIDLC.h>
00104 using asdmIDL::FeedTableIDL;
00105 #endif
00106 
00107 #include <Representable.h>
00108 
00109 namespace asdm {
00110 
00111 //class asdm::ASDM;
00112 //class asdm::FeedRow;
00113 
00114 class ASDM;
00115 class FeedRow;
00256 class FeedTable : public Representable {
00257         friend class ASDM;
00258 
00259 public:
00260 
00261 
00267         static vector<string> getKeyName();
00268 
00269 
00270         virtual ~FeedTable();
00271         
00277         ASDM &getContainer() const;
00278         
00284         unsigned int size() ;
00285         
00291         string getName() const;
00292         
00298          static const vector<string>& getAttributesNames();
00299 
00303         Entity getEntity() const;
00304 
00309         void setEntity(Entity e);
00310                 
00318         string toXML()  ;
00319 
00320 #ifndef WITHOUT_ACS
00321         // Conversion Methods
00327         FeedTableIDL *toIDL() ;
00328 #endif
00329 
00330 #ifndef WITHOUT_ACS
00331 
00337         void fromIDL(FeedTableIDL x) ;
00338 #endif
00339         
00340         //
00341         // ====> Row creation.
00342         //
00343         
00348         FeedRow *newRow();
00349         
00350         
00376         FeedRow *newRow(Tag antennaId, Tag spectralWindowId, ArrayTimeInterval timeInterval, int numReceptor, vector<vector<double > > beamOffset, vector<vector<Length > > focusReference, vector<PolarizationTypeMod::PolarizationType > polarizationTypes, vector<vector<Complex > > polResponse, vector<Angle > receptorAngle, vector<int>  receiverId);
00377         
00378 
00379 
00392          FeedRow *newRow(FeedRow *row); 
00393 
00394         //
00395         // ====> Append a row to its table.
00396         //
00397 
00398         
00399          
00400         
00401         
00411          FeedRow* add(FeedRow* x) ;
00412 
00413 
00414 
00415         //
00416         // ====> Methods returning rows.
00417         //
00418                 
00424         vector<FeedRow *> get() ;
00425         
00426 
00427 
00428  
00429         
00445         FeedRow* getRowByKey(Tag antennaId, Tag spectralWindowId, ArrayTimeInterval timeInterval, int feedId);
00446 
00447                 
00448         
00456         vector <FeedRow *>  getRowByFeedId(int);
00457 
00458 
00459 
00487         FeedRow* lookup(Tag antennaId, Tag spectralWindowId, ArrayTimeInterval timeInterval, int numReceptor, vector<vector<double > > beamOffset, vector<vector<Length > > focusReference, vector<PolarizationTypeMod::PolarizationType > polarizationTypes, vector<vector<Complex > > polResponse, vector<Angle > receptorAngle, vector<int>  receiverId); 
00488 
00489 
00490 private:
00491 
00500         FeedTable (ASDM & container);
00501 
00502         ASDM & container;
00503         
00504         bool archiveAsBin; // If true archive binary else archive XML
00505         bool fileAsBin ; // If true file binary else file XML   
00506         
00507         Entity entity;
00508         
00509 
00510 
00514         static string tableName;
00515         
00519         static const vector<string> attributesNames;
00520         
00524         static vector<string> initAttributesNames();
00525 
00526 
00530         static vector<string> key;
00531 
00532 
00542         FeedRow* checkAndAdd(FeedRow* x) ;
00543 
00544 
00545         
00546         
00554          FeedRow * insertByStartTime(FeedRow* x, vector<FeedRow* >& row);
00555           
00556 
00557 
00558 // A data structure to store the pointers on the table's rows.
00559 
00560 // In all cases we maintain a private vector of FeedRow s.
00561    vector<FeedRow * > privateRows;
00562    
00563 
00564         
00565 
00566         
00567         
00568                 
00569                 
00570         typedef vector <vector <FeedRow* > > ID_TIME_ROWS;
00571         map<string, ID_TIME_ROWS > context;
00572         
00577          string Key(Tag antennaId, Tag spectralWindowId) ;
00578                 
00579                 
00580         
00581         
00587         void getByKeyNoAutoIncNoTime(vector <FeedRow*>& vin, vector <FeedRow*>& vout,  Tag antennaId, Tag spectralWindowId);
00588         
00589 
00590         
00591         void error() ; //throw(ConversionException);
00592 
00593         
00600         void fromXML(string xmlDoc) ;
00601                 
00606         void setFromMIMEFile(const string& directory);
00607         void setFromXMLFile(const string& directory);
00608         
00616         string toMIME(const asdm::ByteOrder* byteOrder=asdm::ByteOrder::Machine_Endianity);
00617   
00618         
00625          void setFromMIME(const string & mimeMsg);
00626         
00630         string MIMEXMLPart(const asdm::ByteOrder* byteOrder=asdm::ByteOrder::Machine_Endianity);
00631         
00641           void toFile(string directory);
00642           
00651          void setFromFile(const string& directory);     
00652  
00653 };
00654 
00655 } // End namespace asdm
00656 
00657 #endif /* FeedTable_CLASS */
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines