#include "common.hpp"

Public Member Functions | |
| template<typename... Args> | |
| ReadWriteObject (Args &&... args) | |
| template<typename F > | |
| auto | exclusiveAccess (F &&f) |
| template<typename F > | |
| auto | sharedAccess (F &&f) const |
Protected object wrapper. Allow read-write access.
| T | object type Example: ReadWriteObject<std::string> obj("1"); bool const is_one_att1 = obj.sharedAccess([](auto const &str) { return str == "1"; }); obj.exclusiveAccess([](auto &str) { str = "2"; }); bool const is_one_att2 = obj.sharedAccess([](auto const &str) { return str == "1"; }); std::cout << "Attempt 1: " << is_one_att1 << std::endl << "Attempt 2: " << is_one_att2; |
|
inline |
|
inline |

|
inline |