MetaImGUI 1.0.0
ImGui Application Template for C++20
Loading...
Searching...
No Matches
MetaImGUI::ISSTracker Class Reference

ISS Tracker that fetches ISS position data asynchronously. More...

#include <ISSTracker.h>

Public Member Functions

 ISSTracker ()
 
 ~ISSTracker ()
 
 ISSTracker (const ISSTracker &)=delete
 
ISSTrackeroperator= (const ISSTracker &)=delete
 
 ISSTracker (ISSTracker &&)=delete
 
ISSTrackeroperator= (ISSTracker &&)=delete
 
void StartTracking (std::function< void(const ISSPosition &)> callback=nullptr)
 Start tracking ISS position asynchronously.
 
void StopTracking ()
 Stop tracking.
 
bool IsTracking () const
 Check if tracking is active.
 
ISSPosition GetCurrentPosition () const
 Get the current ISS position (thread-safe)
 
void GetPositionHistory (std::vector< double > &latitudes, std::vector< double > &longitudes) const
 Get position history for orbit trail (thread-safe)
 
size_t GetMaxHistorySize () const
 Get the maximum number of positions stored in history.
 
ISSPosition FetchPositionSync ()
 Manually fetch ISS position once (synchronous)
 

Detailed Description

ISS Tracker that fetches ISS position data asynchronously.

This class demonstrates:

  • Properly threaded async JSON requests using std::jthread
  • JSON decoding with nlohmann/json
  • Thread-safe data access for ImGui/ImPlot rendering
  • Circular buffer for historical position tracking

Definition at line 51 of file ISSTracker.h.

Constructor & Destructor Documentation

◆ ISSTracker() [1/3]

MetaImGUI::ISSTracker::ISSTracker ( )

Definition at line 34 of file ISSTracker.cpp.

◆ ~ISSTracker()

MetaImGUI::ISSTracker::~ISSTracker ( )

Definition at line 36 of file ISSTracker.cpp.

References StopTracking().

◆ ISSTracker() [2/3]

MetaImGUI::ISSTracker::ISSTracker ( const ISSTracker )
delete

◆ ISSTracker() [3/3]

MetaImGUI::ISSTracker::ISSTracker ( ISSTracker &&  )
delete

Member Function Documentation

◆ FetchPositionSync()

ISSPosition MetaImGUI::ISSTracker::FetchPositionSync ( )

Manually fetch ISS position once (synchronous)

Definition at line 102 of file ISSTracker.cpp.

◆ GetCurrentPosition()

ISSPosition MetaImGUI::ISSTracker::GetCurrentPosition ( ) const

Get the current ISS position (thread-safe)

Definition at line 81 of file ISSTracker.cpp.

Referenced by MetaImGUI::UIRenderer::RenderISSTrackerWindow().

◆ GetMaxHistorySize()

size_t MetaImGUI::ISSTracker::GetMaxHistorySize ( ) const
inline

Get the maximum number of positions stored in history.

Definition at line 93 of file ISSTracker.h.

◆ GetPositionHistory()

void MetaImGUI::ISSTracker::GetPositionHistory ( std::vector< double > &  latitudes,
std::vector< double > &  longitudes 
) const

Get position history for orbit trail (thread-safe)

Parameters
latitudesOutput vector for latitude values
longitudesOutput vector for longitude values

Definition at line 86 of file ISSTracker.cpp.

Referenced by MetaImGUI::UIRenderer::RenderISSTrackerWindow().

◆ IsTracking()

bool MetaImGUI::ISSTracker::IsTracking ( ) const

Check if tracking is active.

Definition at line 77 of file ISSTracker.cpp.

Referenced by MetaImGUI::UIRenderer::RenderISSTrackerWindow().

◆ operator=() [1/2]

ISSTracker & MetaImGUI::ISSTracker::operator= ( const ISSTracker )
delete

◆ operator=() [2/2]

ISSTracker & MetaImGUI::ISSTracker::operator= ( ISSTracker &&  )
delete

◆ StartTracking()

void MetaImGUI::ISSTracker::StartTracking ( std::function< void(const ISSPosition &)>  callback = nullptr)

Start tracking ISS position asynchronously.

Parameters
callbackFunction to call when new position data is available

Definition at line 40 of file ISSTracker.cpp.

References LOG_INFO.

Referenced by MetaImGUI::UIRenderer::RenderISSTrackerWindow().

◆ StopTracking()

void MetaImGUI::ISSTracker::StopTracking ( )

Stop tracking.

Definition at line 63 of file ISSTracker.cpp.

References LOG_INFO.

Referenced by MetaImGUI::UIRenderer::RenderISSTrackerWindow(), and ~ISSTracker().


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