Class that utilizes a client to have deterministic behaviour. More...
#include <deterministic_client.h>
Public Types | |
using | TimeStamp = std::chrono::time_point< std::chrono::steady_clock > |
Steady clock time point for deterministic cycles. | |
Public Member Functions | |
core::Result< ActivationReturnType > | WaitForActivation () |
Blocks the caller till reaching the next activation time. More... | |
template<typename ValueType , typename Container > | |
ara::core::Result< void > | RunWorkerPool (WorkerRunnable< ValueType > &runnableObj, Container &container) noexcept |
Run a deterministic worker pool to process a container via a runnable object. More... | |
uint64_t | GetRandom () noexcept |
Get a deterministic random number. More... | |
void | SetRandomSeed (uint64_t seed) noexcept |
Set a seed number to the deterministic random number generator. More... | |
core::Result< TimeStamp > | GetActivationTime () noexcept |
Get the last activation time. More... | |
core::Result< TimeStamp > | GetNextActivationTime () |
Get the next comming activation time. More... | |
Static Public Attributes | |
static const uint64_t | cCycleDelayMs {10} |
Theoretical cyclic delay in millisecond. | |
Class that utilizes a client to have deterministic behaviour.
|
noexcept |
Get the last activation time.
core::Result< DeterministicClient::TimeStamp > ara::exec::DeterministicClient::GetNextActivationTime | ( | ) |
Get the next comming activation time.
|
noexcept |
Get a deterministic random number.
|
inlinenoexcept |
Run a deterministic worker pool to process a container via a runnable object.
It uses the pool to iterate over each container element and call WorkerRunnable::Run of the runnable object for each of them.
ValueType | Container element type |
Container | Container type which supports standard iterator operators (e.g., begin and end) |
runnableObj | Object to process container elements |
container | Wrapper around the elements that the WorkerRunnable should process |
|
noexcept |
Set a seed number to the deterministic random number generator.
seed | Random number seed |
core::Result< ActivationReturnType > ara::exec::DeterministicClient::WaitForActivation | ( | ) |
Blocks the caller till reaching the next activation time.