10 #ifndef vtk_m_cont_Token_h
11 #define vtk_m_cont_Token_h
13 #include <vtkm/cont/vtkm_cont_export.h>
17 #include <condition_variable>
20 #include <type_traits>
35 class VTKM_CONT_EXPORT
Token final
38 mutable std::unique_ptr<InternalStruct>
Internals;
47 template <
typename ObjectType>
58 : Object(std::move(object))
101 template <
typename T>
104 std::unique_lock<std::mutex>& lock,
105 std::condition_variable* conditionVariablePointer)
107 this->Attach(std::unique_ptr<ObjectReference>(
109 referenceCountPointer,
111 conditionVariablePointer);
114 template <
typename T>
117 std::mutex* mutexPointer,
118 std::condition_variable* conditionVariablePointer)
120 std::unique_lock<std::mutex> lock(*mutexPointer, std::defer_lock);
121 this->Attach(std::forward<T>(
object), referenceCountPoiner, lock, conditionVariablePointer);
137 : InternalsPointer(internalsPointer)
162 VTKM_CONT Reference GetReference()
const;
165 VTKM_CONT void Attach(std::unique_ptr<vtkm::cont::Token::ObjectReference>&& objectReference,
167 std::unique_lock<std::mutex>& lock,
168 std::condition_variable* conditionVariablePointer);
170 VTKM_CONT bool IsAttached(std::unique_lock<std::mutex>& lock,
194 #endif //vtk_m_cont_Token_h