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
TupleSpec.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 
19 #ifndef TUPLE_SPEC_H
20 #define TUPLE_SPEC_H
21 
22 #include <iostream>
23 #include <memory>
24 #include <stdlib.h>
25 #include <string>
26 #include <utility>
27 #include <vector>
28 #include <map>
29 
30 #include "AttList.h"
31 
32 // and here is the specifier for a TupleSet... it is basically a bunch of attribute
33 // names, as well as the name of the TupleSet
34 struct TupleSpec {
35 
36 private:
37  std::string setName;
38  std::vector<std::string> atts;
39 
40 public:
42  setName = std::string("Empty");
43  }
44 
46 
47  TupleSpec(std::string setNameIn) {
48  setName = setNameIn;
49  }
50 
51  TupleSpec(std::string setNameIn, AttList& useMe) {
52  setName = setNameIn;
53  atts = useMe.atts;
54  }
55 
56  std::string& getSetName() {
57  return setName;
58  }
59 
60  std::vector<std::string>& getAtts() {
61  return atts;
62  }
63 
64  bool operator==(const TupleSpec& toMe) {
65  return setName == toMe.setName;
66  }
67 
68  friend std::ostream& operator<<(std::ostream& os, const TupleSpec& printMe);
69 };
70 
71 inline std::ostream& operator<<(std::ostream& os, const TupleSpec& printMe) {
72  os << printMe.setName << " (";
73  bool first = true;
74  for (auto& a : printMe.atts) {
75  if (!first)
76  os << ", ";
77  first = false;
78  os << a;
79  }
80  os << ")";
81  return os;
82 }
83 
84 #endif
std::vector< std::string > & getAtts()
Definition: TupleSpec.h:60
~TupleSpec()
Definition: TupleSpec.h:45
std::vector< std::string > atts
Definition: TupleSpec.h:38
std::string & getSetName()
Definition: TupleSpec.h:56
PolicyList< OtherPolicies...>::type first()
std::ostream & operator<<(std::ostream &os, const TupleSpec &printMe)
Definition: TupleSpec.h:71
TupleSpec(std::string setNameIn)
Definition: TupleSpec.h:47
friend std::ostream & operator<<(std::ostream &os, const TupleSpec &printMe)
Definition: TupleSpec.h:71
std::string setName
Definition: TupleSpec.h:37
TupleSpec(std::string setNameIn, AttList &useMe)
Definition: TupleSpec.h:51
TupleSpec()
Definition: TupleSpec.h:41
bool operator==(const TupleSpec &toMe)
Definition: TupleSpec.h:64
std::vector< std::string > atts
Definition: AttList.h:34