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 (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)
 
 RateOptions (const RateOptions &other)
 
 RateOptions (RateOptions &&other) noexcept
 
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

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.

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

Copy constructor.

Parameters
otherRate options to copy from.

Definition at line 95 of file RateOptions.hpp.

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

Move constructor.

Parameters
otherRate options to move.

Definition at line 104 of file RateOptions.hpp.

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

Destructor.

Member Function Documentation

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.

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

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

Linux clock ID.

Definition at line 67 of file RateOptions.hpp.

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

Boolean indicating whether the rate should be enforced.

Definition at line 65 of file RateOptions.hpp.

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.

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.

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

Name for printing.

Definition at line 57 of file RateOptions.hpp.

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 Wed Mar 3 2021 03:09:10