TaskProcessor.h
1 /**************************************************************************************
2 Copyright 2015 Applied Research Associates, Inc.
3 Licensed under the Apache License, Version 2.0 (the "License"); you may not use
4 this file except in compliance with the License. You may obtain a copy of the License
5 at:
6 http://www.apache.org/licenses/LICENSE-2.0
7 Unless required by applicable law or agreed to in writing, software distributed under
8 the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
9 CONDITIONS OF ANY KIND, either express or implied. See the License for the
10 specific language governing permissions and limitations under the License.
11 **************************************************************************************/
12 
13 #pragma once
14 
15 #include <vector>
16 
17 namespace biogears {
18 class Task;
19 class TaskQueue;
20 
21 //--------------------------------------------------------------------------------------------------
25 //--------------------------------------------------------------------------------------------------
27 public:
28  TaskProcessor(TaskQueue* pTaskQueue);
29  ~TaskProcessor() = default;
30 
31  void operator()();
32 
33 private:
34  TaskQueue* m_pTaskQueue = nullptr;
35 };
36 }
Interface through which TaskProcessors retrieve Tasks from the TaskRunner.
Definition: TaskQueue.h:23
This class is a functor used in threads launched by the TaskRunner. It's responsibility is to pull an...
Definition: TaskProcessor.h:26
TaskProcessor(TaskQueue *pTaskQueue)
Constructor.
Definition: TaskProcessor.cpp:25
TaskQueue * m_pTaskQueue
Pointer to the TaskQueue to draw Tasks from.
Definition: TaskProcessor.h:34
Definition: SEElectricalCircuit.h:18
void operator()()
Parenthesis operator that draws and runs Tasks until the TaskQueue is empty.
Definition: TaskProcessor.cpp:34