• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ GPSTK_THROW函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中GPSTK_THROW函数的典型用法代码示例。如果您正苦于以下问题:C++ GPSTK_THROW函数的具体用法?C++ GPSTK_THROW怎么用?C++ GPSTK_THROW使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了GPSTK_THROW函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: throw

      /* Computes the quantile function ( cdf^-1() )
       *
       * @param p    Probability value
       *
       * \ warning Value "p" must be in the range (0, 1)
       */
   double GaussianDistribution::invcdf(double p)
      throw(InvalidParameter)
   {

      double inf( 9.0e+99 );

         // Check limits
      if( ( p < 0.0 ) ||
          ( p > 1.0 ) )
      {
         InvalidParameter e( "Invalid input value for 'p'." );
         GPSTK_THROW(e);
      }

      if( p == 0.0 ) return -inf;
      if( p == 1.0 ) return inf;

         // Compute invcdf
      return ( mean
             + 1.4142135623730951 * sigma * gpstk::inverf( 2.0 * p - 1.0 ) );

   }  // End of method 'GaussianDistribution::invcdf()'
开发者ID:JC5005,项目名称:GPSTk,代码行数:28,代码来源:GaussianDistribution.cpp


示例2: throw

      /* Returns a reference to a gnnsRinex object after solving
       * the previously defined equation system.
       *
       * @param gData     Data object holding the data.
       */
   gnssRinex& SolverPPPFB::Process(gnssRinex& gData)
      throw(ProcessingException)
   {

      try
      {

         SolverPPP::Process(gData);


            // Before returning, store the results for a future iteration
         if(firstIteration)
         {

               // Create a new gnssRinex structure with just the data we need
            gnssRinex gBak(gData.extractTypeID(keepTypeSet));

               // Store observation data
            ObsData.push_back(gBak);

            // Update the number of processed measurements
            processedMeasurements += gData.numSats();

         }

         return gData;

      }
      catch(Exception& u)
      {
            // Throw an exception if something unexpected happens
         ProcessingException e( getClassName() + ":"
                                + u.what() );

         GPSTK_THROW(e);

      }

   }  // End of method 'SolverPPPFB::Process()'
开发者ID:PPNav,项目名称:GPSTk,代码行数:44,代码来源:SolverPPPFB.cpp


示例3: throw

   FileSpec::FileSpecType FileSpec::convertFileSpecType(const string& fst)
      throw(FileSpecException)
   {
      if (fst == string("n"))        return station;
      else if (fst == string("r"))   return receiver;
      else if (fst == string("p"))   return prn;
      else if (fst == string("t"))   return selected;
      else if (fst == string("I"))   return sequence;
      else if (fst == string("v"))   return version;
      else if (fst == string("k"))   return clock;
      else if (fst == string("x"))   return text;

      else if (fst == string("Y") || 
               fst == string("y"))   return year;
      else if (fst == string("m"))   return month;
      else if (fst == string("d"))   return dayofmonth;
      else if (fst == string("H"))   return hour;
      else if (fst == string("M"))   return minute;
      else if (fst == string("S"))   return second;
      else if (fst == string("f"))   return fsecond;
      else if (fst == string("G"))   return gpsweek;
      else if (fst == string("F"))   return fullgpsweek;
      else if (fst == string("g"))   return gpssecond;
      else if (fst == string("Q"))   return mjd;
      else if (fst == string("w"))   return dayofweek;
      else if (fst == string("j"))   return day;
      else if (fst == string("s"))   return doysecond;
      else if (fst == string("Z"))   return zcount;
      else if (fst == string("z"))   return zcountfloor;
      else if (fst == string("U"))   return unixsec;
      else if (fst == string("u"))   return unixusec;
      else if (fst == string("C") ||
               fst == string("c"))   return fullzcount;
      else
      {
         FileSpecException fse("Unknown FileSpecType: " + fst);
         GPSTK_THROW(fse);
      }
   }
开发者ID:JC5005,项目名称:GPSTk,代码行数:39,代码来源:FileSpec.cpp


示例4: throw

      /* Set the number of degrees of freedom.
       *
       * @param n       Degrees of freedom
       *
       * \warning "n" must be > 0.0, otherwise n = |n|.
       */
   StudentDistribution& StudentDistribution::setNDF(int n)
      throw(InvalidParameter)
   {

      if( n == 0 )
      {
         InvalidParameter e( "Invalid value for NDF." );
         GPSTK_THROW(e);
      }

      if( n < 0 )
      {
         ndf = -n;
      }
      else
      {
         ndf = n;
      }

      return (*this);

   }  // End of method 'StudentDistribution::setNDF()'
开发者ID:PPNav,项目名称:GPSTk,代码行数:28,代码来源:StudentDistribution.cpp


示例5: throw

   void RinexNavData::getBroadcastOrbit6(const string& currentLine)
      throw(StringException, FFStreamError)
   {
      try
      {
         double SV_health;

         accuracy = gpstk::StringUtils::for2doub(currentLine.substr(3,19));
         SV_health = gpstk::StringUtils::for2doub(currentLine.substr(22,19));
         Tgd = gpstk::StringUtils::for2doub(currentLine.substr(41,19));
         IODC = gpstk::StringUtils::for2doub(currentLine.substr(60,19));


         health = (short) SV_health;
      }
      catch (std::exception &e)
      {
         FFStreamError err("std::exception: " +
                           string(e.what()));
         GPSTK_THROW(err);
      }
   }
开发者ID:vestuto,项目名称:GPSTk,代码行数:22,代码来源:RinexNavData.cpp


示例6: fromString

      void fromString(const std::string str)
      {
         std::string STR(gpstk::StringUtils::upperCase(str));
         if(STR == std::string("GPUT"))
            { type = GPUT; frTS = TimeSystem::GPS; toTS = TimeSystem::UTC; }

         else if(STR == std::string("GAUT"))
            { type = GAUT; frTS = TimeSystem::GAL; toTS = TimeSystem::UTC; }

         else if(STR == std::string("SBUT"))
            // TD ??
            { type = SBUT; frTS = TimeSystem::GPS; toTS = TimeSystem::UTC; }

         else if(STR == std::string("GLUT"))
            { type = GLUT; frTS = TimeSystem::GLO; toTS = TimeSystem::UTC; }
            
         else if(STR == std::string("GPGA"))
            { type = GPGA; frTS = TimeSystem::GPS; toTS = TimeSystem::GAL; }
            
         else if(STR == std::string("GLGP"))
            { type = GLGP; frTS = TimeSystem::GLO; toTS = TimeSystem::GPS; }
            
         else if(STR == std::string("QZGP"))
            { type = QZGP; frTS = TimeSystem::QZS; toTS = TimeSystem::GPS; }
            
         else if(STR == std::string("QZUT"))
            { type = QZUT; frTS = TimeSystem::QZS; toTS = TimeSystem::UTC; }
            
         else if(STR == std::string("BDUT"))
            { type = BDUT; frTS = TimeSystem::BDT; toTS = TimeSystem::UTC; }
            
         else if(STR == std::string("BDGP"))
            { type = BDGP; frTS = TimeSystem::BDT; toTS = TimeSystem::GPS; }
            
         else {
            Exception e("Unknown TimeSystemCorrection type: " + str);
            GPSTK_THROW(e);
         }
      }
开发者ID:Milfhunter,项目名称:gpstk,代码行数:39,代码来源:TimeSystemCorr.hpp


示例7: MEstimate

   T MEstimate(const T *xd, int nd, const T& M, const T& MAD, T *w=NULL)
      throw(Exception)
   {
      try {
         T tv, m, mold, sum, sumw, *wt, weight, *t;
         T tol=0.000001;
         int i, n, N=10;      // N is the max number of iterations

         if(!xd || nd < 2) {
            Exception e("Invalid input");
            GPSTK_THROW(e);
         }

         tv = T(RobustTuningT)*MAD;
         n = 0;
         m = M;
         do {
            mold = m;
            n++;
            sum = sumw = T();
            for(i=0; i<nd; i++) {
               if(w) wt=&w[i];
               else wt=&weight;
               *wt = T(1);
               if(xd[i]<m-tv)      *wt = -tv/(xd[i]-m);
               else if(xd[i]>m+tv) *wt =  tv/(xd[i]-m);
               sumw += (*wt);
               sum += (*wt)*xd[i];
            }
            m = sum / sumw;

         } while(T(ABSOLUTE((m-mold)/m)) > tol && n < N);

         return m;
      }
      catch(Exception& e) { GPSTK_RETHROW(e); }

   }  // end MEstimate
开发者ID:ianmartin,项目名称:GPSTk,代码行数:38,代码来源:RobustStats.hpp


示例8: throw

   // Compute the pressure and temperature at height, and the undulation,
   // for the given position and time.
   void GlobalTropModel::getGPT(double& P, double& T, double& U)
      throw(InvalidTropModel)
   {
      try { testValidity(); }
      catch(InvalidTropModel& e) { GPSTK_RETHROW(e); }
      
      int i;

      // undulation and orthometric height
      U = 0.0;
      for(i=0; i<55; i++) U += (Ageoid[i]*aP[i] + Bgeoid[i]*bP[i]);
      double orthoht(height - U);
      if(orthoht > 44247.) GPSTK_THROW(InvalidTropModel(
                           "Invalid Global trop model: Rx Height is too large"));

      // press at geoid
      double am(0.0),aa(0.0),v0;
      for(i=0; i<55; i++) {
         am += (APressMean[i]*aP[i] + BPressMean[i]*bP[i]);
         aa += (APressAmp[i]*aP[i] + BPressAmp[i]*bP[i]);
      }
      v0 = am + aa * ::cos(dayfactor);
      
      // pressure at height
      // NB this implies any orthoht > 1/2.26e-5 == 44247.78m is invalid!
      P = v0 * ::pow(1.0-2.26e-5*orthoht,5.225);

      // temper on geoid
      am = aa = 0.0;
      for(i=0; i<55; i++) {
         am += (ATempMean[i]*aP[i] + BTempMean[i]*bP[i]);
         aa += (ATempAmp[i]*aP[i] + BTempAmp[i]*bP[i]);
      }
      v0 = am + aa * ::cos(dayfactor);

      // temp at height
      T = v0 - 6.5e-3 * orthoht;
   }
开发者ID:SGL-UT,项目名称:GPSTk,代码行数:40,代码来源:GlobalTropModel.cpp


示例9: cfIBeta

 // Compute continued fractions portion of incomplete beta function I_x(a,b)
 /// Routine used internally for Incomplete beta function I_x(a,b)
 double cfIBeta(const double& x, const double& a, const double& b) throw(Exception)
 {
    static const int imax(100);
    static const double eps(10*std::numeric_limits<double>().epsilon());
    static const double fpmin(10*std::numeric_limits<double>().min());
    const double qab(a+b);
    const double qap(a+1.0);
    const double qam(a-1.0);
    double c(1),d(1-qab*x/qap),aa,del;
    if(::fabs(d) < fpmin) d=fpmin;
    d = 1.0/d;
    double h(d);
    int i,i2;
    for(i=1; i<=imax; i++) {
       i2 = 2*i;
       aa = i*(b-i)*x/((qam+i2)*(a+i2));
       d = 1.0 + aa*d;
       if(::fabs(d) < fpmin) d=fpmin;
       c = 1.0 + aa/c;
       if(::fabs(c) < fpmin) c=fpmin;
       d = 1.0/d;
       h *= d*c;
       aa = -(a+i)*(qab+i)*x/((a+i2)*(qap+i2));
       d = 1.0 + aa*d;
       if(::fabs(d) < fpmin) d=fpmin;
       c = 1.0 + aa/c;
       if(::fabs(c) < fpmin) c=fpmin;
       d = 1.0/d;
       del = d*c;
       h *= del;
       if(::fabs(del-1.0) < eps) break;
    }
    if(i > imax) {
       Exception e("Overflow in cfIBeta(); a or b too big");
       GPSTK_THROW(e);
    }
    return h;
 }
开发者ID:JC5005,项目名称:GPSTk,代码行数:40,代码来源:SpecialFunctions.hpp


示例10: throw

      /* Dumps data from a satTypeValueMap object.
       *
       * @param gData     Data object holding the data.
       */
   satTypeValueMap& Dumper::Process( satTypeValueMap& gData )
      throw(ProcessingException)
   {

      try
      {

            // Iterate through all items in the GNSS Data Structure
         for( satTypeValueMap::const_iterator it = gData.begin();
              it!= gData.end();
              it++ )
         {

               // First, print satellite (system and PRN)
            *outStr << (*it).first << " ";

               // Now, print TypeIDs
            printTypeID( (*it).second );

               // Print end of line
            *outStr << std::endl;

         }  // End of 'for( satTypeValueMap::const_iterator it = ...'

         return gData;

      }
      catch(Exception& u)
      {
            // Throw an exception if something unexpected happens
         ProcessingException e( getClassName() + ":"
                                + u.what() );

         GPSTK_THROW(e);

      }

   }  // End of method 'Dumper::Process()'
开发者ID:rwpenney,项目名称:GPSTk,代码行数:42,代码来源:Dumper.cpp


示例11: throw

      /* Returns a gnnsSatTypeValue object, adding the new data generated
       *  when calling this object.
       *
       * @param gData    Data object holding the data.
       */
   gnssSatTypeValue& PhaseCodeAlignment::Process(gnssSatTypeValue& gData)
      throw(ProcessingException)
   {

      try
      {

         Process(gData.header.epoch, gData.body);

         return gData;

      }
      catch(Exception& u)
      {
            // Throw an exception if something unexpected happens
         ProcessingException e( getClassName() + ":"
                                + u.what() );

         GPSTK_THROW(e);

      }

   }  // End of 'PhaseCodeAlignment::Process()'
开发者ID:etschneider,项目名称:GPSTk,代码行数:28,代码来源:PhaseCodeAlignment.cpp


示例12: throw

      /* Returns a gnnsRinex object, adding the new data generated when
       * calling this object.
       *
       * @param gData    Data object holding the data.
       */
   gnssRinex& LICSDetector::Process(gnssRinex& gData)
      throw(ProcessingException)
   {

      try
      {

         Process(gData.header.epoch, gData.body, gData.header.epochFlag);

         return gData;

      }
      catch(Exception& u)
      {
            // Throw an exception if something unexpected happens
         ProcessingException e( getClassName() + ":"
                                + u.what() );

         GPSTK_THROW(e);

      }

   }  // End of method 'LICSDetector::Process()'
开发者ID:Milfhunter,项目名称:gpstk,代码行数:28,代码来源:LICSDetector.cpp


示例13: throw

      /* Returns a gnnsRinex object, adding the new data generated
       * when calling this object.
       *
       * @param gData    Data object holding the data.
       */
   gnssRinex& ComputeSimpleWeights::Process(gnssRinex& gData)
      throw(ProcessingException)
   {

      try
      {

         Process(gData.header.epoch, gData.body);

         return gData;

      }
      catch(Exception& u)
      {
            // Throw an exception if something unexpected happens
         ProcessingException e( getClassName() + ":"
                                + u.what() );

         GPSTK_THROW(e);

      }

   }  // End of method 'ComputeSimpleWeightsWeights::Process()'
开发者ID:PPNav,项目名称:GPSTk,代码行数:28,代码来源:ComputeSimpleWeights.cpp


示例14: throw

      /* Returns a gnnsRinex object, adding the new data generated when
       *  calling this object.
       *
       * @param gData    Data object holding the data.
       */
   gnssRinex& EclipsedSatFilter::Process(gnssRinex& gData)
      throw(ProcessingException)
   {

      try
      {

         Process(gData.header.epoch, gData.body);

         return gData;

      }
      catch(Exception& u)
      {
            // Throw an exception if something unexpected happens
         ProcessingException e( getClassName() + ":"
                                + u.what() );

         GPSTK_THROW(e);

      }

   }  // End of 'EclipsedSatFilter::Process()'
开发者ID:PPNav,项目名称:GPSTk,代码行数:28,代码来源:EclipsedSatFilter.cpp


示例15: GPSTK_THROW

 // Dump the overhead information as a string containing a single line.
 // @throw Invalid Request if the required data has not been stored.
 string GPSEphemeris::asString(void) const
 {
    if(!dataLoadedFlag)
       GPSTK_THROW(InvalidRequest("Data not loaded"));
    try {
       ostringstream os;
       CivilTime ct;
       os << "EPH G" << setfill('0') << setw(2) << satID.id << setfill(' ');
       ct = CivilTime(beginValid);
       os << printTime(ct," | %4Y %3j %02H:%02M:%02S |");
       ct = CivilTime(ctToe);
       os << printTime(ct," %3j %02H:%02M:%02S |");
       ct = CivilTime(ctToc);
       os << printTime(ct," %3j %02H:%02M:%02S |");
       ct = CivilTime(endValid);
       os << printTime(ct," %3j %02H:%02M:%02S |");
       ct = CivilTime(transmitTime);
       os << printTime(ct," %3j %02H:%02M:%02S | ");
       os << setw(3) << IODE << " | " << setw(3) << IODC << " | " << health;
       return os.str();
    }
    catch(Exception& e) { GPSTK_RETHROW(e);
    }
 }
开发者ID:JC5005,项目名称:GPSTk,代码行数:26,代码来源:GPSEphemeris.cpp


示例16: throw

      /* Compute the satellite clock bias (sec) at the given time
       *
       * @param epoch   Epoch to compute satellite clock bias.
       *
       * @throw InvalidRequest if required data has not been stored.
       */
   double GloEphemeris::svClockBias(const CommonTime& epoch) const
      throw( gpstk::InvalidRequest )
   {

         // First, let's check if there is valid data
      if(!valid)
      {
         InvalidRequest exc("svClockBias(): No valid data stored.");
         GPSTK_THROW(exc);
      }

         // Auxiliar object
      Xvt sv;
      sv.x = x;
      sv.v = v;

         // In the GLONASS system, 'clkbias' already includes the relativistic
         // correction, therefore we must substract the late from the former.
      sv.relcorr = sv.computeRelativityCorrection();
      sv.clkbias = clkbias + clkdrift * (epoch - ephTime) - sv.relcorr;

      return sv.clkbias;

   }  // End of method 'GloEphemeris::svClockBias(const CommonTime& epoch)'
开发者ID:JC5005,项目名称:GPSTk,代码行数:30,代码来源:GloEphemeris.cpp


示例17: fromString

    void fromString(const std::string s)
    throw(Exception)
    {
        char c;
        std::istringstream iss(s);

        id = -1;
        system = systemGPS;  // default
        if(s.find_first_not_of(std::string(" \t\n"), 0) == std::string::npos)
            return;                    // all whitespace yields the default

        iss >> c;                     // read one character (non-whitespace)
        switch(c)
        {
        // no leading system character
        case '0':
        case '1':
        case '2':
        case '3':
        case '4':
        case '5':
        case '6':
        case '7':
        case '8':
        case '9':
            iss.putback(c);
            system = SatID::systemGPS;
            break;
        case 'R':
        case 'r':
            system = SatID::systemGlonass;
            break;
        case 'T':
        case 't':
            system = SatID::systemTransit;
            break;
        case 'S':
        case 's':
            system = SatID::systemGeosync;
            break;
        case 'E':
        case 'e':
            system = SatID::systemGalileo;
            break;
        case 'M':
        case 'm':
            system = SatID::systemMixed;
            break;
        case ' ':
        case 'G':
        case 'g':
            system = SatID::systemGPS;
            break;
        default:                   // non-RINEX system character
            Exception e(std::string("Invalid system character \"")
                        + c + std::string("\""));
            GPSTK_THROW(e);
        }
        iss >> id;
        if(id <= 0) id = -1;
    }
开发者ID:ianmartin,项目名称:GPSTk,代码行数:61,代码来源:RinexSatID.hpp


示例18: doSatAtt

// -----------------------------------------------------------------------------------
// Compute the satellite attitude, given the time and the satellite position SV.
// If the SolarSystem is valid, use it; otherwise use SolarPosition.
// See two versions of SatelliteAttitude() for the user interface.
// Return a 3x3 Matrix which contains, as rows, the unit (ECEF) vectors X,Y,Z in the
// body frame of the satellite, namely
//    Z = along the boresight (i.e. towards Earth center),
//    Y = perpendicular to both Z and the satellite-sun direction, and
//    X = completing the orthonormal triad. X will generally point toward the sun.
// Thus this rotation matrix R * (ECEF XYZ vector) = components in body frame, and
// R.transpose() * (sat. body. frame vector) = ECEF XYZ components.
// Also return the shadow factor = fraction of sun's area not visible to satellite.
Matrix<double> doSatAtt(const CommonTime& tt, const Position& SV,
                        const SolarSystem& SSEph, const EarthOrientation& EO,
                        double& sf)
   throw(Exception)
{
   try {
      int i;
      double d,svrange,DistSun,AngRadSun,AngRadEarth,AngSeparation;
      Position X,Y,Z,T,S,Sun;
      Matrix<double> R(3,3);

      // Z points from satellite to Earth center - along the antenna boresight
      Z = SV;
      Z.transformTo(Position::Cartesian);
      svrange = Z.mag();
      d = -1.0/Z.mag();
      Z = d * Z;                                // reverse and normalize Z

      // get the Sun's position
      if(SSEph.JPLNumber() > -1) {
         //SolarSystem& mySSEph=const_cast<SolarSystem&>(SSEph);
         Sun = const_cast<SolarSystem&>(SSEph).WGS84Position(SolarSystem::Sun,tt,EO);
      }
      else {
         double AR;
         Sun = SolarPosition(tt, AR);
      }
      DistSun = Sun.radius();

      // apparent angular radius of sun = 0.2666/distance in AU (deg)
      AngRadSun = 0.2666/(DistSun/149598.0e6);
      AngRadSun *= DEG_TO_RAD;

      // angular radius of earth at sat
      AngRadEarth = ::asin(6378137.0/svrange);

      // T points from satellite to sun
      T = Sun;                                  // vector earth to sun
      T.transformTo(Position::Cartesian);
      S = SV;
      S.transformTo(Position::Cartesian);
      T = T - S;                                // sat to sun=(E to sun)-(E to sat)
      d = 1.0/T.mag();
      T = d * T;                                // normalize T

      AngSeparation = ::acos(Z.dot(T));         // apparent angular distance, earth
                                                // to sun, as seen at satellite
      // is satellite in eclipse?
      try { sf = ShadowFactor(AngRadEarth, AngRadSun, AngSeparation); }
      catch(Exception& e) { GPSTK_RETHROW(e); }

      // Y is perpendicular to Z and T, such that ...
      Y = Z.cross(T);
      d = 1.0/Y.mag();
      Y = d * Y;                                // normalize Y

      // ... X points generally in the direction of the sun
      X = Y.cross(Z);                           // X will be unit vector
      if(X.dot(T) < 0) {                        // need to reverse X, hence Y also
         X = -1.0 * X;
         Y = -1.0 * Y;
      }

      // fill the matrix and return it
      for(i=0; i<3; i++) {
         R(0,i) = X[i];
         R(1,i) = Y[i];
         R(2,i) = Z[i];
      }

      return R;
   }
   catch(Exception& e) { GPSTK_RETHROW(e); }
   catch(exception& e) {Exception E("std except: "+string(e.what())); GPSTK_THROW(E);}
   catch(...) { Exception e("Unknown exception"); GPSTK_THROW(e); }
}
开发者ID:JC5005,项目名称:GPSTk,代码行数:88,代码来源:SunEarthSatGeometry.cpp


示例19: throw

      /* Method to check if a given section/variable pair exists.
       *
       * @param variable   Variable name.
       * @param section    Section the variable belongs to.
       *
       */
   bool ConfDataReader::ifExist( string variable,
                                 string section )
      throw(ConfigurationException)
   {

         // Let's make sure that section and variable names are uppercase
      section  = StringUtils::upperCase(section);
      variable = StringUtils::upperCase(variable);

         // Check if section and variable exist
      confMap::const_iterator it;
      it = confData.find(section);
      if( it != confData.end() )
      {
         variableMap::const_iterator it2;
         it2 = (*it).second.find(variable);
         if( it2 != (*it).second.end() )
         {

            // Return the corresponding value, if it exists
            return true;

         }
         else
         {

            if(issueException)
            {

                  // Throw an exception if variable name doesn't exist
               ConfigurationException e(
                                    "Variable '" + variable
                                    + "' in section '" + section
                                    + "' of configuration file '" + filename
                                    + "' does not exist.");

               GPSTK_THROW(e);

            }
            else
            {

               return false;

            }  // End of 'if(issueException)'

         }  // End of 'if( it2 != (*it).second.end() )'

      }
      else
      {

         if(issueException)
         {

               // Check if problem is with section "DEFAULT"
            if ( section == "DEFAULT" )
            {

                  // Throw an exception if section name doesn't exist
               ConfigurationException e(
                                    "Section 'DEFAULT' in configuration file '"
                                    + filename
                                    + "' does not exist. Does file '"
                                    + filename + "' exist?. Do you have "
                                    + "permission to read it?." );

               GPSTK_THROW(e);

            }
            else
            {

                  // Throw an exception if section name doesn't exist
               ConfigurationException e(
                                    "Section '" + section
                                    + "' in configuration file '" + filename
                                    + "' does not exist.");

               GPSTK_THROW(e);

            }  // End of 'if ( section == "DEFAULT" )'

         }
         else
         {

            return false;

         }  // End of 'if(issueException)'

      }  // End of 'if( it != confData.end() )'

   }  // End of method 'ConfDataReader::ifExist()'
开发者ID:rwpenney,项目名称:GPSTk,代码行数:100,代码来源:ConfDataReader.cpp


示例20: throw

   void
   Data::reallyGetRecord(FFStream& s)
      throw(std::exception, FFStreamError, StringUtils::StringException)
   {
      Sinex::Stream&  strm = dynamic_cast<Sinex::Stream&>(s);
      bool    terminated = false;
      string  currentBlock;
      string  line;
      blocks.clear();
      strm.formattedGetLine(line, true);  /// EOF possible
      try
      {
         header = line;
      }
      catch (Exception& exc)
      {
         FFStreamError  err(exc);
         GPSTK_THROW(err);
      }
      while (strm.good() )
      {
         try
         {
            strm.formattedGetLine(line, true);  /// EOF possible
         }
         catch (EndOfFile&  e)
         {
            break;
         }
         if (line.size() < 1)
         {
            FFStreamError err("Invalid empty line.");
            GPSTK_THROW(err);
         }
         switch (line[0])
         {
            case BLOCK_START:
            {
               if (currentBlock.size() > 0)
               {
                  FFStreamError err("Unexpected start of block.");
                  GPSTK_THROW(err);
               }
               currentBlock = line.substr(1);
               BlockFactory::iterator i = blockFactory.find(currentBlock);
               if (i == blockFactory.end() )
               {
                  string  errMsg("Invalid block title: ");
                  FFStreamError err(errMsg + currentBlock);
                  GPSTK_THROW(err);
               }
               BlockCreateFunc  createFunc = i->second;
               BlockBase  *block = createFunc();
               if (block)
               {
                  try
                  {
                     block->getBlock(strm);
                     blocks.push_back(block);
                  }
                  catch (Exception& exc)
                  {
                     FFStreamError  err(exc);
                     GPSTK_THROW(err);
                  }
               }
               else
               {
                  string  errMsg("Error creating block: ");
                  FFStreamError err(errMsg + currentBlock);
                  GPSTK_THROW(err);
               }
               break;
            }
            case BLOCK_END:
            {
               if (currentBlock.size() == 0)
               {
                  FFStreamError err("Unexpected end of block.");
                  GPSTK_THROW(err);
               }
               if (currentBlock.compare(line.substr(1) ) != 0)
               {
                  FFStreamError err("Block start and end do not match.");
                  GPSTK_THROW(err);
               }
               currentBlock.clear();
               break;
            }
            case DATA_START:
            {
               FFStreamError err("Missing start of block.");
               GPSTK_THROW(err);
               break;
            }
            case HEAD_TAIL_START:
            {
               if (line.compare("%ENDSNX") == 0)
               {
                  terminated = true;
//.........这里部分代码省略.........
开发者ID:rwpenney,项目名称:GPSTk,代码行数:101,代码来源:SinexData.cpp



注:本文中的GPSTK_THROW函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ GPU_Log函数代码示例发布时间:2022-05-30
下一篇:
C++ GPSR函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap