20#ifndef RIPPLE_BASICS_LOCALVALUE_H_INCLUDED
21#define RIPPLE_BASICS_LOCALVALUE_H_INCLUDED
23#include <boost/thread/tss.hpp>
73template <
class =
void>
74boost::thread_specific_ptr<detail::LocalValues>&
77 static boost::thread_specific_ptr<detail::LocalValues> tsp(
88 template <
class... Args>
121 auto const iter = lvs->values.find(
this);
122 if (iter != lvs->values.end())
123 return *
reinterpret_cast<T*
>(iter->second->get());
126 return *
reinterpret_cast<T*
>(
129 .first->second->get());
T & operator*()
Stores instance of T specific to the calling coroutine or thread.
LocalValue(Args &&... args)
T * operator->()
Stores instance of T specific to the calling coroutine or thread.
boost::thread_specific_ptr< detail::LocalValues > & getLocalValues()
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
virtual ~BasicValue()=default
std::unordered_map< void const *, std::unique_ptr< BasicValue > > values
static void cleanup(LocalValues *lvs)