bitsim
Model, simulate, estimate and control robots in C++
Loading...
Searching...
No Matches
bitsim::utils Namespace Reference

Namespaces

namespace  concurrency
namespace  io
namespace  render
namespace  unit_converter

Classes

class  IterationCounter
 The IterationCounter class. More...

Typedefs

using WallClock = std::chrono::steady_clock

Functions

std::string uuid4 ()
template<typename OutT>
OutT resolve (const std::string &name, const std::map< std::string, std::any > &input)
template<typename OutT>
OutT resolve (const std::string &name, const std::unordered_map< std::string, std::any > &input)
real_t seconds_between (WallClock::time_point from, WallClock::time_point to)
 The seconds from one time point to another.
real_t milliseconds_since (WallClock::time_point t)
 The milliseconds since a time point.
void sleep_until_step (WallClock::time_point start, long step, real_t step_size)
 Sleep until step steps of step_size [s] after start, so that a loop that calls this every step keeps to real time without its errors adding up.

Typedef Documentation

◆ WallClock

using bitsim::utils::WallClock = std::chrono::steady_clock

Function Documentation

◆ milliseconds_since()

real_t bitsim::utils::milliseconds_since ( WallClock::time_point t)
inline

The milliseconds since a time point.

◆ resolve() [1/2]

template<typename OutT>
OutT bitsim::utils::resolve ( const std::string & name,
const std::map< std::string, std::any > & input )

Given the name of the argument return std::any_cast<OutT>(itr->second) where itr is itr = input.find(name)

◆ resolve() [2/2]

template<typename OutT>
OutT bitsim::utils::resolve ( const std::string & name,
const std::unordered_map< std::string, std::any > & input )

Given the name of the argument return std::any_cast<OutT>(itr->second) where itr is itr = input.find(name)

◆ seconds_between()

real_t bitsim::utils::seconds_between ( WallClock::time_point from,
WallClock::time_point to )
inline

The seconds from one time point to another.

◆ sleep_until_step()

void bitsim::utils::sleep_until_step ( WallClock::time_point start,
long step,
real_t step_size )
inline

Sleep until step steps of step_size [s] after start, so that a loop that calls this every step keeps to real time without its errors adding up.

◆ uuid4()

std::string bitsim::utils::uuid4 ( )
inline

Generate UUID4 strings using Boost::uuids. For more info on UUIDs see: https://www.ibm.com/docs/en/cobol-zos/6.3.0?topic=functions-uuid4

Returns