6 #ifndef GMSH_LOCAL_NETWORK_CLIENT_H
7 #define GMSH_LOCAL_NETWORK_CLIENT_H
11 #include "GmshConfig.h"
13 #if defined(HAVE_ONELAB)
22 std::vector<gmshLocalNetworkClient *> _clients;
25 gmshLocalNetworkClient *_father;
28 gmshLocalNetworkClient(
const std::string &name,
const std::string &executable,
29 const std::string &remoteLogin =
"",
30 bool treatExecutableAsFullCommandLine =
false)
31 :
onelab::localNetworkClient(name, executable, remoteLogin,
32 treatExecutableAsFullCommandLine),
37 void setFather(gmshLocalNetworkClient *father) { _father = father; }
38 gmshLocalNetworkClient *getFather() {
return _father; }
39 void addClient(gmshLocalNetworkClient *client) { _clients.push_back(client); }
40 void removeClient(gmshLocalNetworkClient *client)
42 auto it = std::find(_clients.begin(), _clients.end(), client);
43 if(it != _clients.end()) _clients.erase(it);
45 int getNumClients() {
return _clients.size(); }
46 gmshLocalNetworkClient *getClient(
int i)
48 if(i >= 0 && i < getNumClients())
return _clients[i];
51 int getNumConnectedClients()
54 for(
int i = 0; i < getNumClients(); i++) {
55 if(_clients[i]->
getPid() != -1) n++;
59 bool receiveMessage(gmshLocalNetworkClient *master);