2023-Robot
Robot code for 2023 FRC season by Argos, FRC team #1756
Loading...
Searching...
No Matches
argos_lib::FSHomingStorage< T > Class Template Reference

Saves and loads home positions from filesystem. More...

#include <fs_homing.h>

Inheritance diagram for argos_lib::FSHomingStorage< T >:
argos_lib::HomingStorageInterface< T >

Public Member Functions

 FSHomingStorage (const fs::path &homeFilePath)
 Construct a new FSHomingStorage object.
 
bool Save (const T &homePosition) override
 Save home position to persistent storage.
 
std::optional< T > Load () override
 Load home position from persistent storage.
 

Private Member Functions

fs::path GetFilePath ()
 

Private Attributes

const fs::path m_homesPath
 

Detailed Description

template<class T>
class argos_lib::FSHomingStorage< T >

Saves and loads home positions from filesystem.

Template Parameters
TType of the home position. Should be a units type

Constructor & Destructor Documentation

◆ FSHomingStorage()

template<class T >
argos_lib::FSHomingStorage< T >::FSHomingStorage ( const fs::path &  homeFilePath)
inlineexplicit

Construct a new FSHomingStorage object.

Parameters
homeFilePathPath to save homes to relative to internally-managed root directory

Member Function Documentation

◆ GetFilePath()

template<class T >
fs::path argos_lib::FSHomingStorage< T >::GetFilePath ( )
inlineprivate

◆ Load()

template<class T >
std::optional< T > argos_lib::FSHomingStorage< T >::Load ( )
inlineoverridevirtual

Load home position from persistent storage.

Returns
Poisition from persistent storage or std::nullopt if load failed or no positions were previously stored

Implements argos_lib::HomingStorageInterface< T >.

◆ Save()

template<class T >
bool argos_lib::FSHomingStorage< T >::Save ( const T &  homePosition)
inlineoverridevirtual

Save home position to persistent storage.

Parameters
homePositionPosition to store
Returns
true Save successful
false Error saving

Implements argos_lib::HomingStorageInterface< T >.

Member Data Documentation

◆ m_homesPath

template<class T >
const fs::path argos_lib::FSHomingStorage< T >::m_homesPath
private

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