28 #ifndef CEREAL_DETAILS_STATIC_OBJECT_HPP_
29 #define CEREAL_DETAILS_STATIC_OBJECT_HPP_
33 #if CEREAL_THREAD_SAFE
47 #if defined(_MSC_VER) && !defined(__clang__)
48 # define CEREAL_DLL_EXPORT __declspec(dllexport)
51 # define CEREAL_DLL_EXPORT __attribute__ ((visibility("default")))
52 # define CEREAL_USED __attribute__ ((__used__))
90 #if CEREAL_THREAD_SAFE
94 std::unique_lock<std::mutex> lock;
112 #if CEREAL_THREAD_SAFE
113 static std::mutex instanceMutex;
A class that acts like std::lock_guard.
Definition: static_object.hpp:89
~LockGuard() CEREAL_NOEXCEPT
Definition: static_object.hpp:99
LockGuard(LockGuard const &)=default
A static, pre-execution object.
Definition: static_object.hpp:68
static T & create()
Definition: static_object.hpp:71
StaticObject(StaticObject const &)
Definition: static_object.hpp:79
static T & instance
Definition: static_object.hpp:121
static T & getInstance()
Definition: static_object.hpp:82
static LockGuard lock()
Attempts to lock this static object for the current scope.
Definition: static_object.hpp:110
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
in certain simple scenarios. They should probably not be used if maximizing performance is the main o...
Definition: access.hpp:42
detail namespace with internal helper functions
Definition: json.hpp:260
#define CEREAL_DLL_EXPORT
Prevent link optimization from removing non-referenced static objects.
Definition: static_object.hpp:51