Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #ifndef PROTOCOL_H
- #define PROTOCOL_H
- #include <vector>
- enum RequestType {START, GET_DATA, GET_GRAPH, STOP};
- enum DatasetType {ZACHARY, MOVIELENS};
- enum ReplyType {STARTED, POST_DATA, POST_GRAPH, STOPPED};
- enum State {OK, FAIL};
- struct Request { //Request to server
- RequestType type;
- DatasetType dataset;
- size_t filenameSize;
- string fileName;
- };
- struct ReplyState { //Reply to a START/STOP Request
- ReplyType type;
- State state;
- };
- struct ReplyData { //Reply to a GET_DATA Request
- ReplyType type;
- size_t num_vertex;
- vector<int> solution;
- double fitness;
- };
- struct ReplyGraph { //Replay to a GET_GRAPH Request
- ReplyType type;
- size_t num_edges;
- std::vector<std::array<int, 2>> edges;
- };
- #endif // PROTOCOL_H
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement