sgp4/libsgp4/DecayedException.h

69 lines
1.1 KiB
C
Raw Normal View History

#ifndef DECAYEDEXCEPTION_H_
#define DECAYEDEXCEPTION_H_
2012-10-11 18:52:51 +00:00
#include "DateTime.h"
#include "Vector.h"
#include <exception>
class DecayedException : public std::exception
{
public:
2012-10-11 18:52:51 +00:00
/**
* Constructor
* @param[in] dt time of the event
* @param[in] pos position of the satellite at dt
* @param[in] vel velocity of the satellite at dt
*/
DecayedException(const DateTime& dt, const Vector& pos, const Vector& vel)
: _dt(dt), _pos(pos), _vel(vel)
{
}
2012-10-11 18:52:51 +00:00
/**
* Destructor
*/
virtual ~DecayedException(void) throw ()
{
}
2012-10-11 18:52:51 +00:00
/**
* @returns the error string
*/
virtual const char* what() const throw ()
{
return "Error: Satellite decayed";
}
2012-10-11 18:52:51 +00:00
/**
* @returns the date
*/
DateTime Decayed() const
{
return _dt;
}
2012-10-11 18:52:51 +00:00
/**
* @returns the position
*/
Vector Position() const
{
return _pos;
}
2012-10-11 18:52:51 +00:00
/**
* @returns the velocity
*/
Vector Velocity() const
{
return _vel;
}
private:
2012-10-11 18:52:51 +00:00
DateTime _dt;
Vector _pos;
Vector _vel;
};
#endif