| 1 |
/*************************************************************************************** |
| 2 |
* This file is dedicated to the public domain. If your jurisdiction requires a * |
| 3 |
* specific license: * |
| 4 |
* * |
| 5 |
* Copyright (c) Stephen McDowell, 2017-2024 * |
| 6 |
* License: CC0 1.0 Universal * |
| 7 |
* License Text: https://creativecommons.org/publicdomain/zero/1.0/legalcode * |
| 8 |
**************************************************************************************/ |
| 9 |
#pragma once |
| 10 |
#include <memory> |
| 11 |
#include <string> |
| 12 |
|
| 13 |
/// A namespace to contain everything in this test project ;) |
| 14 |
namespace pimpl { |
| 15 |
/// The interface base class for all planets. |
| 16 |
class Planet { |
| 17 |
public: |
| 18 |
/// The mass of the planet in kilograms. |
| 19 |
virtual double mass() const = 0; |
| 20 |
/// The mean radius of the planet in kilometers. |
| 21 |
virtual double radius() const = 0; |
| 22 |
/// The orbital eccentricity of the planet. |
| 23 |
virtual double eccentricity() const = 0; |
| 24 |
/// The gravity on the planet surface in meters per second squared. |
| 25 |
virtual double surface_gravity() const = 0; |
| 26 |
/// A string description of the planet. |
| 27 |
virtual std::string describe() const = 0; |
| 28 |
}; |
| 29 |
} |