1 /***************************************************************************** 2 * Copyright (C) 2004-2018 The pykep development team, * 3 * Advanced Concepts Team (ACT), European Space Agency (ESA) * 4 * * 5 * https://gitter.im/esa/pykep * 6 * https://github.com/esa/pykep * 7 * * 8 * act@esa.int * 9 * * 10 * This program is free software; you can redistribute it and/or modify * 11 * it under the terms of the GNU General Public License as published by * 12 * the Free Software Foundation; either version 2 of the License, or * 13 * (at your option) any later version. * 14 * * 15 * This program 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 * 18 * GNU General Public License for more details. * 19 * * 20 * You should have received a copy of the GNU General Public License * 21 * along with this program; if not, write to the * 22 * Free Software Foundation, Inc., * 23 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 24 *****************************************************************************/ 25 26 #ifndef KEP_TOOLBOX_SPACECRAFT_H 27 #define KEP_TOOLBOX_SPACECRAFT_H 28 29 #include <iostream> 30 31 #include <keplerian_toolbox/detail/visibility.hpp> 32 #include <keplerian_toolbox/serialization.hpp> 33 34 namespace kep_toolbox 35 { 36 namespace sims_flanagan 37 { 38 39 /// Spacecraft 40 /** 41 * A container for system design parameters of a spacecraft. 42 * 43 * @author Dario Izzo (dario.izzo _AT_ googlemail.com) 44 */ 45 46 class KEP_TOOLBOX_DLL_PUBLIC spacecraft 47 { 48 friend std::ostream &operator<<(std::ostream &s, const spacecraft &in); 49 50 public: spacecraft()51 spacecraft() : m_mass(0), m_thrust(0), m_isp(0) {} spacecraft(const double & mass_,const double & thrust_,const double & isp_)52 spacecraft(const double &mass_, const double &thrust_, const double &isp_) 53 : m_mass(mass_), m_thrust(thrust_), m_isp(isp_) 54 { 55 } get_mass() const56 double get_mass() const 57 { 58 return m_mass; 59 } get_thrust() const60 double get_thrust() const 61 { 62 return m_thrust; 63 } get_isp() const64 double get_isp() const 65 { 66 return m_isp; 67 } set_mass(const double _mass)68 void set_mass(const double _mass) 69 { 70 m_mass = _mass; 71 } set_thrust(const double _thrust)72 void set_thrust(const double _thrust) 73 { 74 m_thrust = _thrust; 75 } set_isp(const double _isp)76 void set_isp(const double _isp) 77 { 78 m_isp = _isp; 79 } 80 std::string human_readable() const; 81 82 private: 83 // Serialization code 84 friend class boost::serialization::access; 85 template <class Archive> serialize(Archive & ar,const unsigned int)86 void serialize(Archive &ar, const unsigned int) 87 { 88 ar &m_mass; 89 ar &m_thrust; 90 ar &m_isp; 91 } 92 // Serialization code (END) 93 double m_mass; 94 double m_thrust; 95 double m_isp; 96 }; 97 98 KEP_TOOLBOX_DLL_PUBLIC std::ostream &operator<<(std::ostream &s, const spacecraft &in); 99 } // namespace sims_flanagan 100 } // namespace kep_toolbox 101 102 #endif // KEP_TOOLBOX_SPACECRAFT_H 103