Fabcoin Core  0.16.2
P2P Digital Currency
trdlocal.h
Go to the documentation of this file.
1 #ifndef CRYPTOPP_TRDLOCAL_H
2 #define CRYPTOPP_TRDLOCAL_H
3 
4 #include "config.h"
5 
6 #if !defined(NO_OS_DEPENDENCE) && defined(THREADS_AVAILABLE)
7 
8 #include "misc.h"
9 
10 #ifdef HAS_WINTHREADS
11 typedef unsigned long ThreadLocalIndexType;
12 #else
13 #include <pthread.h>
14 typedef pthread_key_t ThreadLocalIndexType;
15 #endif
16 
18 
19 class CRYPTOPP_DLL ThreadLocalStorage : public NotCopyable
21 {
22 public:
24  class Err : public OS_Error
25  {
26  public:
27  Err(const std::string& operation, int error);
28  };
29 
30  ThreadLocalStorage();
31  ~ThreadLocalStorage() CRYPTOPP_THROW;
32 
33  void SetValue(void *value);
34  void *GetValue() const;
35 
36 private:
37  ThreadLocalIndexType m_index;
38 };
39 
41 
42 #endif // THREADS_AVAILABLE
43 
44 #endif // CRYPTOPP_TRDLOCAL_H
bool error(const char *fmt, const Args &...args)
Definition: util.h:178
Utility functions for the Crypto++ library.
The operating system reported an error.
Definition: cryptlib.h:219
#define NAMESPACE_BEGIN(x)
Definition: config.h:200
Library configuration file.
#define CRYPTOPP_THROW
Definition: config.h:883
#define NAMESPACE_END
Definition: config.h:201
#define CRYPTOPP_DLL
Definition: config.h:704
Ensures an object is not copyable.
Definition: misc.h:217