-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathMyService_server.skeleton.cpp
More file actions
109 lines (86 loc) · 3.22 KB
/
MyService_server.skeleton.cpp
File metadata and controls
109 lines (86 loc) · 3.22 KB
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
// This autogenerated skeleton file illustrates how to build a server.
// You should copy it to another filename to avoid overwriting it.
#include "MyService.h"
#include <protocol/TBinaryProtocol.h>
#include <server/TSimpleServer.h>
#include <transport/TServerSocket.h>
#include <transport/TBufferTransports.h>
using namespace ::apache::thrift;
using namespace ::apache::thrift::protocol;
using namespace ::apache::thrift::transport;
using namespace ::apache::thrift::server;
using boost::shared_ptr;
using namespace ::mp2;
class MyServiceHandler : virtual public MyServiceIf {
public:
MyServiceHandler() {
// Your initialization goes here
}
void get_predecessor(finger_entry& _return) {
// Your implementation goes here
printf("get_predecessor\n");
}
void get_successor(finger_entry& _return) {
// Your implementation goes here
printf("get_successor\n");
}
void find_successor(finger_entry& _return, const int32_t id) {
// Your implementation goes here
printf("find_successor\n");
}
void find_predecessor(finger_entry& _return, const int32_t id) {
// Your implementation goes here
printf("find_predecessor\n");
}
void closest_preceding_finger(finger_entry& _return, const int32_t id) {
// Your implementation goes here
printf("closest_preceding_finger\n");
}
void notify(const finger_entry& n) {
// Your implementation goes here
printf("notify\n");
}
void gateway_add_file_self(std::string& _return, const std::string& name, const std::string& content) {
// Your implementation goes here
printf("gateway_add_file_self\n");
}
void gateway_add_file_other(std::string& _return, const std::string& name, const std::string& content) {
// Your implementation goes here
printf("gateway_add_file_other\n");
}
void gateway_del_file_self(std::string& _return, const std::string& name) {
// Your implementation goes here
printf("gateway_del_file_self\n");
}
void gateway_del_file_other(std::string& _return, const std::string& name) {
// Your implementation goes here
printf("gateway_del_file_other\n");
}
void gateway_get_file_self(std::string& _return, const std::string& name) {
// Your implementation goes here
printf("gateway_get_file_self\n");
}
void gateway_get_file_other(std::string& _return, const std::string& name) {
// Your implementation goes here
printf("gateway_get_file_other\n");
}
void gateway_get_self_table(std::string& _return) {
// Your implementation goes here
printf("gateway_get_self_table\n");
}
void gateway_get_other_table(std::string& _return, const int32_t id) {
// Your implementation goes here
printf("gateway_get_other_table\n");
}
};
int main(int argc, char **argv) {
int port = 9090;
shared_ptr<MyServiceHandler> handler(new MyServiceHandler());
shared_ptr<TProcessor> processor(new MyServiceProcessor(handler));
shared_ptr<TServerTransport> serverTransport(new TServerSocket(port));
shared_ptr<TTransportFactory> transportFactory(new TBufferedTransportFactory());
shared_ptr<TProtocolFactory> protocolFactory(new TBinaryProtocolFactory());
TSimpleServer server(processor, serverTransport, transportFactory, protocolFactory);
server.serve();
return 0;
}