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

Unified, lightweight handle representing any celestial subject. More...

#include <siderust/subject.hpp>

Public Member Functions

SubjectKind kind () const
 
const siderust_subject_t & c_inner () const
 

Static Public Member Functions

static Subject body (Body b)
 Create a subject for a solar-system body.
 
static Subject star (const siderust::Star &star)
 Create a subject borrowing a Star handle.
 
static Subject icrs (const spherical::Direction< frames::ICRS > &dir)
 Create a subject for an inline ICRS direction.
 
template<typename C >
static Subject target (const DirectionTarget< C > &tgt)
 Create a subject borrowing an opaque SiderustTarget handle.
 

Detailed Description

Unified, lightweight handle representing any celestial subject.

Subject is a small copyable value type that stores a discriminant and either an inline body enum, an inline ICRS direction, or a borrowed pointer to a Star or DirectionTarget handle.

Use the static factory methods to construct instances.

Definition at line 82 of file subject.hpp.

Member Function Documentation

◆ body()

static Subject siderust::Subject::body ( Body  b)
inlinestatic

Create a subject for a solar-system body.

Definition at line 87 of file subject.hpp.

References kind().

◆ c_inner()

const siderust_subject_t & siderust::Subject::c_inner ( ) const
inline

Definition at line 134 of file subject.hpp.

Referenced by siderust::altitude_at(), and siderust::azimuth_at().

◆ icrs()

static Subject siderust::Subject::icrs ( const spherical::Direction< frames::ICRS > &  dir)
inlinestatic

Create a subject for an inline ICRS direction.

The direction is stored by value inside the Subject; no external handle is borrowed.

Definition at line 111 of file subject.hpp.

References kind(), and siderust::spherical::Direction< F >::to_c().

◆ kind()

SubjectKind siderust::Subject::kind ( ) const
inline

Definition at line 133 of file subject.hpp.

Referenced by body(), icrs(), star(), and target().

◆ star()

static Subject siderust::Subject::star ( const siderust::Star star)
inlinestatic

Create a subject borrowing a Star handle.

Warning
The Star must outlive this Subject.

Definition at line 98 of file subject.hpp.

References kind(), and star().

Referenced by star().

◆ target()

template<typename C >
static Subject siderust::Subject::target ( const DirectionTarget< C > &  tgt)
inlinestatic

Create a subject borrowing an opaque SiderustTarget handle.

Works with any DirectionTarget<C> via its c_handle() accessor.

Warning
The target must outlive this Subject.

Definition at line 124 of file subject.hpp.

References siderust::DirectionTarget< C >::c_handle(), and kind().


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