2016-02-03 14:26:01 +03:00
|
|
|
#ifndef MULTIVERSO_NODE_H_
|
|
|
|
#define MULTIVERSO_NODE_H_
|
|
|
|
|
|
|
|
namespace multiverso {
|
|
|
|
|
2016-03-24 09:35:42 +03:00
|
|
|
enum Role {
|
2016-04-17 14:56:58 +03:00
|
|
|
NONE = 0,
|
2016-03-24 09:35:42 +03:00
|
|
|
WORKER = 1,
|
2016-04-17 14:56:58 +03:00
|
|
|
SERVER = 2,
|
|
|
|
ALL = 3
|
2016-03-24 09:35:42 +03:00
|
|
|
};
|
|
|
|
|
2016-02-03 14:26:01 +03:00
|
|
|
struct Node {
|
|
|
|
int rank;
|
|
|
|
int role;
|
|
|
|
int worker_id;
|
|
|
|
int server_id;
|
|
|
|
|
|
|
|
Node();
|
|
|
|
};
|
|
|
|
|
|
|
|
namespace node {
|
|
|
|
|
|
|
|
bool is_worker(int role);
|
|
|
|
bool is_server(int role);
|
|
|
|
|
2016-04-08 11:57:29 +03:00
|
|
|
} // namespace node
|
|
|
|
|
|
|
|
} // namespace multiverso
|
2016-02-03 14:26:01 +03:00
|
|
|
|
2016-04-08 11:57:29 +03:00
|
|
|
#endif // MULTIVERSO_NODE_H_
|