CalFocusTable.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 CalFocusTable.h
00032  */
00033  
00034 #ifndef CalFocusTable_CLASS
00035 #define CalFocusTable_CLASS
00036 
00037 #include <string>
00038 #include <vector>
00039 #include <map>
00040 
00041 
00042 
00043         
00044 #include <ArrayTime.h>
00045         
00046 
00047         
00048 #include <Temperature.h>
00049         
00050 
00051         
00052 #include <Angle.h>
00053         
00054 
00055         
00056 #include <Tag.h>
00057         
00058 
00059         
00060 #include <Length.h>
00061         
00062 
00063         
00064 #include <Frequency.h>
00065         
00066 
00067 
00068 
00069 
00070         
00071 
00072         
00073 
00074         
00075 
00076         
00077 #include "CReceiverBand.h"
00078         
00079 
00080         
00081 
00082         
00083 #include "CAtmPhaseCorrection.h"
00084         
00085 
00086         
00087 #include "CFocusMethod.h"
00088         
00089 
00090         
00091 
00092         
00093 
00094         
00095 
00096         
00097 #include "CPolarizationType.h"
00098         
00099 
00100         
00101 
00102         
00103 
00104         
00105 
00106         
00107 
00108         
00109 
00110         
00111 
00112         
00113 
00114         
00115 
00116         
00117 
00118         
00119 
00120         
00121 
00122         
00123 
00124         
00125 
00126         
00127 
00128         
00129 
00130         
00131 
00132         
00133 
00134         
00135 
00136         
00137 
00138         
00139 
00140         
00141 
00142         
00143 
00144         
00145 
00146 
00147 
00148 #include <ConversionException.h>
00149 #include <DuplicateKey.h>
00150 #include <UniquenessViolationException.h>
00151 #include <NoSuchRow.h>
00152 #include <DuplicateKey.h>
00153 
00154 
00155 #ifndef WITHOUT_ACS
00156 #include <asdmIDLC.h>
00157 #endif
00158 
00159 #include <Representable.h>
00160 
00161 #include <pthread.h>
00162 
00163 namespace asdm {
00164 
00165 //class asdm::ASDM;
00166 //class asdm::CalFocusRow;
00167 
00168 class ASDM;
00169 class CalFocusRow;
00457 class CalFocusTable : public Representable {
00458         friend class ASDM;
00459 
00460 public:
00461 
00462 
00468         static const std::vector<std::string>& getKeyName();
00469 
00470 
00471         virtual ~CalFocusTable();
00472         
00478         ASDM &getContainer() const;
00479         
00485         unsigned int size() const;
00486         
00494         std::string getName() const;
00495         
00503         static std::string name() ;     
00504         
00509          std::string getVersion() const ;
00510         
00516          static const std::vector<std::string>& getAttributesNames();
00517 
00523          static const std::vector<std::string>& defaultAttributesNamesInBin();
00524          
00528         Entity getEntity() const;
00529 
00534         void setEntity(Entity e);
00535                 
00543         std::string toXML()  ;
00544 
00545 #ifndef WITHOUT_ACS
00546         // Conversion Methods
00552         asdmIDL::CalFocusTableIDL *toIDL() ;
00553         
00561          void toIDL(asdmIDL::CalFocusTableIDL& x) const;
00562          
00563 #endif
00564 
00565 #ifndef WITHOUT_ACS
00566 
00572         void fromIDL(asdmIDL::CalFocusTableIDL x) ;
00573 #endif
00574         
00575         //
00576         // ====> Row creation.
00577         //
00578         
00583         CalFocusRow *newRow();
00584         
00585         
00629         CalFocusRow *newRow(string antennaName, ReceiverBandMod::ReceiverBand receiverBand, Tag calDataId, Tag calReductionId, ArrayTime startValidTime, ArrayTime endValidTime, Temperature ambientTemperature, AtmPhaseCorrectionMod::AtmPhaseCorrection atmPhaseCorrection, FocusMethodMod::FocusMethod focusMethod, vector<Frequency > frequencyRange, vector<Angle > pointingDirection, int numReceptor, vector<PolarizationTypeMod::PolarizationType > polarizationTypes, vector<bool > wereFixed, vector<vector<Length > > offset, vector<vector<Length > > offsetError, vector<vector<bool > > offsetWasTied, vector<vector<double > > reducedChiSquared, vector<vector<Length > > position);
00630         
00631 
00632 
00645          CalFocusRow *newRow(CalFocusRow *row); 
00646 
00647         //
00648         // ====> Append a row to its table.
00649         //
00650  
00651         
00664         CalFocusRow* add(CalFocusRow* x) ; 
00665 
00666  
00667 
00668 
00669 
00670         //
00671         // ====> Methods returning rows.
00672         //
00673                 
00679         std::vector<CalFocusRow *> get() ;
00680         
00687          const std::vector<CalFocusRow *>& get() const ;
00688         
00689 
00690 
00691  
00692         
00708         CalFocusRow* getRowByKey(string antennaName, ReceiverBandMod::ReceiverBand receiverBand, Tag calDataId, Tag calReductionId);
00709 
00710                 
00711 
00712 
00713 
00759         CalFocusRow* lookup(string antennaName, ReceiverBandMod::ReceiverBand receiverBand, Tag calDataId, Tag calReductionId, ArrayTime startValidTime, ArrayTime endValidTime, Temperature ambientTemperature, AtmPhaseCorrectionMod::AtmPhaseCorrection atmPhaseCorrection, FocusMethodMod::FocusMethod focusMethod, vector<Frequency > frequencyRange, vector<Angle > pointingDirection, int numReceptor, vector<PolarizationTypeMod::PolarizationType > polarizationTypes, vector<bool > wereFixed, vector<vector<Length > > offset, vector<vector<Length > > offsetError, vector<vector<bool > > offsetWasTied, vector<vector<double > > reducedChiSquared, vector<vector<Length > > position); 
00760 
00761 
00762         void setUnknownAttributeBinaryReader(const std::string& attributeName, BinaryAttributeReaderFunctor* barFctr);
00763         BinaryAttributeReaderFunctor* getUnknownAttributeBinaryReader(const std::string& attributeName) const;
00764 
00765 private:
00766 
00775         CalFocusTable (ASDM & container);
00776 
00777         ASDM & container;
00778         
00779         bool archiveAsBin; // If true archive binary else archive XML
00780         bool fileAsBin ; // If true file binary else file XML   
00781         
00782         std::string version ; 
00783         
00784         Entity entity;
00785         
00786 
00787         
00788         
00789 
00790 
00798         CalFocusRow* checkAndAdd(CalFocusRow* x, bool skipCheckUniqueness=false) ;
00799         
00805          void append(CalFocusRow* x) ;
00806          
00812          void addWithoutCheckingUnique(CalFocusRow* x) ;
00813          
00814          
00815 
00816 
00817 
00818 // A data structure to store the pointers on the table's rows.
00819 
00820 // In all cases we maintain a private vector of CalFocusRow s.
00821    std::vector<CalFocusRow * > privateRows;
00822    
00823 
00824                         
00825         std::vector<CalFocusRow *> row;
00826 
00827         
00828         void error() ; //throw(ConversionException);
00829 
00830         
00837         void fromXML(std::string& xmlDoc) ;
00838                 
00839         std::map<std::string, BinaryAttributeReaderFunctor *> unknownAttributes2Functors;
00840 
00845         void setFromMIMEFile(const std::string& directory);
00846         /*
00847         void openMIMEFile(const std::string& directory);
00848         */
00849         void setFromXMLFile(const std::string& directory);
00850         
00858         std::string toMIME(const asdm::ByteOrder* byteOrder=asdm::ByteOrder::Machine_Endianity);
00859   
00860         
00867          void setFromMIME(const std::string & mimeMsg);
00868         
00872         std::string MIMEXMLPart(const asdm::ByteOrder* byteOrder=asdm::ByteOrder::Machine_Endianity);
00873         
00883           void toFile(std::string directory);
00884           
00888           bool loadInProgress;
00889           void checkPresenceInMemory() {
00890                 if (!presentInMemory && !loadInProgress) {
00891                         loadInProgress = true;
00892                         setFromFile(getContainer().getDirectory());
00893                         presentInMemory = true;
00894                         loadInProgress = false;
00895                 }
00896           }
00905          void setFromFile(const std::string& directory);        
00906  
00907 };
00908 
00909 } // End namespace asdm
00910 
00911 #endif /* CalFocusTable_CLASS */
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 31 Aug 2016 for casa by  doxygen 1.6.1