QuantumLibrary
quantum_itask_accessor.h
1 /*
2 ** Copyright 2018 Bloomberg Finance L.P.
3 **
4 ** Licensed under the Apache License, Version 2.0 (the "License");
5 ** you may not use this file except in compliance with the License.
6 ** You may obtain a copy of the License at
7 **
8 ** http://www.apache.org/licenses/LICENSE-2.0
9 **
10 ** Unless required by applicable law or agreed to in writing, software
11 ** distributed under the License is distributed on an "AS IS" BASIS,
12 ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 ** See the License for the specific language governing permissions and
14 ** limitations under the License.
15 */
16 #ifndef BLOOMBERG_QUANTUM_ITASK_ACCESSOR_H
17 #define BLOOMBERG_QUANTUM_ITASK_ACCESSOR_H
18 
19 #include <memory>
20 #include <quantum/interface/quantum_itask.h>
21 #include <quantum/interface/quantum_iterminate.h>
22 
23 namespace Bloomberg {
24 namespace quantum {
25 
26 //==============================================================================================
27 // interface ITaskAccessor
28 //==============================================================================================
31 struct ITaskAccessor : public ITerminate
32 {
33  using Ptr = std::shared_ptr<ITaskAccessor>;
34 
35  virtual void setTask(ITask::Ptr task) = 0;
36 
37  virtual ITask::Ptr getTask() const = 0;
38 
39  virtual bool isBlocked() const = 0;
40 
41  virtual bool isSleeping(bool updateTimer = false) = 0;
42 };
43 
45 
46 }}
47 
48 #endif //BLOOMBERG_QUANTUM_ITASK_ACCESSOR_H
virtual void setTask(ITask::Ptr task)=0
virtual bool isBlocked() const =0
Definition: quantum_buffer_impl.h:22
ITaskAccessor::Ptr ITaskAccessorPtr
Definition: quantum_itask_accessor.h:44
std::shared_ptr< ITask > Ptr
Definition: quantum_itask.h:34
virtual bool isSleeping(bool updateTimer=false)=0
Interface to a task accessor. For internal use only.
Definition: quantum_itask_accessor.h:31
virtual ITask::Ptr getTask() const =0
std::shared_ptr< ITaskAccessor > Ptr
Definition: quantum_itask_accessor.h:33