siderust-cpp
Header-only C++ wrapper for siderust
Loading...
Searching...
No Matches
siderust::Star Class Reference

RAII handle to a Star (opaque Rust object). More...

#include <siderust/bodies.hpp>

Public Member Functions

 Star ()=default
 
 ~Star ()
 
 Star (Star &&o) noexcept
 
Staroperator= (Star &&o) noexcept
 
 Star (const Star &)=delete
 
Staroperator= (const Star &)=delete
 
 operator bool () const
 Whether the handle is valid.
 
const SiderustStar * c_handle () const
 Access the raw C handle (for passing to altitude functions).
 
std::string name () const
 
double distance_ly () const
 
double mass_solar () const
 
double radius_solar () const
 
double luminosity_solar () const
 

Static Public Member Functions

static Star catalog (const std::string &name)
 Look up a star from the built-in catalog.
 
static Star create (const std::string &name, double distance_ly, double mass_solar, double radius_solar, double luminosity_solar, double ra_deg, double dec_deg, double epoch_jd, const std::optional< ProperMotion > &pm=std::nullopt)
 Create a custom star.
 

Detailed Description

RAII handle to a Star (opaque Rust object).

Non-copyable; move-only. Released on destruction.

Definition at line 158 of file bodies.hpp.

Constructor & Destructor Documentation

◆ Star() [1/3]

siderust::Star::Star ( )
default

Referenced by catalog(), and create().

◆ ~Star()

siderust::Star::~Star ( )
inline

Definition at line 165 of file bodies.hpp.

◆ Star() [2/3]

siderust::Star::Star ( Star &&  o)
inlinenoexcept

Definition at line 171 of file bodies.hpp.

◆ Star() [3/3]

siderust::Star::Star ( const Star )
delete

Member Function Documentation

◆ c_handle()

const SiderustStar * siderust::Star::c_handle ( ) const
inline

Access the raw C handle (for passing to altitude functions).

Definition at line 188 of file bodies.hpp.

Referenced by siderust::star_altitude::altitude_at().

◆ catalog()

static Star siderust::Star::catalog ( const std::string &  name)
inlinestatic

Look up a star from the built-in catalog.

Supported: "VEGA", "SIRIUS", "POLARIS", "CANOPUS", "ARCTURUS", "RIGEL", "BETELGEUSE", "PROCYON", "ALDEBARAN", "ALTAIR".

Definition at line 198 of file bodies.hpp.

References siderust::check_status(), name(), and Star().

◆ create()

static Star siderust::Star::create ( const std::string &  name,
double  distance_ly,
double  mass_solar,
double  radius_solar,
double  luminosity_solar,
double  ra_deg,
double  dec_deg,
double  epoch_jd,
const std::optional< ProperMotion > &  pm = std::nullopt 
)
inlinestatic

Create a custom star.

Parameters
nameStar name.
distance_lyDistance in light-years.
mass_solarMass in solar masses.
radius_solarRadius in solar radii.
luminosity_solarLuminosity in solar luminosities.
ra_degRight ascension (J2000) in degrees.
dec_degDeclination (J2000) in degrees.
epoch_jdEpoch of coordinates (Julian Date).
pmOptional proper motion.

Definition at line 218 of file bodies.hpp.

References siderust::check_status(), distance_ly(), luminosity_solar(), mass_solar(), name(), radius_solar(), and Star().

◆ distance_ly()

double siderust::Star::distance_ly ( ) const
inline

Definition at line 251 of file bodies.hpp.

Referenced by create().

◆ luminosity_solar()

double siderust::Star::luminosity_solar ( ) const
inline

Definition at line 254 of file bodies.hpp.

Referenced by create().

◆ mass_solar()

double siderust::Star::mass_solar ( ) const
inline

Definition at line 252 of file bodies.hpp.

Referenced by create().

◆ name()

std::string siderust::Star::name ( ) const
inline

Definition at line 243 of file bodies.hpp.

References siderust::check_status().

Referenced by catalog(), and create().

◆ operator bool()

siderust::Star::operator bool ( ) const
inlineexplicit

Whether the handle is valid.

Definition at line 185 of file bodies.hpp.

◆ operator=() [1/2]

Star & siderust::Star::operator= ( const Star )
delete

◆ operator=() [2/2]

Star & siderust::Star::operator= ( Star &&  o)
inlinenoexcept

Definition at line 172 of file bodies.hpp.

◆ radius_solar()

double siderust::Star::radius_solar ( ) const
inline

Definition at line 253 of file bodies.hpp.

Referenced by create().


The documentation for this class was generated from the following file: