File: planet.hpp

package info (click to toggle)
exhale 0.3.7-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,616 kB
  • sloc: python: 9,057; cpp: 1,260; javascript: 915; f90: 29; ansic: 18; makefile: 16
file content (29 lines) | stat: -rw-r--r-- 1,449 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
/***************************************************************************************
 * This file is dedicated to the public domain.  If your jurisdiction requires a       *
 * specific license:                                                                   *
 *                                                                                     *
 * Copyright (c) Stephen McDowell, 2017-2024                                           *
 * License:      CC0 1.0 Universal                                                     *
 * License Text: https://creativecommons.org/publicdomain/zero/1.0/legalcode           *
 **************************************************************************************/
#pragma once
#include <memory>
#include <string>

/// A namespace to contain everything in this test project ;)
namespace pimpl {
    /// The interface base class for all planets.
    class Planet {
    public:
        /// The mass of the planet in kilograms.
        virtual double mass() const = 0;
        /// The mean radius of the planet in kilometers.
        virtual double radius() const = 0;
        /// The orbital eccentricity of the planet.
        virtual double eccentricity() const = 0;
        /// The gravity on the planet surface in meters per second squared.
        virtual double surface_gravity() const = 0;
        /// A string description of the planet.
        virtual std::string describe() const = 0;
    };
}