Go to the documentation of this file.
10 #ifndef vtk_m_filter_TaskQueue_h
11 #define vtk_m_filter_TaskQueue_h
29 std::unique_lock<std::mutex> lock(this->
Lock);
30 this->
Queue.push(item);
35 std::unique_lock<std::mutex> lock(this->
Lock);
36 return !(this->
Queue.empty());
41 std::unique_lock<std::mutex> lock(this->
Lock);
42 if (this->
Queue.empty())
45 item = this->
Queue.front();
53 std::unique_lock<std::mutex> lock(this->
Lock);
54 if (!this->
Queue.empty())
56 item = this->
Queue.front();
66 std::unique_lock<std::mutex> lock(this->
Lock);
89 this->
Push(std::make_pair(idx++, std::move(ds)));
101 std::vector<vtkm::cont::DataSet> dataSets(
static_cast<std::size_t
>(num));
104 std::pair<vtkm::Id, vtkm::cont::DataSet> task;
107 dataSets[
static_cast<std::size_t
>(task.first)] = std::move(task.second);
std::mutex Lock
Definition: TaskQueue.h:71
vtkm::Id Length()
Definition: TaskQueue.h:64
Groups connected points that have the same field value.
Definition: Atomic.h:19
void Push(T &&item)
Definition: TaskQueue.h:27
bool GetTask(T &item)
Definition: TaskQueue.h:39
DataSetQueue(const vtkm::cont::PartitionedDataSet &input)
Definition: TaskQueue.h:85
vtkm::cont::PartitionedDataSet Get()
Definition: TaskQueue.h:94
bool HasTasks()
Definition: TaskQueue.h:33
vtkm::Int32 Id
Represents an ID (index into arrays).
Definition: Types.h:191
DataSetQueue()
Definition: TaskQueue.h:92
T Pop()
Definition: TaskQueue.h:50
Definition: TaskQueue.h:21
std::queue< T > Queue
Definition: TaskQueue.h:72
Definition: TaskQueue.h:82
TaskQueue & operator=(const TaskQueue &rhs)=delete
VTKM_CONT void AppendPartitions(const std::vector< vtkm::cont::DataSet > &partitions)
Append the DataSet vector partitions to the end of the contained one.
Definition: PartitionedDataSet.h:25