Class astrea::snapshot::DatabaseUtilityWrapper¶
template <class T>
ClassList > astrea > snapshot > DatabaseUtilityWrapper
Database utility wrapper for the snapshot module. More...
#include <Database.hpp>
Public Functions¶
| Type | Name |
|---|---|
| DatabaseUtilityWrapper (T && db) Default constructor for DatabaseUtilityWrapper . |
|
| std::vector< astro::GeneralPerturbations > | get_all (Args &&... args) const Gets all GeneralPerturbations records from the database. |
| const T & | get_database () const Gets the underlying database instance. |
| astro::GeneralPerturbations | get_sat_from_norad_id (const unsigned & id) const Gets a GeneralPerturbations record by its NORAD ID. |
| std::vector< astro::GeneralPerturbations > | get_sats_by_name (const std::string & name) const Gets a GeneralPerturbations record by its name. |
| std::vector< astro::GeneralPerturbations > | get_sats_in_range (const Distance & minPeriapsis, const Distance & maxApoapsis) const Gets GeneralPerturbations records within a specified range of periapsis and apoapsis. |
| ~DatabaseUtilityWrapper () = default Default destructor for DatabaseUtilityWrapper . |
Detailed Description¶
This class provides a wrapper around the SQLite database used in the snapshot module, allowing for easy access to GeneralPerturbations data and other database operations.
Template parameters:
TThe type of the database (e.g., sqlite_orm::Storage<GeneralPerturbations>).
Public Functions Documentation¶
function DatabaseUtilityWrapper¶
Default constructor for DatabaseUtilityWrapper .
Initializes the DatabaseUtilityWrapper with the provided database instance.
Parameters:
dbThe database instance to wrap.
function get_all¶
Gets all GeneralPerturbations records from the database.
template<typename... Args>
std::vector< astro::GeneralPerturbations > astrea::snapshot::DatabaseUtilityWrapper::get_all (
Args &&... args
) const
Template parameters:
ArgsTypes of the optional arguments.
Parameters:
argsOptional arguments to pass to the database query.
Returns:
A vector containing all GeneralPerturbations records.
function get_database¶
Gets the underlying database instance.
Returns:
A reference to the wrapped database instance.
function get_sat_from_norad_id¶
Gets a GeneralPerturbations record by its NORAD ID.
astro::GeneralPerturbations astrea::snapshot::DatabaseUtilityWrapper::get_sat_from_norad_id (
const unsigned & id
) const
Parameters:
idThe NORAD ID of the GeneralPerturbations record to retrieve.
Returns:
A GeneralPerturbations object corresponding to the given NORAD ID.
function get_sats_by_name¶
Gets a GeneralPerturbations record by its name.
std::vector< astro::GeneralPerturbations > astrea::snapshot::DatabaseUtilityWrapper::get_sats_by_name (
const std::string & name
) const
Parameters:
nameThe name of the GeneralPerturbations record to retrieve.
Returns:
A GeneralPerturbations object corresponding to the given name.
function get_sats_in_range¶
Gets GeneralPerturbations records within a specified range of periapsis and apoapsis.
std::vector< astro::GeneralPerturbations > astrea::snapshot::DatabaseUtilityWrapper::get_sats_in_range (
const Distance & minPeriapsis,
const Distance & maxApoapsis
) const
Parameters:
minPeriapsisThe minimum periapsis distance.maxApoapsisThe maximum apoapsis distance.
Returns:
A vector containing GeneralPerturbations records that fall within the specified range.
function ~DatabaseUtilityWrapper¶
Default destructor for DatabaseUtilityWrapper .
The documentation for this class was generated from the following file astrea/snapshot/snapshot/database/Database.hpp