Skip to content
This repository has been archived by the owner on May 29, 2022. It is now read-only.

C++17 (replace throw with noexcept) #69

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions core/lib/AppFrame/BasicFramework.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ namespace gpstk

BasicFramework :: BasicFramework( const string& applName,
const string& applDesc )
throw()
noexcept
: debugLevel(0),
verboseLevel(0),
exitCode(0),
Expand All @@ -69,7 +69,7 @@ namespace gpstk
bool BasicFramework :: initialize( int argc,
char *argv[],
bool pretty )
throw()
noexcept
{

// Creating the parser here ensures that all the subclasses'
Expand Down Expand Up @@ -122,7 +122,7 @@ namespace gpstk


bool BasicFramework :: run()
throw()
noexcept
{

try
Expand Down
6 changes: 3 additions & 3 deletions core/lib/AppFrame/BasicFramework.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ namespace gpstk
*/
BasicFramework( const std::string& applName,
const std::string& applDesc )
throw();
noexcept;


/// Destructor.
Expand All @@ -130,15 +130,15 @@ namespace gpstk
virtual bool initialize( int argc,
char *argv[],
bool pretty = true )
throw();
noexcept;


/** Run the program. Processes only once (refer to subclasses
* for looped processing).
*
* @return false if an exception occurred
*/
bool run() throw();
bool run() noexcept;


/** A place to store the exit code for the application.
Expand Down
4 changes: 2 additions & 2 deletions core/lib/AppFrame/InOutFramework.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ namespace gpstk
*/
InOutFramework( const std::string& applName,
const std::string& applDesc )
throw()
noexcept
: LoopedFramework(applName, applDesc)
{};

Expand All @@ -90,7 +90,7 @@ namespace gpstk
bool initialize( int argc,
char *argv[],
bool pretty = true )
throw()
noexcept
{
using std::ios;

Expand Down
2 changes: 1 addition & 1 deletion core/lib/AppFrame/LoopedFramework.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ namespace gpstk
*/
LoopedFramework(const std::string& applName,
const std::string& applDesc)
throw()
noexcept
: BasicFramework(applName, applDesc), timeToDie(false)
{ }

Expand Down
2 changes: 1 addition & 1 deletion core/lib/ClockModel/ClockModel.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ namespace gpstk
class ClockModel
{
public:
ClockModel() throw() {};
ClockModel() noexcept {};

virtual double getOffset(const gpstk::CommonTime& t) const = 0;

Expand Down
10 changes: 5 additions & 5 deletions core/lib/ClockModel/EpochClockModel.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ namespace gpstk
: ObsClockModel(sigma, elmask, mode), valid(false), clkc(0){}
#pragma clang diagnostic pop
virtual double getOffset(const gpstk::CommonTime& t) const
throw(gpstk::InvalidArgumentException)
noexcept(false)
{
if (t!=time)
{
Expand All @@ -77,7 +77,7 @@ namespace gpstk
};

virtual bool isOffsetValid(const gpstk::CommonTime& t) const
throw(gpstk::InvalidArgumentException)
noexcept(false)
{
if (t!=time)
{
Expand All @@ -91,12 +91,12 @@ namespace gpstk
// An unchecked accessor for programs that don't need the generic
// interface
double getOffset() const
throw() {return clkc;};
noexcept {return clkc;};

bool isOffsetValid() const
throw() {return valid;};
noexcept {return valid;};

virtual void addEpoch(const ORDEpoch& oe) throw(gpstk::InvalidValue)
virtual void addEpoch(const ORDEpoch& oe) noexcept(false)
{
gpstk::Stats<double> stat = simpleOrdClock(oe);
clkc = stat.Average();
Expand Down
6 changes: 3 additions & 3 deletions core/lib/ClockModel/LinearClockModel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ namespace gpstk
{
using namespace std;

void LinearClockModel::reset() throw()
void LinearClockModel::reset() noexcept
{
startTime = gpstk::CommonTime::END_OF_TIME;
endTime = gpstk::CommonTime::BEGINNING_OF_TIME;
Expand All @@ -60,7 +60,7 @@ namespace gpstk
}

void LinearClockModel::addEpoch(const ORDEpoch& oe)
throw(gpstk::InvalidValue)
noexcept(false)
{
ORDEpoch::ORDMap::const_iterator itr;
const gpstk::CommonTime t=oe.time;
Expand Down Expand Up @@ -137,7 +137,7 @@ namespace gpstk
}
}

void LinearClockModel::dump(std::ostream& s, short detail) const throw()
void LinearClockModel::dump(std::ostream& s, short detail) const noexcept
{
s << "base: " << baseTime
<< ", start: " << startTime
Expand Down
10 changes: 5 additions & 5 deletions core/lib/ClockModel/LinearClockModel.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,24 +64,24 @@ namespace gpstk
:ObsClockModel(sigma, elmask, mode) {reset();};

virtual double getOffset(const gpstk::CommonTime& t) const
throw()
noexcept
{
if (!isOffsetValid(t))
return 0;
else
return clockModel.Slope()*(t-baseTime) + clockModel.Intercept();
};

virtual bool isOffsetValid(const gpstk::CommonTime& t) const throw()
virtual bool isOffsetValid(const gpstk::CommonTime& t) const noexcept
{return t >= startTime && t <= endTime && clockModel.N() > 1;};

/// Add in the given ord to the clock model
virtual void addEpoch(const ORDEpoch& oe) throw(gpstk::InvalidValue);
virtual void addEpoch(const ORDEpoch& oe) noexcept(false);

/// Reset the accumulated statistics on the clock
void reset() throw();
void reset() noexcept;

void dump(std::ostream& s, short detail=1) const throw();
void dump(std::ostream& s, short detail=1) const noexcept;

friend std::ostream& operator<<(std::ostream& s, const LinearClockModel& r)
{ r.dump(s, 0); return s; };
Expand Down
8 changes: 4 additions & 4 deletions core/lib/ClockModel/ORDEpoch.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,15 +62,15 @@ namespace gpstk
/// defines a store for each SV's ord, indexed by prn
typedef std::map<SatID, ObsRngDev> ORDMap;

ORDEpoch& removeORD(const SatID& svid) throw()
ORDEpoch& removeORD(const SatID& svid) noexcept
{
ORDMap::iterator i = ords.find(svid);
if(i != ords.end())
ords.erase(i);
return *this;
}

ORDEpoch& applyClockModel(const ClockModel& cm) throw()
ORDEpoch& applyClockModel(const ClockModel& cm) noexcept
{
if (cm.isOffsetValid(time))
{
Expand All @@ -80,7 +80,7 @@ namespace gpstk
return *this;
}

ORDEpoch& removeOffset(const double offset) throw()
ORDEpoch& removeOffset(const double offset) noexcept
{
ORDMap::iterator i;
for (i = ords.begin(); i != ords.end(); i++)
Expand All @@ -96,7 +96,7 @@ namespace gpstk

friend std::ostream& operator<<(std::ostream& s,
const ORDEpoch& oe)
throw()
noexcept
{
s << "t=" << oe.time
<< " clk=" << oe.clockOffset << std::endl;
Expand Down
10 changes: 5 additions & 5 deletions core/lib/ClockModel/ObsClockModel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ namespace gpstk


ObsClockModel::SvStatus ObsClockModel::getSvStatus(const SatID& svid) const
throw(gpstk::ObjectNotFound)
noexcept(false)
{
SvStatusMap::const_iterator i = status.find(svid);
if(i == status.end())
Expand All @@ -70,7 +70,7 @@ namespace gpstk


ObsClockModel& ObsClockModel::setSvModeMap(const SvModeMap& right)
throw()
noexcept
{
for(int prn = 1; prn <= gpstk::MAX_PRN; prn++)
modes[SatID(prn, SatID::systemGPS)] = IGNORE;
Expand All @@ -83,7 +83,7 @@ namespace gpstk


ObsClockModel::SvMode ObsClockModel::getSvMode(const SatID& svid) const
throw(gpstk::ObjectNotFound)
noexcept(false)
{
SvModeMap::const_iterator i = modes.find(svid);
if(i == modes.end())
Expand All @@ -99,7 +99,7 @@ namespace gpstk


gpstk::Stats<double> ObsClockModel::simpleOrdClock(const ORDEpoch& oe)
throw(gpstk::InvalidValue)
noexcept(false)
{
gpstk::Stats<double> stat;

Expand Down Expand Up @@ -167,7 +167,7 @@ namespace gpstk
return stat;
}

void ObsClockModel::dump(ostream& s, short detail) const throw()
void ObsClockModel::dump(ostream& s, short detail) const noexcept
{
s << "min elev:" << elvmask
<< ", max sigma:" << sigmam
Expand Down
32 changes: 16 additions & 16 deletions core/lib/ClockModel/ObsClockModel.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ namespace gpstk
setSvMode(mode);
}

virtual void addEpoch(const ORDEpoch& re) throw(gpstk::InvalidValue) = 0;
virtual void addEpoch(const ORDEpoch& re) noexcept(false) = 0;

// set accessor methods ----------------------------------------------

Expand All @@ -103,23 +103,23 @@ namespace gpstk
* @param right #SvModeMap
* @return a reference to this object
*/
ObsClockModel& setSvModeMap(const SvModeMap& right) throw();
ObsClockModel& setSvModeMap(const SvModeMap& right) noexcept;

/**
* set the SvMode for a particular SV.
* @param prn Sv number of the SV
* @param mode #SvMode for the SV
* @return a reference to this object
*/
ObsClockModel& setSvMode(const SatID& svid, const SvMode& mode) throw()
ObsClockModel& setSvMode(const SatID& svid, const SvMode& mode) noexcept
{ modes[svid] = mode; return *this; }

/**
* set the SvMode for all SVs
* @param mode #SvMode for the SVs
* @return a reference to this object
*/
ObsClockModel& setSvMode(const SvMode& mode) throw()
ObsClockModel& setSvMode(const SvMode& mode) noexcept
{
for(int prn = 1; prn <= gpstk::MAX_PRN; prn++)
{
Expand All @@ -134,21 +134,21 @@ namespace gpstk
* @param right sigma multiple value
* @return a reference to this object
*/
ObsClockModel& setSigmaMultiplier(double right) throw()
ObsClockModel& setSigmaMultiplier(double right) noexcept
{ sigmam = right; return *this; }

/**
* set the elevation mask angle for ORD stripping.
* @param right elevation mask angle value
* @return a reference to this object
*/
ObsClockModel& setElevationMask(double right) throw()
ObsClockModel& setElevationMask(double right) noexcept
{ elvmask = right; return *this; }

/** Set useWonkyData true and ords that are flagged as wonky
will be included in any clock estimation calculations.
**/
ObsClockModel& setUseWonkyData(bool right) throw()
ObsClockModel& setUseWonkyData(bool right) noexcept
{ useWonkyData = right; return *this; }

// get accessor methods ----------------------------------------------
Expand All @@ -158,7 +158,7 @@ namespace gpstk
* computation.
* @return a const reference to the #SvStatusMap
*/
const SvStatusMap& getSvStatusMap() const throw()
const SvStatusMap& getSvStatusMap() const noexcept
{ return status; };

/**
Expand All @@ -167,39 +167,39 @@ namespace gpstk
* @return #SvStatus
* @exception ObjectNotFound an ORD for that SV is not in the map
*/
SvStatus getSvStatus(const SatID& svid) const throw(ObjectNotFound);
SvStatus getSvStatus(const SatID& svid) const noexcept(false);

/**
* get the map indicating how to use each ORD in the bias computation.
* @return a const reference to the #SvModeMap
*/
const SvModeMap& getSvModeMap() const throw() { return modes; }
const SvModeMap& getSvModeMap() const noexcept { return modes; }

/**
* get how a particular ORD is to be used in the bias computation.
* @param prn the Sv number indicating the mode of interest
* @return #SvMode
* @exception ObjectNotFound a mode for that SV is not in the map
*/
SvMode getSvMode(const SatID& svid) const throw(ObjectNotFound);
SvMode getSvMode(const SatID& svid) const noexcept(false);

/**
* returns the sigma multiple value used for ORD stripping.
* @return sigma multiple
*/
double getSigmaMultiplier() const throw() { return sigmam; }
double getSigmaMultiplier() const noexcept { return sigmam; }

/**
* returns the elevation mask angle used for ORD stripping.
* @return elevation mask angle
*/
double getElevationMask() const throw() { return elvmask; }
double getElevationMask() const noexcept { return elvmask; }


/**
* return the current value of the userWonkyData flag.
*/
bool getUseWonkyData() const throw()
bool getUseWonkyData() const noexcept
{ return useWonkyData; }

/** Computes an average of all ORD in the epoch that pass the
Expand All @@ -208,9 +208,9 @@ namespace gpstk
* statistics. This is effectivly a simple single epoch clock
* model. */
Stats<double> simpleOrdClock(const ORDEpoch& oe)
throw(InvalidValue);
noexcept(false);

virtual void dump(std::ostream& s, short detail=1) const throw();
virtual void dump(std::ostream& s, short detail=1) const noexcept;

friend std::ostream& operator<<(std::ostream& s, const ObsClockModel& r)
{ r.dump(s, 0); return s; };
Expand Down
Loading