LCOV - code coverage report
Current view: top level - alma/ASDM - EphemerisTable.h (source / functions) Hit Total Coverage
Test: casacpp_coverage.info Lines: 7 7 100.0 %
Date: 2024-11-06 17:42:47 Functions: 1 1 100.0 %

          Line data    Source code
       1             : 
       2             : /*
       3             :  * ALMA - Atacama Large Millimeter Array
       4             :  * (c) European Southern Observatory, 2002
       5             :  * (c) Associated Universities Inc., 2002
       6             :  * Copyright by ESO (in the framework of the ALMA collaboration),
       7             :  * Copyright by AUI (in the framework of the ALMA collaboration),
       8             :  * All rights reserved.
       9             :  * 
      10             :  * This library is free software; you can redistribute it and/or
      11             :  * modify it under the terms of the GNU Lesser General Public
      12             :  * License as published by the Free software Foundation; either
      13             :  * version 2.1 of the License, or (at your option) any later version.
      14             :  * 
      15             :  * This library is distributed in the hope that it will be useful,
      16             :  * but WITHOUT ANY WARRANTY, without even the implied warranty of
      17             :  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
      18             :  * Lesser General Public License for more details.
      19             :  * 
      20             :  * You should have received a copy of the GNU Lesser General Public
      21             :  * License along with this library; if not, write to the Free Software
      22             :  * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
      23             :  * MA 02111-1307  USA
      24             :  *
      25             :  * Warning!
      26             :  *  -------------------------------------------------------------------- 
      27             :  * | This is generated code!  Do not modify this file.                  |
      28             :  * | If you do, all changes will be lost when the file is re-generated. |
      29             :  *  --------------------------------------------------------------------
      30             :  *
      31             :  * File EphemerisTable.h
      32             :  */
      33             :  
      34             : #ifndef EphemerisTable_CLASS
      35             : #define EphemerisTable_CLASS
      36             : 
      37             : #include <string>
      38             : #include <vector>
      39             : #include <map>
      40             : 
      41             : 
      42             : 
      43             :         
      44             : #include <alma/ASDM/ArrayTimeInterval.h>
      45             :         
      46             : 
      47             :         
      48             : #include <alma/ASDM/ArrayTime.h>
      49             :         
      50             : 
      51             : 
      52             : 
      53             : 
      54             :         
      55             : 
      56             :         
      57             : 
      58             :         
      59             : 
      60             :         
      61             : 
      62             :         
      63             : 
      64             :         
      65             : 
      66             :         
      67             : 
      68             :         
      69             : 
      70             :         
      71             : 
      72             :         
      73             : 
      74             :         
      75             : 
      76             :         
      77             : 
      78             : 
      79             : 
      80             : #include <alma/ASDM/ConversionException.h>
      81             : #include <alma/ASDM/DuplicateKey.h>
      82             : #include <alma/ASDM/UniquenessViolationException.h>
      83             : #include <alma/ASDM/NoSuchRow.h>
      84             : #include <alma/ASDM/DuplicateKey.h>
      85             : 
      86             : 
      87             : #ifndef WITHOUT_ACS
      88             : #include <asdmIDLC.h>
      89             : #endif
      90             : 
      91             : #include <alma/ASDM/Representable.h>
      92             : 
      93             : #include <pthread.h>
      94             : 
      95             : namespace asdm {
      96             : 
      97             : //class asdm::ASDM;
      98             : //class asdm::EphemerisRow;
      99             : 
     100             : class ASDM;
     101             : class EphemerisRow;
     102             : /**
     103             :  * The EphemerisTable class is an Alma table.
     104             :  * <BR>
     105             :  * 
     106             :  * \par Role
     107             :  * 
     108             :  * <BR>
     109             :  
     110             :  * Generated from model's revision "-1", branch ""
     111             :  *
     112             :  * <TABLE BORDER="1">
     113             :  * <CAPTION> Attributes of Ephemeris </CAPTION>
     114             :  * <TR BGCOLOR="#AAAAAA"> <TH> Name </TH> <TH> Type </TH> <TH> Expected shape  </TH> <TH> Comment </TH></TR>
     115             :  
     116             :  * <TR> <TH BGCOLOR="#CCCCCC" colspan="4" align="center"> Key </TD></TR>
     117             :         
     118             :  * <TR>
     119             :                 
     120             :  * <TD> timeInterval </TD>
     121             :                  
     122             :  * <TD> ArrayTimeInterval</TD>
     123             :  * <TD> &nbsp; </TD>
     124             :  * <TD> &nbsp;interval of time during which the data are relevant.  </TD>
     125             :  * </TR>
     126             :         
     127             :  * <TR>
     128             :                 
     129             :  * <TD> ephemerisId </TD>
     130             :                  
     131             :  * <TD> int</TD>
     132             :  * <TD> &nbsp; </TD>
     133             :  * <TD> &nbsp;identifies a collection of rows in the table.  </TD>
     134             :  * </TR>
     135             :         
     136             : 
     137             : 
     138             :  * <TR> <TH BGCOLOR="#CCCCCC"  colspan="4" valign="center"> Value <br> (Mandatory) </TH></TR>
     139             :         
     140             :  * <TR>
     141             :  * <TD> observerLocation </TD> 
     142             :  * <TD> std::vector<double > </TD>
     143             :  * <TD>  3 </TD> 
     144             :  * <TD> &nbsp;a triple of double precision values defining the observer location. This triple contains in that order the longitude, the latitude and the altitude of the observer :
     145             : <ul>
     146             : <li> the longitude is expressed in radian. An east (resp. west) longitude is denoted as a positive (resp. negative) quantity.</li>
     147             : <li> the latitude is expressed in radian. A north (resp. south) latitude is denoted as a positive (resp. negative) quantity. </li>
     148             : <li> the altitude is expressed in meter. It's the altitude above the reference ellipsoid. </li>
     149             : </ul>
     150             : A triple with all its elements equal to 0.0 will mean that a geocentric coordinate system is in use instead of a topocentric one. </TD>
     151             :  * </TR>
     152             :         
     153             :  * <TR>
     154             :  * <TD> equinoxEquator </TD> 
     155             :  * <TD> double </TD>
     156             :  * <TD>  &nbsp;  </TD> 
     157             :  * <TD> &nbsp;epoch at which equator and equinox were calculated for ephemeris. Expresses a year as a decimal value (J2000 would be represented as 2000.0). </TD>
     158             :  * </TR>
     159             :         
     160             :  * <TR>
     161             :  * <TD> numPolyDir (numPolyDir)</TD> 
     162             :  * <TD> int </TD>
     163             :  * <TD>  &nbsp;  </TD> 
     164             :  * <TD> &nbsp;the number of coefficients of the polynomial stored in phaseDir. It has to be \f$ \ge 1 \f$.  </TD>
     165             :  * </TR>
     166             :         
     167             :  * <TR>
     168             :  * <TD> dir </TD> 
     169             :  * <TD> std::vector<std::vector<double > > </TD>
     170             :  * <TD>  numPolyDir, 2 </TD> 
     171             :  * <TD> &nbsp;the ephemeris direction expressed in radian. The nominal entry in the phaseDir, delayDir, or ReferenceDir in the Field table serves as additional offset to the direction described by "dir". The actual direction is obtained by composition, e.g. actual phase direction = [phasDir value from Field table] + [dir].
     172             : 
     173             : The direction described by dir  is the result of the sum
     174             : 
     175             : \f[ dir_{0,i} + dir_{1,i}*dt + dir_{2,i}*dt^2 + ... + dir_{numPolyDir-1,i}*dt^{numPolyDir-1}, \forall i \in \{0,1\} \f]
     176             : 
     177             : where
     178             : 
     179             : \f[ dt = t - timeOrigin \f] 
     180             :  </TD>
     181             :  * </TR>
     182             :         
     183             :  * <TR>
     184             :  * <TD> numPolyDist (numPolyDist)</TD> 
     185             :  * <TD> int </TD>
     186             :  * <TD>  &nbsp;  </TD> 
     187             :  * <TD> &nbsp;the number of coefficients of the polynomial stored in distance. It has to be \f$ \ge 1 \f$.  </TD>
     188             :  * </TR>
     189             :         
     190             :  * <TR>
     191             :  * <TD> distance </TD> 
     192             :  * <TD> std::vector<double > </TD>
     193             :  * <TD>  numPolyDist </TD> 
     194             :  * <TD> &nbsp;the coefficiens of the polynomial used to calculate the distance, expressed in meter,  to the object from the position of the antenna along the given direction. This distance is the result of the sum :
     195             : 
     196             : \f[ distance_0 + distance_1*dt + distance_2*dt^2 + ... + distance_{numPolyDist-1}*dt^{numPolyDist-1} \f]
     197             : 
     198             : where
     199             : 
     200             : \f[ dt = t - timeOrigin \f].
     201             :  </TD>
     202             :  * </TR>
     203             :         
     204             :  * <TR>
     205             :  * <TD> timeOrigin </TD> 
     206             :  * <TD> ArrayTime </TD>
     207             :  * <TD>  &nbsp;  </TD> 
     208             :  * <TD> &nbsp;the time origin used in the evaluation of the polynomial expressions.  </TD>
     209             :  * </TR>
     210             :         
     211             :  * <TR>
     212             :  * <TD> origin </TD> 
     213             :  * <TD> std::string </TD>
     214             :  * <TD>  &nbsp;  </TD> 
     215             :  * <TD> &nbsp;the origin of the ephemeris information. </TD>
     216             :  * </TR>
     217             :         
     218             : 
     219             : 
     220             :  * <TR> <TH BGCOLOR="#CCCCCC"  colspan="4" valign="center"> Value <br> (Optional) </TH></TR>
     221             :         
     222             :  * <TR>
     223             :  * <TD> numPolyRadVel(numPolyRadVel)</TD> 
     224             :  * <TD> int </TD>
     225             :  * <TD>  &nbsp; </TD>
     226             :  * <TD>&nbsp; the number of coefficients of the polynomial stored in radVel . It has to be \f$ \ge 1 \f$.  </TD>
     227             :  * </TR>
     228             :         
     229             :  * <TR>
     230             :  * <TD> radVel</TD> 
     231             :  * <TD> std::vector<double > </TD>
     232             :  * <TD>  numPolyRadVel  </TD>
     233             :  * <TD>&nbsp;  the coefficients of a polynomial expressing a radial velocity as a function of the time expressed in m/s. The time origin used to tabulate the polynomial is stored in timeOrigin.   </TD>
     234             :  * </TR>
     235             :         
     236             : 
     237             :  * </TABLE>
     238             :  */
     239             : class EphemerisTable : public Representable {
     240             :         friend class ASDM;
     241             : 
     242             : public:
     243             : 
     244             : 
     245             :         /**
     246             :          * Return the list of field names that make up key key
     247             :          * as an array of strings.
     248             :          * @return a vector of string.
     249             :          */     
     250             :         static const std::vector<std::string>& getKeyName();
     251             : 
     252             : 
     253             :         virtual ~EphemerisTable();
     254             :         
     255             :         /**
     256             :          * Return the container to which this table belongs.
     257             :          *
     258             :          * @return the ASDM containing this table.
     259             :          */
     260             :         ASDM &getContainer() const;
     261             :         
     262             :         /**
     263             :          * Return the number of rows in the table.
     264             :          *
     265             :          * @return the number of rows in an unsigned int.
     266             :          */
     267             :         unsigned int size() const;
     268             :         
     269             :         /**
     270             :          * Return the name of this table.
     271             :          *
     272             :          * This is a instance method of the class.
     273             :          *
     274             :          * @return the name of this table in a string.
     275             :          */
     276             :         std::string getName() const;
     277             :         
     278             :         /**
     279             :          * Return the name of this table.
     280             :          *
     281             :          * This is a static method of the class.
     282             :          *
     283             :          * @return the name of this table in a string.
     284             :          */
     285             :         static std::string name() ;     
     286             :         
     287             :         /**
     288             :          * Return the version information about this table.
     289             :          *
     290             :          */
     291             :          std::string getVersion() const ;
     292             :         
     293             :         /**
     294             :          * Return the names of the attributes of this table.
     295             :          *
     296             :          * @return a vector of string
     297             :          */
     298             :          static const std::vector<std::string>& getAttributesNames();
     299             : 
     300             :         /**
     301             :          * Return the default sorted list of attributes names in the binary representation of the table.
     302             :          *
     303             :          * @return a const reference to a vector of string
     304             :          */
     305             :          static const std::vector<std::string>& defaultAttributesNamesInBin();
     306             :          
     307             :         /**
     308             :          * Return this table's Entity.
     309             :          */
     310             :         Entity getEntity() const;
     311             : 
     312             :         /**
     313             :          * Set this table's Entity.
     314             :          * @param e An entity. 
     315             :          */
     316             :         void setEntity(Entity e);
     317             :                 
     318             :         /**
     319             :          * Produces an XML representation conform
     320             :          * to the schema defined for Ephemeris (EphemerisTable.xsd).
     321             :          *
     322             :          * @returns a string containing the XML representation.
     323             :          * @throws ConversionException
     324             :          */
     325             :         std::string toXML()  ;
     326             : 
     327             : #ifndef WITHOUT_ACS
     328             :         // Conversion Methods
     329             :         /**
     330             :          * Convert this table into a EphemerisTableIDL CORBA structure.
     331             :          *
     332             :          * @return a pointer to a EphemerisTableIDL
     333             :          */
     334             :         asdmIDL::EphemerisTableIDL *toIDL() ;
     335             :         
     336             :         /**
     337             :          * Fills the CORBA data structure passed in parameter
     338             :          * with the content of this table.
     339             :          *
     340             :          * @param x a reference to the asdmIDL::EphemerisTableIDL to be populated
     341             :          * with the content of this.
     342             :          */
     343             :          void toIDL(asdmIDL::EphemerisTableIDL& x) const;
     344             :          
     345             : #endif
     346             : 
     347             : #ifndef WITHOUT_ACS
     348             :         /**
     349             :          * Populate this table from the content of a EphemerisTableIDL Corba structure.
     350             :          *
     351             :          * @throws DuplicateKey Thrown if the method tries to add a row having a key that is already in the table.
     352             :          * @throws ConversionException
     353             :          */     
     354             :         void fromIDL(asdmIDL::EphemerisTableIDL x) ;
     355             : #endif
     356             :         
     357             :         //
     358             :         // ====> Row creation.
     359             :         //
     360             :         
     361             :         /**
     362             :          * Create a new row with default values.
     363             :          * @return a pointer on a EphemerisRow
     364             :          */
     365             :         EphemerisRow *newRow();
     366             :         
     367             :         
     368             :         /**
     369             :          * Create a new row initialized to the specified values.
     370             :          * @return a pointer on the created and initialized row.
     371             :         
     372             :          * @param timeInterval
     373             :         
     374             :          * @param ephemerisId
     375             :         
     376             :          * @param observerLocation
     377             :         
     378             :          * @param equinoxEquator
     379             :         
     380             :          * @param numPolyDir
     381             :         
     382             :          * @param dir
     383             :         
     384             :          * @param numPolyDist
     385             :         
     386             :          * @param distance
     387             :         
     388             :          * @param timeOrigin
     389             :         
     390             :          * @param origin
     391             :         
     392             :      */
     393             :         EphemerisRow *newRow(ArrayTimeInterval timeInterval, int ephemerisId, std::vector<double > observerLocation, double equinoxEquator, int numPolyDir, std::vector<std::vector<double > > dir, int numPolyDist, std::vector<double > distance, ArrayTime timeOrigin, std::string origin);
     394             :         
     395             : 
     396             : 
     397             :         /**
     398             :          * Create a new row using a copy constructor mechanism.
     399             :          * 
     400             :          * The method creates a new EphemerisRow owned by this. Each attribute of the created row 
     401             :          * is a (deep) copy of the corresponding attribute of row. The method does not add 
     402             :          * the created row to this, its simply parents it to this, a call to the add method
     403             :          * has to be done in order to get the row added (very likely after having modified
     404             :          * some of its attributes).
     405             :          * If row is null then the method returns a new EphemerisRow with default values for its attributes. 
     406             :          *
     407             :          * @param row the row which is to be copied.
     408             :          */
     409             :          EphemerisRow *newRow(EphemerisRow *row); 
     410             : 
     411             :         //
     412             :         // ====> Append a row to its table.
     413             :         //
     414             :  
     415             :         
     416             :         /**
     417             :          * Add a row.
     418             :          * @param x a pointer to the EphemerisRow to be added.
     419             :          *
     420             :          * @return a pointer to a EphemerisRow. If the table contains a EphemerisRow whose attributes (key and mandatory values) are equal to x ones
     421             :          * then returns a pointer on that EphemerisRow, otherwise returns x.
     422             :          *
     423             :          * @throw DuplicateKey { thrown when the table contains a EphemerisRow with a key equal to the x one but having
     424             :          * and a value section different from x one }
     425             :          *
     426             :         
     427             :          * @note The row is inserted in the table in such a way that all the rows having the same value of
     428             :          * ( ephemerisId ) are stored by ascending time.
     429             :          * @see method getByContext.
     430             :         
     431             :          */
     432             :         EphemerisRow* add(EphemerisRow* x) ; 
     433             : 
     434             :  
     435             : 
     436             : 
     437             : 
     438             :         //
     439             :         // ====> Methods returning rows.
     440             :         //
     441             :                 
     442             :         /**
     443             :          * Get a collection of pointers on the rows of the table.
     444             :          * @return Alls rows in a vector of pointers of EphemerisRow. The elements of this vector are stored in the order 
     445             :          * in which they have been added to the EphemerisTable.
     446             :          */
     447             :         std::vector<EphemerisRow *> get() ;
     448             :         
     449             :         /**
     450             :          * Get a const reference on the collection of rows pointers internally hold by the table.
     451             :          * @return A const reference of a vector of pointers of EphemerisRow. The elements of this vector are stored in the order 
     452             :          * in which they have been added to the EphemerisTable.
     453             :          *
     454             :          */
     455             :          const std::vector<EphemerisRow *>& get() const ;
     456             :         
     457             : 
     458             :         /**
     459             :          * Returns all the rows sorted by ascending startTime for a given context. 
     460             :          * The context is defined by a value of ( ephemerisId ).
     461             :          *
     462             :          * @return a pointer on a vector<EphemerisRow *>. A null returned value means that the table contains
     463             :          * no EphemerisRow for the given ( ephemerisId ).
     464             :          *
     465             :          * @throws IllegalAccessException when a call is done to this method when it's called while the dataset has been imported with the 
     466             :          * option checkRowUniqueness set to false.
     467             :          */
     468             :          std::vector <EphemerisRow*> *getByContext(int ephemerisId);
     469             :          
     470             : 
     471             : 
     472             :  
     473             :         
     474             :         /**
     475             :          * Returns a EphemerisRow* given a key.
     476             :          * @return a pointer to the row having the key whose values are passed as parameters, or 0 if
     477             :          * no row exists for that key.
     478             :         
     479             :          * @param timeInterval
     480             :         
     481             :          * @param ephemerisId
     482             :         
     483             :          *
     484             :          */
     485             :         EphemerisRow* getRowByKey(ArrayTimeInterval timeInterval, int ephemerisId);
     486             : 
     487             :                 
     488             : 
     489             : 
     490             : 
     491             :         /**
     492             :          * Look up the table for a row whose all attributes 
     493             :          * are equal to the corresponding parameters of the method.
     494             :          * @return a pointer on this row if any, null otherwise.
     495             :          *
     496             :                         
     497             :          * @param timeInterval
     498             :                         
     499             :          * @param ephemerisId
     500             :                         
     501             :          * @param observerLocation
     502             :                         
     503             :          * @param equinoxEquator
     504             :                         
     505             :          * @param numPolyDir
     506             :                         
     507             :          * @param dir
     508             :                         
     509             :          * @param numPolyDist
     510             :                         
     511             :          * @param distance
     512             :                         
     513             :          * @param timeOrigin
     514             :                         
     515             :          * @param origin
     516             :                          
     517             :          */
     518             :         EphemerisRow* lookup(ArrayTimeInterval timeInterval, int ephemerisId, std::vector<double > observerLocation, double equinoxEquator, int numPolyDir, std::vector<std::vector<double > > dir, int numPolyDist, std::vector<double > distance, ArrayTime timeOrigin, std::string origin); 
     519             : 
     520             : 
     521             :         void setUnknownAttributeBinaryReader(const std::string& attributeName, BinaryAttributeReaderFunctor* barFctr);
     522             :         BinaryAttributeReaderFunctor* getUnknownAttributeBinaryReader(const std::string& attributeName) const;
     523             : 
     524             : private:
     525             : 
     526             :         /**
     527             :          * Create a EphemerisTable.
     528             :          * <p>
     529             :          * This constructor is private because only the
     530             :          * container can create tables.  All tables must know the container
     531             :          * to which they belong.
     532             :          * @param container The container to which this table belongs.
     533             :          */ 
     534             :         EphemerisTable (ASDM & container);
     535             : 
     536             :         ASDM & container;
     537             :         
     538             :         bool archiveAsBin; // If true archive binary else archive XML
     539             :         bool fileAsBin ; // If true file binary else file XML   
     540             :         
     541             :         std::string version ; 
     542             :         
     543             :         Entity entity;
     544             :         
     545             : 
     546             :         
     547             :         
     548             : 
     549             : 
     550             :         /**
     551             :          * If this table has an autoincrementable attribute then check if *x verifies the rule of uniqueness and throw exception if not.
     552             :          * Check if *x verifies the key uniqueness rule and throw an exception if not.
     553             :          * Append x to its table.
     554             :          * @throws DuplicateKey
     555             :          
     556             :          */
     557             :         EphemerisRow* checkAndAdd(EphemerisRow* x, bool skipCheckUniqueness=false) ;
     558             :         
     559             :         /**
     560             :          * Brutally append an EphemerisRow x to the collection of rows already stored in this table. No uniqueness check is done !
     561             :          *
     562             :          * @param EphemerisRow* x a pointer onto the EphemerisRow to be appended.
     563             :          */
     564             :          void append(EphemerisRow* x) ;
     565             :          
     566             :         /**
     567             :          * Brutally append an EphemerisRow x to the collection of rows already stored in this table. No uniqueness check is done !
     568             :          *
     569             :          * @param EphemerisRow* x a pointer onto the EphemerisRow to be appended.
     570             :          */
     571             :          void addWithoutCheckingUnique(EphemerisRow* x) ;
     572             :          
     573             :          
     574             : 
     575             : 
     576             :         
     577             :         
     578             :         /**
     579             :          * Insert a EphemerisRow* in a vector of EphemerisRow* so that it's ordered by ascending time.
     580             :          *
     581             :          * @param EphemerisRow* x . The pointer to be inserted.
     582             :          * @param vector <EphemerisRow*>& row . A reference to the vector where to insert x.
     583             :          *
     584             :          */
     585             :          EphemerisRow * insertByStartTime(EphemerisRow* x, std::vector<EphemerisRow* >& row);
     586             :           
     587             : 
     588             : 
     589             : // A data structure to store the pointers on the table's rows.
     590             : 
     591             : // In all cases we maintain a private vector of EphemerisRow s.
     592             :    std::vector<EphemerisRow * > privateRows;
     593             :    
     594             : 
     595             :         
     596             : 
     597             :         
     598             :         
     599             :                 
     600             :                                 
     601             :         typedef std::vector <EphemerisRow* > TIME_ROWS;
     602             :         std::map<std::string, TIME_ROWS > context;
     603             :                 
     604             :         /** 
     605             :          * Returns a string built by concatenating the ascii representation of the
     606             :          * parameters values suffixed with a "_" character.
     607             :          */
     608             :          std::string Key(int ephemerisId) ;
     609             :                  
     610             :                 
     611             :         
     612             :         
     613             :         /**
     614             :          * Fills the vector vout (passed by reference) with pointers on elements of vin 
     615             :          * whose attributes are equal to the corresponding parameters of the method.
     616             :          *
     617             :          */
     618             :         void getByKeyNoAutoIncNoTime(std::vector <EphemerisRow*>& vin, std::vector <EphemerisRow*>& vout,  int ephemerisId);
     619             :         
     620             : 
     621             :         
     622             :         void error() ; //throw(ConversionException);
     623             : 
     624             :         
     625             :         /**
     626             :          * Populate this table from the content of a XML document that is required to
     627             :          * be conform to the XML schema defined for a Ephemeris (EphemerisTable.xsd).
     628             :          * @throws ConversionException
     629             :          * 
     630             :          */
     631             :         void fromXML(std::string& xmlDoc) ;
     632             :                 
     633             :         std::map<std::string, BinaryAttributeReaderFunctor *> unknownAttributes2Functors;
     634             : 
     635             :         /**
     636             :           * Private methods involved during the build of this table out of the content
     637             :           * of file(s) containing an external representation of a Ephemeris table.
     638             :           */
     639             :         void setFromMIMEFile(const std::string& directory);
     640             :         /*
     641             :         void openMIMEFile(const std::string& directory);
     642             :         */
     643             :         void setFromXMLFile(const std::string& directory);
     644             :         
     645             :                  /**
     646             :          * Serialize this into a stream of bytes and encapsulates that stream into a MIME message.
     647             :          * @returns a string containing the MIME message.
     648             :          *
     649             :          * @param byteOrder a const pointer to a static instance of the class ByteOrder.
     650             :          * 
     651             :          */
     652             :         std::string toMIME(const asdm::ByteOrder* byteOrder=asdm::ByteOrder::Machine_Endianity);
     653             :   
     654             :         
     655             :    /** 
     656             :      * Extracts the binary part of a MIME message and deserialize its content
     657             :          * to fill this with the result of the deserialization. 
     658             :          * @param mimeMsg the string containing the MIME message.
     659             :          * @throws ConversionException
     660             :          */
     661             :          void setFromMIME(const std::string & mimeMsg);
     662             :         
     663             :         /**
     664             :           * Private methods involved during the export of this table into disk file(s).
     665             :           */
     666             :         std::string MIMEXMLPart(const asdm::ByteOrder* byteOrder=asdm::ByteOrder::Machine_Endianity);
     667             :         
     668             :         /**
     669             :           * Stores a representation (binary or XML) of this table into a file.
     670             :           *
     671             :           * Depending on the boolean value of its private field fileAsBin a binary serialization  of this (fileAsBin==true)  
     672             :           * will be saved in a file "Ephemeris.bin" or an XML representation (fileAsBin==false) will be saved in a file "Ephemeris.xml".
     673             :           * The file is always written in a directory whose name is passed as a parameter.
     674             :          * @param directory The name of directory  where the file containing the table's representation will be saved.
     675             :           * 
     676             :           */
     677             :           void toFile(std::string directory);
     678             :           
     679             :           /**
     680             :            * Load the table in memory if necessary.
     681             :            */
     682             :           bool loadInProgress;
     683          93 :           void checkPresenceInMemory() {
     684          93 :                 if (!presentInMemory && !loadInProgress) {
     685           9 :                         loadInProgress = true;
     686           9 :                         setFromFile(getContainer().getDirectory());
     687           9 :                         presentInMemory = true;
     688           9 :                         loadInProgress = false;
     689             :                 }
     690          93 :           }
     691             :         /**
     692             :          * Reads and parses a file containing a representation of a EphemerisTable as those produced  by the toFile method.
     693             :          * This table is populated with the result of the parsing.
     694             :          * @param directory The name of the directory containing the file te be read and parsed.
     695             :          * @throws ConversionException If any error occurs while reading the 
     696             :          * files in the directory or parsing them.
     697             :          *
     698             :          */
     699             :          void setFromFile(const std::string& directory);    
     700             :  
     701             : };
     702             : 
     703             : } // End namespace asdm
     704             : 
     705             : #endif /* EphemerisTable_CLASS */

Generated by: LCOV version 1.16