mrs_lib
Various reusable classes, functions and utilities for use in MRS projects
mutex.h File Reference

Defines helper routines for getting and setting variables under mutex locks. More...

#include <iostream>
#include <mutex>
#include <tuple>
+ Include dependency graph for mutex.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

 mrs_lib
 All mrs_lib functions, classes, variables and definitions are contained in this namespace.
 

Functions

template<class... GetArgs, class... SetArgs>
std::tuple< GetArgs... > mrs_lib::get_set_mutexed (std::mutex &mut, std::tuple< GetArgs &... > get, std::tuple< SetArgs... > from_set, std::tuple< SetArgs &... > to_set)
 thread-safe getter and setter for values of variables (args) More...
 
template<class... Args>
std::tuple< Args... > mrs_lib::get_mutexed (std::mutex &mut, Args &... args)
 thread-safe getter for values of variables (args) More...
 
template<class T >
mrs_lib::get_mutexed (std::mutex &mut, T &arg)
 thread-safe getter a value from a variable More...
 
template<class T >
void mrs_lib::set_mutexed_impl (const T what, T &where)
 base case of the variadic template for set_mutexed() More...
 
template<class T , class... Args>
void mrs_lib::set_mutexed_impl (const T what, T &where, Args... args)
 general case of the variadic template for set_mutexed() More...
 
template<class T >
auto mrs_lib::set_mutexed (std::mutex &mut, const T what, T &where)
 thread-safe setter for a variable More...
 
template<class... Args>
auto mrs_lib::set_mutexed (std::mutex &mut, Args &... args)
 thread-safe setter for multiple variables More...
 
template<class... Args>
auto mrs_lib::set_mutexed (std::mutex &mut, const std::tuple< Args... > from, std::tuple< Args &... > to)
 thread-safe setter for multiple variables More...
 

Detailed Description

Defines helper routines for getting and setting variables under mutex locks.

Author
Tomas Baca - tomas.nosp@m..bac.nosp@m.a@fel.nosp@m..cvu.nosp@m.t.cz