PointingTable.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 PointingTable.h
00032  */
00033  
00034 #ifndef PointingTable_CLASS
00035 #define PointingTable_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 <ArrayTime.h>
00048 using  asdm::ArrayTime;
00049 
00050 #include <Angle.h>
00051 using  asdm::Angle;
00052 
00053 #include <Tag.h>
00054 using  asdm::Tag;
00055 
00056 #include <ArrayTimeInterval.h>
00057 using  asdm::ArrayTimeInterval;
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 #include "CDirectionReferenceCode.h"
00088 using namespace DirectionReferenceCodeMod;
00089         
00090 
00091         
00092 
00093         
00094 
00095 
00096 
00097 #include <ConversionException.h>
00098 #include <DuplicateKey.h>
00099 #include <UniquenessViolationException.h>
00100 #include <NoSuchRow.h>
00101 #include <DuplicateKey.h>
00102 using asdm::DuplicateKey;
00103 using asdm::ConversionException;
00104 using asdm::NoSuchRow;
00105 using asdm::DuplicateKey;
00106 
00107 #ifndef WITHOUT_ACS
00108 #include <asdmIDLC.h>
00109 using asdmIDL::PointingTableIDL;
00110 #endif
00111 
00112 #include <Representable.h>
00113 
00114 namespace asdm {
00115 
00116 //class asdm::ASDM;
00117 //class asdm::PointingRow;
00118 
00119 class ASDM;
00120 class PointingRow;
00271 class PointingTable : public Representable {
00272         friend class ASDM;
00273 
00274 public:
00275 
00276 
00282         static vector<string> getKeyName();
00283 
00284 
00285         virtual ~PointingTable();
00286         
00292         ASDM &getContainer() const;
00293         
00299         unsigned int size() ;
00300         
00306         string getName() const;
00307         
00313          static const vector<string>& getAttributesNames();
00314 
00318         Entity getEntity() const;
00319 
00324         void setEntity(Entity e);
00325                 
00333         string toXML()  ;
00334 
00335 #ifndef WITHOUT_ACS
00336         // Conversion Methods
00342         PointingTableIDL *toIDL() ;
00343 #endif
00344 
00345 #ifndef WITHOUT_ACS
00346 
00352         void fromIDL(PointingTableIDL x) ;
00353 #endif
00354         
00355         //
00356         // ====> Row creation.
00357         //
00358         
00363         PointingRow *newRow();
00364         
00365         
00395         PointingRow *newRow(Tag antennaId, ArrayTimeInterval timeInterval, int numSample, vector<vector<Angle > > encoder, bool pointingTracking, bool usePolynomials, ArrayTime timeOrigin, int numTerm, vector<vector<Angle > > pointingDirection, vector<vector<Angle > > target, vector<vector<Angle > > offset, int pointingModelId);
00396         
00397 
00398 
00411          PointingRow *newRow(PointingRow *row); 
00412 
00413         //
00414         // ====> Append a row to its table.
00415         //
00416  
00417         
00434         PointingRow* add(PointingRow* x) ; 
00435 
00436  
00437 
00438 
00439 
00440         //
00441         // ====> Methods returning rows.
00442         //
00443                 
00449         vector<PointingRow *> get() ;
00450         
00451 
00459          vector <PointingRow*> *getByContext(Tag antennaId);
00460          
00461 
00462 
00463  
00464         
00476         PointingRow* getRowByKey(Tag antennaId, ArrayTimeInterval timeInterval);
00477 
00478                 
00479 
00480 
00481 
00513         PointingRow* lookup(Tag antennaId, ArrayTimeInterval timeInterval, int numSample, vector<vector<Angle > > encoder, bool pointingTracking, bool usePolynomials, ArrayTime timeOrigin, int numTerm, vector<vector<Angle > > pointingDirection, vector<vector<Angle > > target, vector<vector<Angle > > offset, int pointingModelId); 
00514 
00515 
00516 private:
00517 
00526         PointingTable (ASDM & container);
00527 
00528         ASDM & container;
00529         
00530         bool archiveAsBin; // If true archive binary else archive XML
00531         bool fileAsBin ; // If true file binary else file XML   
00532         
00533         Entity entity;
00534         
00535 
00536 
00540         static string tableName;
00541         
00545         static const vector<string> attributesNames;
00546         
00550         static vector<string> initAttributesNames();
00551 
00552 
00556         static vector<string> key;
00557 
00558 
00566         PointingRow* checkAndAdd(PointingRow* x) ;
00567 
00568 
00569         
00570         
00578          PointingRow * insertByStartTime(PointingRow* x, vector<PointingRow* >& row);
00579           
00580 
00581 
00582 // A data structure to store the pointers on the table's rows.
00583 
00584 // In all cases we maintain a private vector of PointingRow s.
00585    vector<PointingRow * > privateRows;
00586    
00587 
00588         
00589 
00590         
00591         
00592                 
00593                                 
00594         typedef vector <PointingRow* > TIME_ROWS;
00595         map<string, TIME_ROWS > context;
00596                 
00601          string Key(Tag antennaId) ;
00602                  
00603                 
00604         
00605         
00611         void getByKeyNoAutoIncNoTime(vector <PointingRow*>& vin, vector <PointingRow*>& vout,  Tag antennaId);
00612         
00613 
00614         
00615         void error() ; //throw(ConversionException);
00616 
00617         
00624         void fromXML(string xmlDoc) ;
00625                 
00630         void setFromMIMEFile(const string& directory);
00631         void setFromXMLFile(const string& directory);
00632         
00640         string toMIME(const asdm::ByteOrder* byteOrder=asdm::ByteOrder::Machine_Endianity);
00641   
00642         
00649          void setFromMIME(const string & mimeMsg);
00650         
00654         string MIMEXMLPart(const asdm::ByteOrder* byteOrder=asdm::ByteOrder::Machine_Endianity);
00655         
00665           void toFile(string directory);
00666           
00675          void setFromFile(const string& directory);     
00676  
00677 };
00678 
00679 } // End namespace asdm
00680 
00681 #endif /* PointingTable_CLASS */
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines