10 #ifndef vtk_m_cont_Token_h
11 #define vtk_m_cont_Token_h
17 #include <condition_variable>
20 #include <type_traits>
38 mutable std::unique_ptr<InternalStruct>
Internals;
47 template <
typename ObjectType>
58 : Object(std::move(object))
100 template <
typename T>
103 std::unique_lock<std::mutex>& lock,
104 std::condition_variable* conditionVariablePointer)
106 this->Attach(std::unique_ptr<ObjectReference>(
108 referenceCountPointer,
110 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);
136 : InternalsPointer(internalsPointer)
161 VTKM_CONT Reference GetReference()
const;
164 VTKM_CONT void Attach(std::unique_ptr<vtkm::cont::Token::ObjectReference>&& objectReference,
166 std::unique_lock<std::mutex>& lock,
167 std::condition_variable* conditionVariablePointer);
169 VTKM_CONT bool IsAttached(std::unique_lock<std::mutex>& lock,
193 #endif //vtk_m_cont_Token_h