QuantumLibrary
quantum_itask_continuation.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_ITASKCONTINUATION_H
17 #define BLOOMBERG_QUANTUM_ITASKCONTINUATION_H
18 
19 #include <quantum/interface/quantum_itask.h>
20 #include <memory>
21 
22 namespace Bloomberg {
23 namespace quantum {
24 
25 //==============================================================================================
26 // interface ITaskContinuation
27 //==============================================================================================
30 struct ITaskContinuation : public ITask
31 {
32  using Ptr = std::shared_ptr<ITaskContinuation>;
33  using WeakPtr = std::weak_ptr<ITaskContinuation>;
34 
35  virtual Ptr getNextTask() = 0;
36 
37  virtual void setNextTask(Ptr nextTask) = 0;
38 
39  virtual Ptr getPrevTask() = 0;
40 
41  virtual void setPrevTask(Ptr nextTask) = 0;
42 
43  virtual Ptr getFirstTask() = 0;
44 
45  virtual Ptr getErrorHandlerOrFinalTask() = 0;
46 };
47 
50 
51 }}
52 
53 #endif //BLOOMBERG_QUANTUM_ITASKCONTINUATION_H
Definition: quantum_buffer_impl.h:22
std::weak_ptr< ITaskContinuation > WeakPtr
Definition: quantum_itask_continuation.h:33
std::shared_ptr< ITaskContinuation > Ptr
Definition: quantum_itask_continuation.h:32
std::shared_ptr< ITask > Ptr
Definition: quantum_itask.h:34
ITaskContinuation::Ptr ITaskContinuationPtr
Definition: quantum_itask_continuation.h:48
virtual void setNextTask(Ptr nextTask)=0
std::weak_ptr< ITask > WeakPtr
Definition: quantum_itask.h:35
Interface to a task continuation. For internal use only.
Definition: quantum_itask_continuation.h:30
virtual void setPrevTask(Ptr nextTask)=0
Interface to a task. For internal use only.
Definition: quantum_itask.h:32
ITaskContinuation::WeakPtr ITaskContinuationWeakPtr
Definition: quantum_itask_continuation.h:49