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
InputTupleSetSpecifier.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 INPUT_TUPLESET_SPECIFIER_HEADER
19 #define INPUT_TUPLESET_SPECIFIER_HEADER
20 
21 
22 namespace pdb {
23 
25 
26 public:
27  // default constructor
29  this->tupleSetName = "";
30  }
31 
32 
33  // constructor
35  std::vector<std::string> columnNamesToKeep,
36  std::vector<std::string> columnNamesToApply) {
37 
38  this->tupleSetName = tupleSetName;
39 
40  for (int i = 0; i < columnNamesToKeep.size(); i++) {
41  this->columnNamesToKeep.push_back(columnNamesToKeep[i]);
42  }
43  for (int i = 0; i < columnNamesToApply.size(); i++) {
44  this->columnNamesToApply.push_back(columnNamesToApply[i]);
45  }
46  }
47 
48  // destructor
50 
51  // return tuple set name
52  std::string& getTupleSetName() {
53  return this->tupleSetName;
54  }
55 
56  // return column names to keep in the output
57 
58  std::vector<std::string>& getColumnNamesToKeep() {
59  return this->columnNamesToKeep;
60  }
61 
62  // return column names to apply a lambda
63 
64  std::vector<std::string>& getColumnNamesToApply() {
65  return this->columnNamesToApply;
66  }
67 
68  // print
69 
70  void print() {
71 
72  std::cout << "TupleSetName:" << tupleSetName << std::endl;
73  std::cout << "Columns to keep in output:" << std::endl;
74  for (int i = 0; i < columnNamesToKeep.size(); i++) {
75  std::cout << columnNamesToKeep[i] << std::endl;
76  }
77  std::cout << "Columns to apply:" << std::endl;
78  for (int i = 0; i < columnNamesToApply.size(); i++) {
79  std::cout << columnNamesToApply[i] << std::endl;
80  }
81  }
82 
83  void clear() {
84  this->columnNamesToKeep.clear();
85  this->columnNamesToApply.clear();
86  }
87 
88 private:
89  // name of the the tuple set
90  std::string tupleSetName;
91 
92  // column names in the tuple set to keep in the output
93  std::vector<std::string> columnNamesToKeep;
94 
95  // column names in the tuple set to apply
96  std::vector<std::string> columnNamesToApply;
97 };
98 }
99 
100 #endif
std::vector< std::string > & getColumnNamesToKeep()
std::vector< std::string > columnNamesToApply
std::vector< std::string > columnNamesToKeep
std::vector< std::string > & getColumnNamesToApply()
InputTupleSetSpecifier(std::string tupleSetName, std::vector< std::string > columnNamesToKeep, std::vector< std::string > columnNamesToApply)