28 #ifndef CEREAL_DETAILS_STATIC_OBJECT_HPP_ 29 #define CEREAL_DETAILS_STATIC_OBJECT_HPP_ 33 #if CEREAL_THREAD_SAFE 48 # define CEREAL_DLL_EXPORT __declspec(dllexport) 51 # define CEREAL_DLL_EXPORT 52 # define CEREAL_USED __attribute__ ((__used__)) 71 static void instantiate( T
const & ) {}
76 instantiate(instance);
83 static T & getInstance()
91 #if CEREAL_THREAD_SAFE 95 std::unique_lock<std::mutex> lock;
111 #if CEREAL_THREAD_SAFE 112 static std::mutex instanceMutex;
127 #endif // CEREAL_DETAILS_STATIC_OBJECT_HPP_ static LockGuard lock()
Attempts to lock this static object for the current scope.
Definition: static_object.hpp:109
Definition: access.hpp:40
Preprocessor macros that can customise the cereal library.
#define CEREAL_NOEXCEPT
Defines the CEREAL_NOEXCEPT macro to use instead of noexcept.
Definition: macros.hpp:130
#define CEREAL_DLL_EXPORT
Prevent link optimization from removing non-referenced static objects.
Definition: static_object.hpp:51
A static, pre-execution object.
Definition: static_object.hpp:67
A class that acts like std::lock_guard.
Definition: static_object.hpp:89