Skip to content

Class astrea::astro::StateHistory

ClassList > astrea > astro > StateHistory

Class to manage the history of states for an object over date. More...

  • #include <StateHistory.hpp>

Public Types

Type Name
typedef StateMap::const_iterator const_iterator
Constant iterator types for iterating over the states in the history.
typedef StateMap::iterator iterator
Iterator types for iterating over the states in the history.

Public Functions

Type Name
StateHistory () = default
Default constructor for StateHistory .
StateHistory (const std::size_t & objectId)
Constructor that initializes StateHistory with a specific object ID.
const State & at (const Date & date) const
Retrieves the state at a specific date.
iterator begin ()
Returns an iterator to the beginning of the state history.
const_iterator begin () const
Returns a constant iterator to the beginning of the state history.
const_iterator cbegin () const
Returns a constant iterator to the beginning of the state history.
const_iterator cend () const
Returns a constant iterator to the end of the state history.
void clear ()
Clears the state history, removing all stored states.
iterator end ()
Returns an iterator to the end of the state history.
const_iterator end () const
Returns a constant iterator to the end of the state history.
const Date & epoch () const
Retrieves the epoch (first date) of the state history.
const State & first () const
Retrieves the first and last states in the history.
const State & get_closest_state (const Date & date) const
Retrieves the closest state to a given date.
const EventTimesMap & get_event_times () const
Retrieves the event times recorded during propagation.
EventTimesMap & get_event_times ()
Retrieves the event times recorded during propagation.
std::size_t get_object_id () const
Gets the object ID for this state history.
State get_state_at (const Date & date) const
Retrieves the state at a specific date.
void insert (const State & state)
Inserts a state at a specific date into the history.
const State & last () const
Retrieves the last state in the history.
State & operator[] (const Date & date)
Accesses the state at a specific date.
void set_event_times (const EventTimesMap & eventTimes)
Sets the event times recorded during propagation.
void set_object_id (const std::size_t & objectId)
Sets the object ID for this state history.
std::size_t size () const
Get the number of states in the history.
~StateHistory () = default
Destructor for StateHistory .

Detailed Description

This class allows storing, retrieving, and managing the states of an object at different dates, providing functionality to access the closest state to a given date and to convert between different orbital elements.

Public Types Documentation

typedef const_iterator

Constant iterator types for iterating over the states in the history.

using astrea::astro::StateHistory::const_iterator =  StateMap::const_iterator;


typedef iterator

Iterator types for iterating over the states in the history.

using astrea::astro::StateHistory::iterator =  StateMap::iterator;


Public Functions Documentation

function StateHistory [1/2]

Default constructor for StateHistory .

astrea::astro::StateHistory::StateHistory () = default


function StateHistory [2/2]

Constructor that initializes StateHistory with a specific object ID.

inline astrea::astro::StateHistory::StateHistory (
    const std::size_t & objectId
) 

Parameters:

  • objectId The ID of the object for which the state history is maintained.

function at

Retrieves the state at a specific date.

const State & astrea::astro::StateHistory::at (
    const Date & date
) const

Parameters:

  • date The date at which the state is requested.

Returns:

const State& Reference to the state at the specified date.


function begin [1/2]

Returns an iterator to the beginning of the state history.

inline iterator astrea::astro::StateHistory::begin () 

Returns:

iterator An iterator to the first state in the history.


function begin [2/2]

Returns a constant iterator to the beginning of the state history.

inline const_iterator astrea::astro::StateHistory::begin () const

Returns:

const_iterator A constant iterator to the first state in the history.


function cbegin

Returns a constant iterator to the beginning of the state history.

inline const_iterator astrea::astro::StateHistory::cbegin () const

Returns:

const_iterator A constant iterator to the first state in the history.


function cend

Returns a constant iterator to the end of the state history.

inline const_iterator astrea::astro::StateHistory::cend () const

Returns:

const_iterator A constant iterator to the position after the last state in the history.


function clear

Clears the state history, removing all stored states.

void astrea::astro::StateHistory::clear () 


function end [1/2]

Returns an iterator to the end of the state history.

inline iterator astrea::astro::StateHistory::end () 

Returns:

iterator An iterator to the position after the last state in the history.


function end [2/2]

Returns a constant iterator to the end of the state history.

inline const_iterator astrea::astro::StateHistory::end () const

Returns:

const_iterator A constant iterator to the position after the last state in the history.


function epoch

Retrieves the epoch (first date) of the state history.

inline const Date & astrea::astro::StateHistory::epoch () const

Returns:

const Date& Reference to the epoch of the state history.


function first

Retrieves the first and last states in the history.

inline const State & astrea::astro::StateHistory::first () const

Returns:

const State& Reference to the first state.


function get_closest_state

Retrieves the closest state to a given date.

const State & astrea::astro::StateHistory::get_closest_state (
    const Date & date
) const

This function finds the state that is closest to the specified date, either before or after it, and returns it.

Parameters:

  • date The date for which the closest state is requested.

Returns:

const State& Reference to the closest state.


function get_event_times [1/2]

Retrieves the event times recorded during propagation.

inline const EventTimesMap & astrea::astro::StateHistory::get_event_times () const

Returns:

const EventTimesMap& A vector of dates representing the event times.


function get_event_times [2/2]

Retrieves the event times recorded during propagation.

inline EventTimesMap & astrea::astro::StateHistory::get_event_times () 

Returns:

const EventTimesMap& A vector of dates representing the event times.


function get_object_id

Gets the object ID for this state history.

inline std::size_t astrea::astro::StateHistory::get_object_id () const

Returns:

std::size_t The ID of the object for which this state history is maintained.


function get_state_at

Retrieves the state at a specific date.

State astrea::astro::StateHistory::get_state_at (
    const Date & date
) const

This function returns the state at the specified date, or the closest state if no exact match is found.

Parameters:

  • date The date for which the state is requested.

Returns:

State The state at the specified date.


function insert

Inserts a state at a specific date into the history.

void astrea::astro::StateHistory::insert (
    const State & state
) 

Parameters:

  • date The date at which the state is recorded.
  • state The state to be inserted.

function last

Retrieves the last state in the history.

inline const State & astrea::astro::StateHistory::last () const

Returns:

const State& Reference to the last state.


function operator[]

Accesses the state at a specific date.

State & astrea::astro::StateHistory::operator[] (
    const Date & date
) 

Parameters:

  • date The date at which the state is requested.

Returns:

State& Reference to the state at the specified date.


function set_event_times

Sets the event times recorded during propagation.

inline void astrea::astro::StateHistory::set_event_times (
    const EventTimesMap & eventTimes
) 

Parameters:

  • eventTimes A vector of dates representing the event times.

function set_object_id

Sets the object ID for this state history.

inline void astrea::astro::StateHistory::set_object_id (
    const std::size_t & objectId
) 

Parameters:

  • objectId The ID of the object for which this state history is maintained.

function size

Get the number of states in the history.

std::size_t astrea::astro::StateHistory::size () const

Returns:

std::size_t The number of states in the history.


function ~StateHistory

Destructor for StateHistory .

astrea::astro::StateHistory::~StateHistory () = default



The documentation for this class was generated from the following file astrea/astro/astro/state/StateHistory.hpp