Skip to content

Class inertialsim::time::TimeTolerances

ClassList > inertialsim > time > TimeTolerances

Singleton class for managing time tolerance settings. More...

  • #include <tolerances.h>

Public Functions

Type Name
TimeTolerances (const TimeTolerances &) = delete
TimeTolerances (TimeTolerances &&) = delete
TimeTolerances & operator= (const TimeTolerances &) = delete
TimeTolerances & operator= (TimeTolerances &&) = delete
void reset ()
Reset all tolerances to default values.
SampleRateTolerances sample_rate_tolerances () const
Get the current sample rate tolerances.
void set_sample_rate_tolerances (const SampleRateTolerances & tolerances)
Set the sample rate tolerances.
void set_tolerance (double value)
Set the timestamp tolerance.
double tolerance () const
Get the current timestamp tolerance.
~TimeTolerances () = default

Public Static Functions

Type Name
TimeTolerances & Instance ()
Get the singleton instance.

Detailed Description

This class provides thread-safe access to global tolerance settings used throughout the time module for timestamp comparisons and sample rate validation.

Example usage:

// Set timestamp tolerance
TimeTolerances::Instance().set_tolerance(1e-9);

// Get timestamp tolerance
double tol = TimeTolerances::Instance().tolerance();

// Set sample rate tolerances
SampleRateTolerances sr_tol{0.6, 1.4, 0.01, 0.1};
TimeTolerances::Instance().set_sample_rate_tolerances(sr_tol);

// Reset to defaults
TimeTolerances::Instance().set_default();

Public Functions Documentation

function TimeTolerances [⅓]

inertialsim::time::TimeTolerances::TimeTolerances (
    const TimeTolerances &
) = delete

function TimeTolerances [⅔]

inertialsim::time::TimeTolerances::TimeTolerances (
    TimeTolerances &&
) = delete

function operator=

TimeTolerances & inertialsim::time::TimeTolerances::operator= (
    const TimeTolerances &
) = delete

function operator=

TimeTolerances & inertialsim::time::TimeTolerances::operator= (
    TimeTolerances &&
) = delete

function reset

Reset all tolerances to default values.

inline void inertialsim::time::TimeTolerances::reset () 


function sample_rate_tolerances

Get the current sample rate tolerances.

inline SampleRateTolerances inertialsim::time::TimeTolerances::sample_rate_tolerances () const

Returns:

The current sample rate tolerances.


function set_sample_rate_tolerances

Set the sample rate tolerances.

inline void inertialsim::time::TimeTolerances::set_sample_rate_tolerances (
    const SampleRateTolerances & tolerances
) 

Parameters:

  • tolerances The new sample rate tolerances.

function set_tolerance

Set the timestamp tolerance.

inline void inertialsim::time::TimeTolerances::set_tolerance (
    double value
) 

Parameters:

  • value The new timestamp tolerance value.

function tolerance

Get the current timestamp tolerance.

inline double inertialsim::time::TimeTolerances::tolerance () const

Returns:

The current timestamp tolerance value.


function ~TimeTolerances

inertialsim::time::TimeTolerances::~TimeTolerances () = default

Public Static Functions Documentation

function Instance

Get the singleton instance.

static inline TimeTolerances & inertialsim::time::TimeTolerances::Instance () 

Returns:

Reference to the singleton instance (thread-safe).



The documentation for this class was generated from the following file cpp/include/inertialsim/time/tolerances.h