TypeID.hpp

Go to the documentation of this file.
00001 #pragma ident "$Id: TypeID.hpp 2936 2011-10-23 19:01:00Z yanweignss $"
00002 
00012 #ifndef GPSTK_TYPEID_HPP
00013 #define GPSTK_TYPEID_HPP
00014 
00015 //============================================================================
00016 //
00017 //  This file is part of GPSTk, the GPS Toolkit.
00018 //
00019 //  The GPSTk is free software; you can redistribute it and/or modify
00020 //  it under the terms of the GNU Lesser General Public License as published
00021 //  by the Free Software Foundation; either version 2.1 of the License, or
00022 //  any later version.
00023 //
00024 //  The GPSTk is distributed in the hope that it will be useful,
00025 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
00026 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00027 //  GNU Lesser General Public License for more details.
00028 //
00029 //  You should have received a copy of the GNU Lesser General Public
00030 //  License along with GPSTk; if not, write to the Free Software Foundation,
00031 //  Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00032 //
00033 //  Dagoberto Salazar - gAGE ( http://www.gage.es ). 2007, 2008, 2009
00034 //
00035 //============================================================================
00036 
00037 
00038 #include <iostream>
00039 #include <iomanip>
00040 #include <sstream>
00041 #include <string>
00042 #include <map>
00043 #include "RinexObsHeader.hpp"
00044 
00045 
00046 namespace gpstk
00047 {
00051    class RegTypeID
00052    {
00053    public:
00055       virtual void regAll()
00056       {
00057          // TypeID t = TypeID::registerTypeID("prefitP1","prefitResidualP1");
00058       }
00059    };
00060 
00084    class TypeID
00085    {
00086    public:
00087 
00089       enum ValueType
00090       {
00091          Unknown,
00092             // Observation-related types
00093          C1,        
00094          C2,        
00095          P1,        
00096          P2,        
00097          L1,        
00098          L2,        
00099          D1,        
00100          D2,        
00101          S1,        
00102          S2,        
00103          T1,        
00104          T2,        
00105          SSI1,      
00106          LLI1,      
00107          SSI2,      
00108          LLI2,      
00109             // v 2.11
00110          C5,        
00111          L5,        
00112          D5,        
00113          S5,        
00114          SSI5,      
00115          LLI5,      
00116             // Galileo-related
00117          C6,        
00118          L6,        
00119          D6,        
00120          S6,        
00121          SSI6,      
00122          LLI6,      
00123          C7,        
00124          L7,        
00125          D7,        
00126          S7,        
00127          SSI7,      
00128          LLI7,      
00129          C8,        
00130          L8,        
00131          D8,        
00132          S8,        
00133          SSI8,      
00134          LLI8,      
00135             // Combination-related types
00136          PC,        
00137          LC,        
00138          PI,        
00139          LI,        
00140          Pdelta,    
00141          Ldelta,    
00142          MWubbena,  
00143          GRAPHIC1,  
00144          GRAPHIC2,  
00145          GRAPHIC5,  
00146          GRAPHIC6,  
00147          GRAPHIC7,  
00148          GRAPHIC8,  
00149          WL,        
00150          WL1,       
00151          WL2,       
00152          WL3,       
00153          WL4,       
00154          EWL,       
00155             // Derivatives of observations and combinations
00156          L1dot,     
00157          L1dot2,    
00158          L2dot,     
00159          L2dot2,    
00160          L5dot,     
00161          L5dot2,    
00162          P1dot,     
00163          P1dot2,    
00164          P2dot,     
00165          P2dot2,    
00166          P5dot,     
00167          P5dot2,    
00168          L6dot,     
00169          L6dot2,    
00170          L7dot,     
00171          L7dot2,    
00172          L8dot,     
00173          L8dot2,    
00174          LCdot,     
00175          LCdot2,    
00176          LIdot,     
00177          LIdot2,    
00178          Ldeltadot, 
00179          Ldeltadot2,
00180             // Model-related types
00181          rho,       
00182          rhodot,    
00183          rhodot2,   
00184          dtSat,     
00185          dtSatdot,  
00186          dtSatdot2, 
00187          rel,       
00188          gravDelay, 
00189          tropo,     
00190          dryTropo,  
00191          dryMap,    
00192          wetTropo,  
00193          wetMap,    
00194          tropoSlant, 
00195          iono,      
00196          ionoTEC,   
00197          ionoMap,   
00198          ionoMap2,  
00199          ionoL1,    
00200          ionoL2,    
00201          ionoL5,    
00202          ionoL6,    
00203          ionoL7,    
00204          ionoL8,    
00205          windUp,    
00206          satPCenter,
00207          satX,      
00208          satY,      
00209          satZ,      
00210          satVX,     
00211          satVY,     
00212          satVZ,     
00213          satAX,     
00214          satAY,     
00215          satAZ,     
00216          satJ2kX,   
00217          satJ2kY,   
00218          satJ2kZ,   
00219          satJ2kVX,  
00220          satJ2kVY,  
00221          satJ2kVZ,  
00222          satJ2kAX,  
00223          satJ2kAY,  
00224          satJ2kAZ,  
00225          elevation, 
00226          azimuth,   
00227             // Cycle slip flags
00228          CSL1,      
00229          CSL2,      
00230          CSL5,      
00231          CSL6,      
00232          CSL7,      
00233          CSL8,      
00234             // Satellite 'arcs'
00235          satArc,    
00236             // Phase-ambiguity types
00237          BL1,       
00238          BL2,       
00239          BL5,       
00240          BL6,       
00241          BL7,       
00242          BL8,       
00243          BLC,       
00244          BWL,       
00245          BWL2,      
00246          BWL3,      
00247          BWL4,      
00248             // Multipath-related types
00249          mpC1,      
00250          mpC2,      
00251          mpC5,      
00252          mpC6,      
00253          mpC7,      
00254          mpC8,      
00255          mpL1,      
00256          mpL2,      
00257          mpL5,      
00258          mpL6,      
00259          mpL7,      
00260          mpL8,      
00261             // Instrumental delays types
00262          instC1,    
00263          instC2,    
00264          instC5,    
00265          instC6,    
00266          instC7,    
00267          instC8,    
00268          instL1,    
00269          instL2,    
00270          instL5,    
00271          instL6,    
00272          instL7,    
00273          instL8,    
00274             // Equation system-related types
00275          prefitP1,  
00276          prefitP2,  
00277          prefitL1,  
00278          prefitL2,  
00279          postfitP1, 
00280          postfitP2, 
00281          postfitL1, 
00282          postfitL2, 
00283          prefitC5,  
00284          prefitL5,  
00285          postfitC5, 
00286          postfitL5, 
00287          prefitGRAPHIC1,   
00288          prefitGRAPHIC2,   
00289          postfitGRAPHIC1,  
00290          postfitGRAPHIC2,  
00291          prefitMWubbena,   
00292          prefitWL,  
00293          prefitWL2, 
00294          prefitWL3, 
00295          prefitWL4, 
00296          postfitWL, 
00297          postfitWL2,
00298          postfitWL3,
00299          postfitWL4,
00300          prefitC,   
00301          prefitL,   
00302          postfitC,  
00303          postfitL,  
00304          dx,        
00305          dy,        
00306          dz,        
00307          dLat,      
00308          dLon,      
00309          dH,        
00310          cdt,       
00311          cdtSat,    
00312          dSatX,     
00313          dSatY,     
00314          dSatZ,     
00315          dSatR,     
00316          dSatT,     
00317          dSatN,     
00318          weight,    
00319          codeBias,  
00320          cdtC1,     
00321          cdtP1,     
00322          cdtC2,     
00323          cdtP2,     
00324          cdtC5,     
00325          cdtP5,     
00326          cdtL1,     
00327          cdtL2,     
00328          cdtL5,     
00329          cdtPC,     
00330          cdtLC,     
00331          cdtWL,     
00332          cdtWL2,    
00333          cdtWL3,    
00334          cdtWL4,    
00335          cdtMW,     
00336          cdtSatC1,  
00337          cdtSatP1,  
00338          cdtSatC2,  
00339          cdtSatP2,  
00340          cdtSatC5,  
00341          cdtSatP5,  
00342          cdtSatL1,  
00343          cdtSatL2,  
00344          cdtSatL5,  
00345          cdtSatPC,  
00346          cdtSatLC,  
00347          cdtSatWL,  
00348          cdtSatMW,  
00349             // Other types
00350          recX,      
00351          recY,      
00352          recZ,      
00353          recVX,     
00354          recVY,     
00355          recVZ,     
00356          recAX,     
00357          recAY,     
00358          recAZ,     
00359          recLat,    
00360          recLon,    
00361          recH,      
00362          recVLat,   
00363          recVLon,   
00364          recVH,     
00365          recALat,   
00366          recALon,   
00367          recAH,     
00368          recJ2kX,   
00369          recJ2kY,   
00370          recJ2kZ,   
00371          recJ2kVX,  
00372          recJ2kVY,  
00373          recJ2kVZ,  
00374          recJ2kAX,  
00375          recJ2kAY,  
00376          recJ2kAZ,  
00377          sigma,     
00378          iura,      
00379             // Handy dummy types for non-standard processing
00380          dummy0,    
00381          dummy1,    
00382          dummy2,    
00383          dummy3,    
00384          dummy4,    
00385          dummy5,    
00386          dummy6,    
00387          dummy7,    
00388          dummy8,    
00389          dummy9,    
00390 
00391          Last,      
00392          Placeholder = Last+1000
00393       };
00394 
00395 
00397       TypeID()
00398          : type(Unknown) {};
00399 
00400 
00409       TypeID(ValueType vt)
00410          : type(vt) {};
00411 
00412 
00414       virtual bool operator==(const TypeID& right) const
00415       { return type==right.type; };
00416 
00417 
00421       virtual bool operator<(const TypeID& right) const
00422       { return type < right.type; };
00423 
00424 
00426       bool operator!=(const TypeID& right) const
00427       { return !(operator==(right)); };
00428 
00429 
00431       bool operator>(const TypeID& right) const
00432       {  return (!operator<(right) && !operator==(right)); };
00433 
00434 
00436       bool operator<=(const TypeID& right) const
00437       { return (operator<(right) || operator==(right)); };
00438 
00439 
00441       bool operator>=(const TypeID& right) const
00442       { return !(operator<(right)); };
00443 
00444 
00446       virtual TypeID operator=(const TypeID& right);
00447 
00448 
00450       virtual std::ostream& dump(std::ostream& s) const;
00451 
00452 
00455       virtual bool isValid() const;
00456 
00457 
00459       virtual ~TypeID() {};
00460 
00461 
00465       static ValueType newValueType(const std::string& s);
00466 
00467 
00469       ValueType type;
00470 
00471 
00473       static std::map< ValueType, std::string > tStrings;
00474 
00475 
00476    public:
00477       class Initializer
00478       {
00479       public:
00480          Initializer();
00481       };
00482 
00483       static Initializer TypeIDsingleton;
00484 
00485    public:
00486 
00493       static void regTypeIDs(RegTypeID* pReg, bool bAdd = false);
00494     
00495 
00500       static TypeID byName(std::string name) 
00501          throw(InvalidRequest);
00502 
00508       static TypeID regByName(std::string name,std::string desc);
00509       
00511       static void unregByName(std::string name);
00512 
00514       static void unregAll();
00515 
00516    private:
00517 
00519       static bool bUserTypeIDRegistered;
00520 
00522       static std::map<std::string,TypeID> mapUserTypeID;
00523 
00524 
00525    }; // End of class 'TypeID'
00526 
00527 
00528 
00529    namespace StringUtils
00530    {
00532       std::string asString(const TypeID& p);
00533    }
00534 
00535 
00536 
00538    std::ostream& operator<<(std::ostream& s, const TypeID& p);
00539 
00540 
00541 
00543    TypeID::ValueType RinexType2TypeID(const RinexObsHeader::RinexObsType& rot);
00544 
00545 
00546 
00547 }  // End of namespace gpstk
00548 
00549 #endif   // GPSTK_TYPEID_HPP

Generated on Tue May 22 03:31:02 2012 for GPS ToolKit Software Library by  doxygen 1.3.9.1