Public Member Functions | Public Attributes | List of all members
bota_worker::RateOptions Struct Reference

#include <RateOptions.hpp>

Inheritance diagram for bota_worker::RateOptions:
Inheritance graph
[legend]

Public Member Functions

virtual bool isValid () const
 
RateOptionsoperator= (const RateOptions &other)
 
 RateOptions (const RateOptions &other)
 
 RateOptions (RateOptions &&other) noexcept
 
 RateOptions (std::string name="", const double timeStep=0.0, const double maxTimeStepFactorWarning=1.0, const double maxTimeStepFactorError=10.0, const bool enforceRate=true, const clockid_t clockId=CLOCK_MONOTONIC)
 
virtual ~RateOptions ()=default
 

Public Attributes

std::atomic< clockid_t > clockId_ { CLOCK_MONOTONIC }
 Linux clock ID. More...
 
std::atomic< bool > enforceRate_ { true }
 Boolean indicating whether the rate should be enforced. More...
 
std::atomic< double > maxTimeStepFactorError_ { 10.0 }
 If the awake time is bigger than the time step multiplied by this factor, it counts as an error. More...
 
std::atomic< double > maxTimeStepFactorWarning_ { 1.0 }
 If the awake time is bigger than the time step multiplied by this factor, it counts as an warning. More...
 
std::string name_ {}
 Name for printing. More...
 
std::atomic< double > timeStep_ { 0.0 }
 Time step in seconds. More...
 

Detailed Description

RateOptions class.

Definition at line 54 of file RateOptions.hpp.

Constructor & Destructor Documentation

◆ RateOptions() [1/3]

bota_worker::RateOptions::RateOptions ( std::string  name = "",
const double  timeStep = 0.0,
const double  maxTimeStepFactorWarning = 1.0,
const double  maxTimeStepFactorError = 10.0,
const bool  enforceRate = true,
const clockid_t  clockId = CLOCK_MONOTONIC 
)
inlineexplicit

Constructor. Starts the clock. Call reset() to restart it if you do not intend to call sleep() immediately.

Parameters
nameName for printing.
timeStepTime step in seconds.
maxTimeStepFactorWarningMax time step factor for warnings.
maxTimeStepFactorErrorMax time step factor for errors.
enforceRateEnforce the rate.
clockIdLinux clock ID.

Definition at line 79 of file RateOptions.hpp.

◆ RateOptions() [2/3]

bota_worker::RateOptions::RateOptions ( const RateOptions other)
inline

Copy constructor.

Parameters
otherRate options to copy from.

Definition at line 95 of file RateOptions.hpp.

◆ RateOptions() [3/3]

bota_worker::RateOptions::RateOptions ( RateOptions &&  other)
inlinenoexcept

Move constructor.

Parameters
otherRate options to move.

Definition at line 104 of file RateOptions.hpp.

◆ ~RateOptions()

virtual bota_worker::RateOptions::~RateOptions ( )
virtualdefault

Destructor.

Member Function Documentation

◆ isValid()

virtual bool bota_worker::RateOptions::isValid ( ) const
inlinevirtual

Check if the rate options are valid.

Returns
True if rate options are valid.

Definition at line 138 of file RateOptions.hpp.

◆ operator=()

RateOptions& bota_worker::RateOptions::operator= ( const RateOptions other)
inline

Assignment operator.

Parameters
otherRate options.

Definition at line 118 of file RateOptions.hpp.

Member Data Documentation

◆ clockId_

std::atomic<clockid_t> bota_worker::RateOptions::clockId_ { CLOCK_MONOTONIC }

Linux clock ID.

Definition at line 67 of file RateOptions.hpp.

◆ enforceRate_

std::atomic<bool> bota_worker::RateOptions::enforceRate_ { true }

Boolean indicating whether the rate should be enforced.

Definition at line 65 of file RateOptions.hpp.

◆ maxTimeStepFactorError_

std::atomic<double> bota_worker::RateOptions::maxTimeStepFactorError_ { 10.0 }

If the awake time is bigger than the time step multiplied by this factor, it counts as an error.

Definition at line 63 of file RateOptions.hpp.

◆ maxTimeStepFactorWarning_

std::atomic<double> bota_worker::RateOptions::maxTimeStepFactorWarning_ { 1.0 }

If the awake time is bigger than the time step multiplied by this factor, it counts as an warning.

Definition at line 61 of file RateOptions.hpp.

◆ name_

std::string bota_worker::RateOptions::name_ {}

Name for printing.

Definition at line 57 of file RateOptions.hpp.

◆ timeStep_

std::atomic<double> bota_worker::RateOptions::timeStep_ { 0.0 }

Time step in seconds.

Definition at line 59 of file RateOptions.hpp.


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


bota_worker
Author(s):
autogenerated on Sat Apr 15 2023 02:53:50