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
ResourceInfo.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 RESOURCE_INFO_H
20 #define RESOURCE_INFO_H
21 
22 #include "Object.h"
23 #include "Handle.h"
24 #include "PDBString.h"
25 #include "DataTypes.h"
26 
27 // PRELOAD %ResourceInfo%
28 
29 namespace pdb {
30 
34 class ResourceInfo : public Object {
35 
36 public:
38 
40 
41  ResourceInfo(int numCores, int memSize, std::string address, int port, int nodeId)
42  : numCores(numCores), memSize(memSize), address(address), port(port), nodeId(nodeId) {}
43 
44  // To get number of CPUs in this resource
45  int getNumCores() {
46  return this->numCores;
47  }
48 
49  void setNumCores(int numCores) {
50  this->numCores = numCores;
51  }
52 
53  // To get size of memory in this resource
54  int getMemSize() {
55  return this->memSize;
56  }
57 
58  void setMemSize(int memSize) {
59  this->memSize = memSize;
60  }
61 
62 
64  return address;
65  }
66 
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 
90 
91 private:
92  // number of CPU cores
93  int numCores;
94 
95  // size of memory in MB
96  int memSize;
97 
98  // hostname or IP address of the PDB server
100 
101  // port of the PDB server
102  int port;
103 
104  // NodeID of the PDB server
106 };
107 }
108 
109 #endif
#define ENABLE_DEEP_COPY
Definition: DeepCopy.h:52
void setAddress(pdb::String &address)
Definition: ResourceInfo.h:67
ResourceInfo(int numCores, int memSize, std::string address, int port, int nodeId)
Definition: ResourceInfo.h:41
unsigned int NodeID
Definition: DataTypes.h:27
String & getAddress()
Definition: ResourceInfo.h:63
NodeID getNodeId()
Definition: ResourceInfo.h:71
void setMemSize(int memSize)
Definition: ResourceInfo.h:58
void setPort(int port)
Definition: ResourceInfo.h:84
void setNumCores(int numCores)
Definition: ResourceInfo.h:49
void setNodeId(NodeID nodeId)
Definition: ResourceInfo.h:75