32 T *
get() {
return obj_.get(); }
41 mutable std::mutex mutex_;
42 std::unique_ptr<T> obj_;
44 std::shared_ptr<TaskGroup> construction_;
#define MRMESH_API
Definition MRMesh/MRMeshFwd.h:46
Definition MRUniqueThreadSafeOwner.h:20
MRMESH_API void update(const std::function< void(T &)> &updater)
calls given updater for the owned object (if any)
MRMESH_API ~UniqueThreadSafeOwner()
MRMESH_API size_t heapBytes() const
returns the amount of memory this object occupies on heap
T * get()
returns existing owned object and does not create new one
Definition MRUniqueThreadSafeOwner.h:32
MRMESH_API void reset()
deletes owned object
MRMESH_API UniqueThreadSafeOwner(const UniqueThreadSafeOwner &)
MRMESH_API UniqueThreadSafeOwner(UniqueThreadSafeOwner &&b) noexcept
MRMESH_API T & getOrCreate(const std::function< T()> &creator)
returns existing owned object or creates new one using creator function
MRMESH_API UniqueThreadSafeOwner()
MRMESH_API UniqueThreadSafeOwner & operator=(const UniqueThreadSafeOwner &)
Definition MRCameraOrientationPlugin.h:8