-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdataCenterGroup.h
More file actions
34 lines (27 loc) · 938 Bytes
/
Copy pathdataCenterGroup.h
File metadata and controls
34 lines (27 loc) · 938 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#ifndef DTS_EX2_DATACENTERGROUP_H
#define DTS_EX2_DATACENTERGROUP_H
#include "server.h"
#include "key.h"
#include "avl.h"
#include "assert.h"
#include "memory"
class DataCenterGroup{
private:
Avl<Key,Server>* traffic_rank_tree;
int num_of_DCs;
int num_of_Servers;
public:
int getNumOfDCs();
int getNumOfServers();
void setNumOfDCs(int NumOfDCs);
void setNumOfServers(int NumOfServers);
Avl<Key,Server>* getTrafficRankTree();
void setTrafficRankTree(Avl<Key,Server>* tree);
DataCenterGroup(): traffic_rank_tree(new Avl<Key,Server>), num_of_DCs(1),num_of_Servers(0){};
~DataCenterGroup();
DataCenterGroup& operator=(const DataCenterGroup& dc) = delete;
DataCenterGroup(const DataCenterGroup& dc) = delete;
void removeServer(int server_ID, int traffic);
void addServer(int serverID, int traffic, const std::shared_ptr<Server>& server);
};
#endif //DTS_EX2_DATACENTERGROUP_H