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
StandardResourceInfo.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 STANDARD_RESOURCE_INFO_H
20 #define STANDARD_RESOURCE_INFO_H
21 
22 #include <memory>
23 namespace pdb {
24 
26 typedef std::shared_ptr<StandardResourceInfo> StandardResourceInfoPtr;
27 
28 
33 
34 public:
36 
38 
39  StandardResourceInfo(int numCores, int memSize, std::string address, int port, int nodeId)
40  : numCores(numCores), memSize(memSize), address(address), port(port), nodeId(nodeId) {}
41 
42  // To get number of CPUs in this resource
43  // <=0 for unknown
44  int getNumCores() {
45  return this->numCores;
46  }
47  // <=0 for unknown
48  void setNumCores(int numCores) {
49  this->numCores = numCores;
50  }
51 
52  // To get size of memory in this resource
53  // <= 0 for unknown
54  int getMemSize() {
55  return this->memSize;
56  }
57  // <= 0 for unknown
58  void setMemSize(int memSize) {
59  this->memSize = memSize;
60  }
61 
62 
63  std::string& getAddress() {
64  return address;
65  }
66 
67  void setAddress(std::string& address) {
68  this->address = address;
69  }
70 
72  return this->nodeId;
73  }
74 
76  this->nodeId = nodeId;
77  }
78 
79  int getPort() {
80 
81  return port;
82  }
83 
84  void setPort(int port) {
85 
86  this->port = port;
87  }
88 
89 
90 private:
91  // number of CPU cores
92  int numCores;
93 
94  // size of memory in MB
95  int memSize;
96 
97  // hostname or IP address of the PDB server
98  std::string address;
99 
100  // port of the PDB server
101  int port;
102 
103  // NodeID of the PDB server
105 };
106 }
107 
108 #endif
void setNodeId(NodeID nodeId)
unsigned int NodeID
Definition: DataTypes.h:27
std::shared_ptr< StandardResourceInfo > StandardResourceInfoPtr
StandardResourceInfo(int numCores, int memSize, std::string address, int port, int nodeId)
void setNumCores(int numCores)
void setAddress(std::string &address)