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
StorageGetDataResponse.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 STORAGE_GET_DATA_RESPONSE_H
20 #define STORAGE_GET_DATA_RESPONSE_H
21 
22 #include "Object.h"
23 #include "Handle.h"
24 #include <utility>
25 
26 // PRELOAD %StorageGetDataResponse%
27 
28 namespace pdb {
29 
30 // encapsulates a response for request to obtain data from a storage set
32 
33 public:
37  std::string databaseName,
38  std::string setName,
39  size_t rawPageSize,
40  size_t pageSize,
41  bool success,
42  std::string errMsg)
43  : numPages(numPages),
44  databaseName(databaseName),
45  setName(setName),
46  rawPageSize(rawPageSize),
47  pageSize(pageSize),
48  errMsg(errMsg),
49  success(success) {}
50 
51  int getNumPages() {
52  return numPages;
53  }
54 
55  std::string getDatabaseName() {
56  return databaseName;
57  }
58 
59  std::string getSetName() {
60  return setName;
61  }
62 
63  std::pair<bool, std::string> wasSuccessful() {
64  return std::make_pair(success, errMsg);
65  }
66 
67  size_t getRawPageSize() {
68  return rawPageSize;
69  }
70 
71  size_t getPageSize() {
72  return pageSize;
73  }
74 
76 
77 private:
78  int numPages;
79  std::string databaseName;
80  std::string setName;
81  size_t rawPageSize;
82  size_t pageSize;
84  bool success;
85 };
86 }
87 
88 #endif
#define ENABLE_DEEP_COPY
Definition: DeepCopy.h:52
std::pair< bool, std::string > wasSuccessful()
StorageGetDataResponse(int numPages, std::string databaseName, std::string setName, size_t rawPageSize, size_t pageSize, bool success, std::string errMsg)