A platform for high-performance distributed tool and library development written in C++. It can be deployed in two different cluster modes: standalone or distributed. API for v0.5.0, released on June 13, 2018.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
PipelineContext.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * *
3  * Copyright 2018 Rice University *
4  * *
5  * Licensed under the Apache License, Version 2.0 (the "License"); *
6  * you may not use this file except in compliance with the License. *
7  * You may obtain a copy of the License at *
8  * *
9  * http://www.apache.org/licenses/LICENSE-2.0 *
10  * *
11  * Unless required by applicable law or agreed to in writing, software *
12  * distributed under the License is distributed on an "AS IS" BASIS, *
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. *
14  * See the License for the specific language governing permissions and *
15  * limitations under the License. *
16  * *
17  *****************************************************************************/
18 #ifndef PIPELINE_CONTEXT_H
19 #define PIPELINE_CONTEXT_H
20 
21 // by Jia, Oct 2016
22 
23 #include "Handle.h"
24 #include "PDBVector.h"
25 #include "Object.h"
26 #include "DataProxy.h"
27 #include "SetSpecifier.h"
28 #include <memory>
29 
30 
31 namespace pdb {
32 
34 typedef std::shared_ptr<PipelineContext> PipelineContextPtr;
35 
36 // this class encapsulates the global state that is shared by pipeline nodes in the same pipeline
37 // network
39 
40 public:
41  // temporarily make this public for getRecord()
42  // the final output vector that needs to invoke getRecord() on
44 
45 
46 private:
47  // the proxy to pin/unpin output page
49 
50  // the output set identifier
52 
53  // whether output page is full
55 
56  // page to unpin
58 
59 
60 public:
62  this->outputVec = nullptr;
63  this->outputSet = nullptr;
64  }
65 
66 
70  this->outputVec = outputVec;
71  this->proxy = proxy;
72  this->outputSet = outputSet;
73  this->outputPageFull = false;
74  this->pageToUnpin = nullptr;
75  }
76 
78  return this->outputVec;
79  }
80 
82  this->outputVec = outputVec;
83  }
84 
85  void clearOutputPage() {
86  outputVec = nullptr;
87  }
88 
90  return this->proxy;
91  }
92 
94  return this->outputSet;
95  }
96 
97  void setOutputFull(bool fullOrNot) {
98  this->outputPageFull = fullOrNot;
99  }
100 
101  bool isOutputFull() {
102  return this->outputPageFull;
103  }
104 
106  this->pageToUnpin = page;
107  }
108 
110  return this->pageToUnpin;
111  }
112 };
113 }
114 
115 
116 #endif
shared_ptr< PDBPage > PDBPagePtr
Definition: PDBPage.h:32
shared_ptr< DataProxy > DataProxyPtr
Definition: DataProxy.h:30
Handle< Vector< Handle< Object > > > & getOutputVec()
void setOutputFull(bool fullOrNot)
Handle< Vector< Handle< Object > > > outputVec
std::shared_ptr< PipelineContext > PipelineContextPtr
DataProxyPtr getProxy()
SetSpecifierPtr getOutputSet()
SetSpecifierPtr outputSet
PipelineContext(Handle< Vector< Handle< Object >>> outputVec, DataProxyPtr proxy, SetSpecifierPtr outputSet)
std::shared_ptr< SetSpecifier > SetSpecifierPtr
Definition: SetSpecifier.h:28
void setPageToUnpin(PDBPagePtr page)
void setOutputVec(Handle< Vector< Handle< Object >>> outputVec)
PDBPagePtr getPageToUnpin()