DelayModelVariableParametersTable.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 DelayModelVariableParametersTable.h
00032  */
00033  
00034 #ifndef DelayModelVariableParametersTable_CLASS
00035 #define DelayModelVariableParametersTable_CLASS
00036 
00037 #include <string>
00038 #include <vector>
00039 #include <map>
00040 
00041 
00042 
00043         
00044 #include <ArrayTime.h>
00045         
00046 
00047         
00048 #include <Angle.h>
00049         
00050 
00051         
00052 #include <Tag.h>
00053         
00054 
00055         
00056 #include <AngularRate.h>
00057         
00058 
00059 
00060 
00061 
00062         
00063 
00064         
00065 
00066         
00067 
00068         
00069 
00070         
00071 #include "CDifferenceType.h"
00072         
00073 
00074         
00075 
00076         
00077 
00078         
00079 
00080         
00081 #include "CDifferenceType.h"
00082         
00083 
00084         
00085 
00086         
00087 
00088         
00089 
00090         
00091 
00092 
00093 
00094 #include <ConversionException.h>
00095 #include <DuplicateKey.h>
00096 #include <UniquenessViolationException.h>
00097 #include <NoSuchRow.h>
00098 #include <DuplicateKey.h>
00099 
00100 
00101 #ifndef WITHOUT_ACS
00102 #include <asdmIDLC.h>
00103 #endif
00104 
00105 #include <Representable.h>
00106 
00107 #include <pthread.h>
00108 
00109 namespace asdm {
00110 
00111 //class asdm::ASDM;
00112 //class asdm::DelayModelVariableParametersRow;
00113 
00114 class ASDM;
00115 class DelayModelVariableParametersRow;
00243 class DelayModelVariableParametersTable : public Representable {
00244         friend class ASDM;
00245 
00246 public:
00247 
00248 
00254         static const std::vector<std::string>& getKeyName();
00255 
00256 
00257         virtual ~DelayModelVariableParametersTable();
00258         
00264         ASDM &getContainer() const;
00265         
00271         unsigned int size() const;
00272         
00280         std::string getName() const;
00281         
00289         static std::string name() ;     
00290         
00295          std::string getVersion() const ;
00296         
00302          static const std::vector<std::string>& getAttributesNames();
00303 
00309          static const std::vector<std::string>& defaultAttributesNamesInBin();
00310          
00314         Entity getEntity() const;
00315 
00320         void setEntity(Entity e);
00321                 
00329         std::string toXML()  ;
00330 
00331 #ifndef WITHOUT_ACS
00332         // Conversion Methods
00338         asdmIDL::DelayModelVariableParametersTableIDL *toIDL() ;
00339         
00347          void toIDL(asdmIDL::DelayModelVariableParametersTableIDL& x) const;
00348          
00349 #endif
00350 
00351 #ifndef WITHOUT_ACS
00352 
00358         void fromIDL(asdmIDL::DelayModelVariableParametersTableIDL x) ;
00359 #endif
00360         
00361         //
00362         // ====> Row creation.
00363         //
00364         
00369         DelayModelVariableParametersRow *newRow();
00370         
00371         
00395         DelayModelVariableParametersRow *newRow(ArrayTime time, double ut1_utc, double iat_utc, DifferenceTypeMod::DifferenceType timeType, Angle gstAtUt0, AngularRate earthRotationRate, vector<double > polarOffsets, DifferenceTypeMod::DifferenceType polarOffsetsType, Tag delayModelFixedParametersId);
00396         
00397 
00398 
00411          DelayModelVariableParametersRow *newRow(DelayModelVariableParametersRow *row); 
00412 
00413         //
00414         // ====> Append a row to its table.
00415         //
00416 
00417         
00418         
00419         
00429          DelayModelVariableParametersRow* add(DelayModelVariableParametersRow* x) ;
00430 
00431 
00432 
00433         //
00434         // ====> Methods returning rows.
00435         //
00436                 
00442         std::vector<DelayModelVariableParametersRow *> get() ;
00443         
00450          const std::vector<DelayModelVariableParametersRow *>& get() const ;
00451         
00452 
00453 
00454  
00455         
00465         DelayModelVariableParametersRow* getRowByKey(Tag delayModelVariableParametersId);
00466 
00467                 
00468 
00469 
00470 
00496         DelayModelVariableParametersRow* lookup(ArrayTime time, double ut1_utc, double iat_utc, DifferenceTypeMod::DifferenceType timeType, Angle gstAtUt0, AngularRate earthRotationRate, vector<double > polarOffsets, DifferenceTypeMod::DifferenceType polarOffsetsType, Tag delayModelFixedParametersId); 
00497 
00498 
00499         void setUnknownAttributeBinaryReader(const std::string& attributeName, BinaryAttributeReaderFunctor* barFctr);
00500         BinaryAttributeReaderFunctor* getUnknownAttributeBinaryReader(const std::string& attributeName) const;
00501 
00502 private:
00503 
00512         DelayModelVariableParametersTable (ASDM & container);
00513 
00514         ASDM & container;
00515         
00516         bool archiveAsBin; // If true archive binary else archive XML
00517         bool fileAsBin ; // If true file binary else file XML   
00518         
00519         std::string version ; 
00520         
00521         Entity entity;
00522         
00523 
00524         
00525         
00526 
00527         // A map for the autoincrementation algorithm
00528         std::map<std::string,int>  noAutoIncIds;
00529         void autoIncrement(std::string key, DelayModelVariableParametersRow* x);
00530 
00531 
00541         DelayModelVariableParametersRow* checkAndAdd(DelayModelVariableParametersRow* x, bool skipCheckUniqueness=false) ;
00542         
00548          void append(DelayModelVariableParametersRow* x) ;
00549          
00555          void addWithoutCheckingUnique(DelayModelVariableParametersRow* x) ;
00556          
00557          
00558 
00559 
00560 
00561 // A data structure to store the pointers on the table's rows.
00562 
00563 // In all cases we maintain a private vector of DelayModelVariableParametersRow s.
00564    std::vector<DelayModelVariableParametersRow * > privateRows;
00565    
00566 
00567                         
00568         std::vector<DelayModelVariableParametersRow *> row;
00569 
00570         
00571         void error() ; //throw(ConversionException);
00572 
00573         
00580         void fromXML(std::string& xmlDoc) ;
00581                 
00582         std::map<std::string, BinaryAttributeReaderFunctor *> unknownAttributes2Functors;
00583 
00588         void setFromMIMEFile(const std::string& directory);
00589         /*
00590         void openMIMEFile(const std::string& directory);
00591         */
00592         void setFromXMLFile(const std::string& directory);
00593         
00601         std::string toMIME(const asdm::ByteOrder* byteOrder=asdm::ByteOrder::Machine_Endianity);
00602   
00603         
00610          void setFromMIME(const std::string & mimeMsg);
00611         
00615         std::string MIMEXMLPart(const asdm::ByteOrder* byteOrder=asdm::ByteOrder::Machine_Endianity);
00616         
00626           void toFile(std::string directory);
00627           
00631           bool loadInProgress;
00632           void checkPresenceInMemory() {
00633                 if (!presentInMemory && !loadInProgress) {
00634                         loadInProgress = true;
00635                         setFromFile(getContainer().getDirectory());
00636                         presentInMemory = true;
00637                         loadInProgress = false;
00638                 }
00639           }
00648          void setFromFile(const std::string& directory);        
00649  
00650 };
00651 
00652 } // End namespace asdm
00653 
00654 #endif /* DelayModelVariableParametersTable_CLASS */
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 31 Aug 2016 for casa by  doxygen 1.6.1