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
SetIdentifier.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 SET_IDENTIFIER_H
20 #define SET_IDENTIFIER_H
21 
22 #include "Object.h"
23 #include "Handle.h"
24 #include "PDBString.h"
25 #include "DataTypes.h"
26 
27 // PRELOAD %SetIdentifier%
28 
29 namespace pdb {
30 
31 // encapsulates a request to add a set in storage
32 class SetIdentifier : public Object {
33 
34  public:
36 
39 
40  SetIdentifier(std::string dataBase, std::string setName)
41  : dataBase(dataBase), setName(setName) {
44  }
45 
46  SetIdentifier(std::string dataBase,
47  std::string setName,
49  bool isProbingAggregationResult)
50  : dataBase(dataBase),
51  setName(setName),
52  setType(setType),
53  isAggregationResultOrNot(isProbingAggregationResult) {}
54 
55  std::string getDatabase() {
56  return dataBase;
57  }
58 
59  std::string getSetName() {
60  return setName;
61  }
62 
64  this->dbId = dbId;
65  }
66 
68  this->typeId = typeId;
69  }
70 
72  this->setId = setId;
73  }
74 
76  return dbId;
77  }
78 
80  return typeId;
81  }
82 
84  return setId;
85  }
86 
88  return setType;
89  }
90 
92  return this->isAggregationResultOrNot;
93  }
94 
95  void setNumPages(size_t numPages) {
96  this->numPages = numPages;
97  }
98 
99  size_t getNumPages() {
100  return this->numPages;
101  }
102 
103  void setPageSize(size_t pageSize) {
104  this->pageSize = pageSize;
105  }
106 
107  size_t getPageSize() {
108  return this->pageSize;
109  }
110 
111  std::string toSourceSetName() {
112  return getDatabase() + ":" + getSetName();
113  }
114 
121  return dataBase == rhs.dataBase && setName == rhs.setName;
122  }
123 
130  return !(rhs == *this);
131  }
132 
133  private:
141  size_t numPages;
142  size_t pageSize;
143 };
144 }
145 
146 #endif
#define ENABLE_DEEP_COPY
Definition: DeepCopy.h:52
unsigned int SetID
Definition: DataTypes.h:31
ENABLE_DEEP_COPY SetIdentifier()
Definition: SetIdentifier.h:37
void setPageSize(size_t pageSize)
SetType
Definition: DataTypes.h:76
SetType getSetType()
Definition: SetIdentifier.h:87
UserTypeID getTypeId()
Definition: SetIdentifier.h:79
DatabaseID getDatabaseId()
Definition: SetIdentifier.h:75
void setTypeId(UserTypeID typeId)
Definition: SetIdentifier.h:67
void setSetId(SetID setId)
Definition: SetIdentifier.h:71
bool isAggregationResult()
Definition: SetIdentifier.h:91
unsigned int DatabaseID
Definition: DataTypes.h:29
bool operator==(SetIdentifier &rhs)
bool operator!=(SetIdentifier &rhs)
SetIdentifier(std::string dataBase, std::string setName)
Definition: SetIdentifier.h:40
std::string toSourceSetName()
void setDatabaseId(DatabaseID dbId)
Definition: SetIdentifier.h:63
std::string getSetName()
Definition: SetIdentifier.h:59
std::string getDatabase()
Definition: SetIdentifier.h:55
SetIdentifier(std::string dataBase, std::string setName, SetType setType, bool isProbingAggregationResult)
Definition: SetIdentifier.h:46
void setNumPages(size_t numPages)
Definition: SetIdentifier.h:95
unsigned int UserTypeID
Definition: DataTypes.h:25