ReceiverTable.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 ReceiverTable.h
00032  */
00033  
00034 #ifndef ReceiverTable_CLASS
00035 #define ReceiverTable_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 <Tag.h>
00048 using  asdm::Tag;
00049 
00050 #include <Frequency.h>
00051 using  asdm::Frequency;
00052 
00053 #include <ArrayTimeInterval.h>
00054 using  asdm::ArrayTimeInterval;
00055 
00056 
00057 
00058 
00059         
00060 
00061         
00062 
00063         
00064 
00065         
00066 
00067         
00068 #include "CReceiverBand.h"
00069 using namespace ReceiverBandMod;
00070         
00071 
00072         
00073 
00074         
00075 #include "CReceiverSideband.h"
00076 using namespace ReceiverSidebandMod;
00077         
00078 
00079         
00080 #include "CNetSideband.h"
00081 using namespace NetSidebandMod;
00082         
00083 
00084 
00085 
00086 #include <ConversionException.h>
00087 #include <DuplicateKey.h>
00088 #include <UniquenessViolationException.h>
00089 #include <NoSuchRow.h>
00090 #include <DuplicateKey.h>
00091 using asdm::DuplicateKey;
00092 using asdm::ConversionException;
00093 using asdm::NoSuchRow;
00094 using asdm::DuplicateKey;
00095 
00096 #ifndef WITHOUT_ACS
00097 #include <asdmIDLC.h>
00098 using asdmIDL::ReceiverTableIDL;
00099 #endif
00100 
00101 #include <Representable.h>
00102 
00103 namespace asdm {
00104 
00105 //class asdm::ASDM;
00106 //class asdm::ReceiverRow;
00107 
00108 class ASDM;
00109 class ReceiverRow;
00203 class ReceiverTable : public Representable {
00204         friend class ASDM;
00205 
00206 public:
00207 
00208 
00214         static vector<string> getKeyName();
00215 
00216 
00217         virtual ~ReceiverTable();
00218         
00224         ASDM &getContainer() const;
00225         
00231         unsigned int size() ;
00232         
00238         string getName() const;
00239         
00245          static const vector<string>& getAttributesNames();
00246 
00250         Entity getEntity() const;
00251 
00256         void setEntity(Entity e);
00257                 
00265         string toXML()  ;
00266 
00267 #ifndef WITHOUT_ACS
00268         // Conversion Methods
00274         ReceiverTableIDL *toIDL() ;
00275 #endif
00276 
00277 #ifndef WITHOUT_ACS
00278 
00284         void fromIDL(ReceiverTableIDL x) ;
00285 #endif
00286         
00287         //
00288         // ====> Row creation.
00289         //
00290         
00295         ReceiverRow *newRow();
00296         
00297         
00319         ReceiverRow *newRow(Tag spectralWindowId, ArrayTimeInterval timeInterval, string name, int numLO, ReceiverBandMod::ReceiverBand frequencyBand, vector<Frequency > freqLO, ReceiverSidebandMod::ReceiverSideband receiverSideband, vector<NetSidebandMod::NetSideband > sidebandLO);
00320         
00321 
00322 
00335          ReceiverRow *newRow(ReceiverRow *row); 
00336 
00337         //
00338         // ====> Append a row to its table.
00339         //
00340 
00341         
00342          
00343         
00344         
00354          ReceiverRow* add(ReceiverRow* x) ;
00355 
00356 
00357 
00358         //
00359         // ====> Methods returning rows.
00360         //
00361                 
00367         vector<ReceiverRow *> get() ;
00368         
00369 
00370 
00371  
00372         
00386         ReceiverRow* getRowByKey(int receiverId, Tag spectralWindowId, ArrayTimeInterval timeInterval);
00387 
00388                 
00389         
00397         vector <ReceiverRow *>  getRowByReceiverId(int);
00398 
00399 
00400 
00424         ReceiverRow* lookup(Tag spectralWindowId, ArrayTimeInterval timeInterval, string name, int numLO, ReceiverBandMod::ReceiverBand frequencyBand, vector<Frequency > freqLO, ReceiverSidebandMod::ReceiverSideband receiverSideband, vector<NetSidebandMod::NetSideband > sidebandLO); 
00425 
00426 
00427 private:
00428 
00437         ReceiverTable (ASDM & container);
00438 
00439         ASDM & container;
00440         
00441         bool archiveAsBin; // If true archive binary else archive XML
00442         bool fileAsBin ; // If true file binary else file XML   
00443         
00444         Entity entity;
00445         
00446 
00447 
00451         static string tableName;
00452         
00456         static const vector<string> attributesNames;
00457         
00461         static vector<string> initAttributesNames();
00462 
00463 
00467         static vector<string> key;
00468 
00469 
00479         ReceiverRow* checkAndAdd(ReceiverRow* x) ;
00480 
00481 
00482         
00483         
00491          ReceiverRow * insertByStartTime(ReceiverRow* x, vector<ReceiverRow* >& row);
00492           
00493 
00494 
00495 // A data structure to store the pointers on the table's rows.
00496 
00497 // In all cases we maintain a private vector of ReceiverRow s.
00498    vector<ReceiverRow * > privateRows;
00499    
00500 
00501         
00502 
00503         
00504         
00505                 
00506                 
00507         typedef vector <vector <ReceiverRow* > > ID_TIME_ROWS;
00508         map<string, ID_TIME_ROWS > context;
00509         
00514          string Key(Tag spectralWindowId) ;
00515                 
00516                 
00517         
00518         
00524         void getByKeyNoAutoIncNoTime(vector <ReceiverRow*>& vin, vector <ReceiverRow*>& vout,  Tag spectralWindowId);
00525         
00526 
00527         
00528         void error() ; //throw(ConversionException);
00529 
00530         
00537         void fromXML(string xmlDoc) ;
00538                 
00543         void setFromMIMEFile(const string& directory);
00544         void setFromXMLFile(const string& directory);
00545         
00553         string toMIME(const asdm::ByteOrder* byteOrder=asdm::ByteOrder::Machine_Endianity);
00554   
00555         
00562          void setFromMIME(const string & mimeMsg);
00563         
00567         string MIMEXMLPart(const asdm::ByteOrder* byteOrder=asdm::ByteOrder::Machine_Endianity);
00568         
00578           void toFile(string directory);
00579           
00588          void setFromFile(const string& directory);     
00589  
00590 };
00591 
00592 } // End namespace asdm
00593 
00594 #endif /* ReceiverTable_CLASS */
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines