-
Notifications
You must be signed in to change notification settings - Fork 0
/
my_loadBalancer.hpp
40 lines (33 loc) · 946 Bytes
/
my_loadBalancer.hpp
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
35
36
37
38
39
40
#ifndef MY_LOADBALANCER_HPP
#define MY_LOADBALANCER_HPP
#include <dirent.h>
#include <bits/stdc++.h>
#include <fstream>
#include <sys/stat.h>
#include <unistd.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <sys/wait.h>
#include "my_defines.hpp"
#include "Tools.hpp"
class LoadBalancer {
private:
std::string commandFilePath;
std::string AssetsPath;
std::string LoadbalancerFinalRes;
std::vector<std::string> FinalResVector;
std::vector<std::vector<std::string>> commands;
std::vector<std::string> DistributorNamedPipes;
std::vector<std::vector<int>> DistributorPipes;
size_t NumOfCommands;
char loadbalancerBuff[MSGSIZE];
public:
LoadBalancer(std::string command_file_name, std::string dir_name);
void InputHandler();
void CreateNamedPipe();
void CreateDistributorPipes();
void CreateDistributors();
void ReceiveDataFromDistributors();
void ShowFinalResult();
};
#endif