CalAppPhaseTable.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 CalAppPhaseTable.h
00032  */
00033  
00034 #ifndef CalAppPhaseTable_CLASS
00035 #define CalAppPhaseTable_CLASS
00036 
00037 #include <string>
00038 #include <vector>
00039 #include <map>
00040 
00041 
00042 
00043         
00044 #include <ArrayTime.h>
00045         
00046 
00047         
00048 #include <Tag.h>
00049         
00050 
00051 
00052 
00053 
00054         
00055 #include "CBasebandName.h"
00056         
00057 
00058         
00059 
00060         
00061 
00062         
00063 
00064         
00065 
00066         
00067 
00068         
00069 
00070         
00071 
00072         
00073 
00074         
00075 
00076         
00077 
00078         
00079 
00080         
00081 
00082         
00083 
00084         
00085 
00086         
00087 
00088         
00089 
00090         
00091 
00092         
00093 
00094         
00095 
00096         
00097 
00098         
00099 
00100         
00101 
00102         
00103 
00104         
00105 
00106         
00107 
00108 
00109 
00110 #include <ConversionException.h>
00111 #include <DuplicateKey.h>
00112 #include <UniquenessViolationException.h>
00113 #include <NoSuchRow.h>
00114 #include <DuplicateKey.h>
00115 
00116 
00117 #ifndef WITHOUT_ACS
00118 #include <asdmIDLC.h>
00119 #endif
00120 
00121 #include <Representable.h>
00122 
00123 #include <pthread.h>
00124 
00125 namespace asdm {
00126 
00127 //class asdm::ASDM;
00128 //class asdm::CalAppPhaseRow;
00129 
00130 class ASDM;
00131 class CalAppPhaseRow;
00363 class CalAppPhaseTable : public Representable {
00364         friend class ASDM;
00365 
00366 public:
00367 
00368 
00374         static const std::vector<std::string>& getKeyName();
00375 
00376 
00377         virtual ~CalAppPhaseTable();
00378         
00384         ASDM &getContainer() const;
00385         
00391         unsigned int size() const;
00392         
00400         std::string getName() const;
00401         
00409         static std::string name() ;     
00410         
00415          std::string getVersion() const ;
00416         
00422          static const std::vector<std::string>& getAttributesNames();
00423 
00429          static const std::vector<std::string>& defaultAttributesNamesInBin();
00430          
00434         Entity getEntity() const;
00435 
00440         void setEntity(Entity e);
00441                 
00449         std::string toXML()  ;
00450 
00451 #ifndef WITHOUT_ACS
00452         // Conversion Methods
00458         asdmIDL::CalAppPhaseTableIDL *toIDL() ;
00459         
00467          void toIDL(asdmIDL::CalAppPhaseTableIDL& x) const;
00468          
00469 #endif
00470 
00471 #ifndef WITHOUT_ACS
00472 
00478         void fromIDL(asdmIDL::CalAppPhaseTableIDL x) ;
00479 #endif
00480         
00481         //
00482         // ====> Row creation.
00483         //
00484         
00489         CalAppPhaseRow *newRow();
00490         
00491         
00547         CalAppPhaseRow *newRow(BasebandNameMod::BasebandName basebandName, int scanNumber, Tag calDataId, Tag calReductionId, ArrayTime startValidTime, ArrayTime endValidTime, ArrayTime adjustTime, string adjustToken, string phasingMode, int numPhasedAntennas, vector<string > phasedAntennas, int refAntennaIndex, int candRefAntennaIndex, string phasePacking, int numReceptors, int numChannels, int numPhaseValues, vector<float > phaseValues, int numCompare, int numEfficiencies, vector<string > compareArray, vector<int > efficiencyIndices, vector<vector<float > > efficiencies, vector<float > quality, string phasedSumAntenna);
00548         
00549 
00550 
00563          CalAppPhaseRow *newRow(CalAppPhaseRow *row); 
00564 
00565         //
00566         // ====> Append a row to its table.
00567         //
00568  
00569         
00582         CalAppPhaseRow* add(CalAppPhaseRow* x) ; 
00583 
00584  
00585 
00586 
00587 
00588         //
00589         // ====> Methods returning rows.
00590         //
00591                 
00597         std::vector<CalAppPhaseRow *> get() ;
00598         
00605          const std::vector<CalAppPhaseRow *>& get() const ;
00606         
00607 
00608 
00609  
00610         
00626         CalAppPhaseRow* getRowByKey(BasebandNameMod::BasebandName basebandName, int scanNumber, Tag calDataId, Tag calReductionId);
00627 
00628                 
00629 
00630 
00631 
00689         CalAppPhaseRow* lookup(BasebandNameMod::BasebandName basebandName, int scanNumber, Tag calDataId, Tag calReductionId, ArrayTime startValidTime, ArrayTime endValidTime, ArrayTime adjustTime, string adjustToken, string phasingMode, int numPhasedAntennas, vector<string > phasedAntennas, int refAntennaIndex, int candRefAntennaIndex, string phasePacking, int numReceptors, int numChannels, int numPhaseValues, vector<float > phaseValues, int numCompare, int numEfficiencies, vector<string > compareArray, vector<int > efficiencyIndices, vector<vector<float > > efficiencies, vector<float > quality, string phasedSumAntenna); 
00690 
00691 
00692         void setUnknownAttributeBinaryReader(const std::string& attributeName, BinaryAttributeReaderFunctor* barFctr);
00693         BinaryAttributeReaderFunctor* getUnknownAttributeBinaryReader(const std::string& attributeName) const;
00694 
00695 private:
00696 
00705         CalAppPhaseTable (ASDM & container);
00706 
00707         ASDM & container;
00708         
00709         bool archiveAsBin; // If true archive binary else archive XML
00710         bool fileAsBin ; // If true file binary else file XML   
00711         
00712         std::string version ; 
00713         
00714         Entity entity;
00715         
00716 
00717 
00725         CalAppPhaseRow* checkAndAdd(CalAppPhaseRow* x, bool skipCheckUniqueness=false) ;
00726         
00732          void append(CalAppPhaseRow* x) ;
00733          
00739          void addWithoutCheckingUnique(CalAppPhaseRow* x) ;
00740          
00741          
00742 
00743 
00744 
00745 // A data structure to store the pointers on the table's rows.
00746 
00747 // In all cases we maintain a private vector of CalAppPhaseRow s.
00748    std::vector<CalAppPhaseRow * > privateRows;
00749    
00750 
00751                         
00752         std::vector<CalAppPhaseRow *> row;
00753 
00754         
00755         void error() ; //throw(ConversionException);
00756 
00757         
00764         void fromXML(std::string& xmlDoc) ;
00765                 
00766         std::map<std::string, BinaryAttributeReaderFunctor *> unknownAttributes2Functors;
00767 
00772         void setFromMIMEFile(const std::string& directory);
00773         /*
00774         void openMIMEFile(const std::string& directory);
00775         */
00776         void setFromXMLFile(const std::string& directory);
00777         
00785         std::string toMIME(const asdm::ByteOrder* byteOrder=asdm::ByteOrder::Machine_Endianity);
00786   
00787         
00794          void setFromMIME(const std::string & mimeMsg);
00795         
00799         std::string MIMEXMLPart(const asdm::ByteOrder* byteOrder=asdm::ByteOrder::Machine_Endianity);
00800         
00810           void toFile(std::string directory);
00811           
00815           bool loadInProgress;
00816           void checkPresenceInMemory() {
00817                 if (!presentInMemory && !loadInProgress) {
00818                         loadInProgress = true;
00819                         setFromFile(getContainer().getDirectory());
00820                         presentInMemory = true;
00821                         loadInProgress = false;
00822                 }
00823           }
00832          void setFromFile(const std::string& directory);        
00833  
00834 };
00835 
00836 } // End namespace asdm
00837 
00838 #endif /* CalAppPhaseTable_CLASS */
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 31 Aug 2016 for casa by  doxygen 1.6.1