Commit 02fca968 authored by Vaastav Anand's avatar Vaastav Anand

Add return value propagation; Not working fully yet

parent 0a576bb2
......@@ -20,12 +20,12 @@ class CastInfoServiceHandler : virtual public CastInfoServiceIf {
// Your initialization goes here
}
void WriteCastInfo(const int64_t req_id, const int64_t cast_info_id, const std::string& name, const bool gender, const std::string& intro, const std::map<std::string, std::string> & carrier) {
void WriteCastInfo(BaseRpcResponse& _return, const int64_t req_id, const int64_t cast_info_id, const std::string& name, const bool gender, const std::string& intro, const std::map<std::string, std::string> & carrier) {
// Your implementation goes here
printf("WriteCastInfo\n");
}
void ReadCastInfo(std::vector<CastInfo> & _return, const int64_t req_id, const std::vector<int64_t> & cast_ids, const std::map<std::string, std::string> & carrier) {
void ReadCastInfo(CastInfoListRpcResponse& _return, const int64_t req_id, const std::vector<int64_t> & cast_ids, const std::map<std::string, std::string> & carrier) {
// Your implementation goes here
printf("ReadCastInfo\n");
}
......@@ -34,11 +34,11 @@ class CastInfoServiceHandler : virtual public CastInfoServiceIf {
int main(int argc, char **argv) {
int port = 9090;
::apache::thrift::stdcxx::shared_ptr<CastInfoServiceHandler> handler(new CastInfoServiceHandler());
::apache::thrift::stdcxx::shared_ptr<TProcessor> processor(new CastInfoServiceProcessor(handler));
::apache::thrift::stdcxx::shared_ptr<TServerTransport> serverTransport(new TServerSocket(port));
::apache::thrift::stdcxx::shared_ptr<TTransportFactory> transportFactory(new TBufferedTransportFactory());
::apache::thrift::stdcxx::shared_ptr<TProtocolFactory> protocolFactory(new TBinaryProtocolFactory());
::std::shared_ptr<CastInfoServiceHandler> handler(new CastInfoServiceHandler());
::std::shared_ptr<TProcessor> processor(new CastInfoServiceProcessor(handler));
::std::shared_ptr<TServerTransport> serverTransport(new TServerSocket(port));
::std::shared_ptr<TTransportFactory> transportFactory(new TBufferedTransportFactory());
::std::shared_ptr<TProtocolFactory> protocolFactory(new TBinaryProtocolFactory());
TSimpleServer server(processor, serverTransport, transportFactory, protocolFactory);
server.serve();
......
......@@ -20,27 +20,27 @@ class ComposeReviewServiceHandler : virtual public ComposeReviewServiceIf {
// Your initialization goes here
}
void UploadText(const int64_t req_id, const std::string& text, const std::map<std::string, std::string> & carrier) {
void UploadText(BaseRpcResponse& _return, const int64_t req_id, const std::string& text, const std::map<std::string, std::string> & carrier) {
// Your implementation goes here
printf("UploadText\n");
}
void UploadRating(const int64_t req_id, const int32_t rating, const std::map<std::string, std::string> & carrier) {
void UploadRating(BaseRpcResponse& _return, const int64_t req_id, const int32_t rating, const std::map<std::string, std::string> & carrier) {
// Your implementation goes here
printf("UploadRating\n");
}
void UploadMovieId(const int64_t req_id, const std::string& movie_id, const std::map<std::string, std::string> & carrier) {
void UploadMovieId(BaseRpcResponse& _return, const int64_t req_id, const std::string& movie_id, const std::map<std::string, std::string> & carrier) {
// Your implementation goes here
printf("UploadMovieId\n");
}
void UploadUniqueId(const int64_t req_id, const int64_t unique_id, const std::map<std::string, std::string> & carrier) {
void UploadUniqueId(BaseRpcResponse& _return, const int64_t req_id, const int64_t unique_id, const std::map<std::string, std::string> & carrier) {
// Your implementation goes here
printf("UploadUniqueId\n");
}
void UploadUserId(const int64_t req_id, const int64_t user_id, const std::map<std::string, std::string> & carrier) {
void UploadUserId(BaseRpcResponse& _return, const int64_t req_id, const int64_t user_id, const std::map<std::string, std::string> & carrier) {
// Your implementation goes here
printf("UploadUserId\n");
}
......@@ -49,11 +49,11 @@ class ComposeReviewServiceHandler : virtual public ComposeReviewServiceIf {
int main(int argc, char **argv) {
int port = 9090;
::apache::thrift::stdcxx::shared_ptr<ComposeReviewServiceHandler> handler(new ComposeReviewServiceHandler());
::apache::thrift::stdcxx::shared_ptr<TProcessor> processor(new ComposeReviewServiceProcessor(handler));
::apache::thrift::stdcxx::shared_ptr<TServerTransport> serverTransport(new TServerSocket(port));
::apache::thrift::stdcxx::shared_ptr<TTransportFactory> transportFactory(new TBufferedTransportFactory());
::apache::thrift::stdcxx::shared_ptr<TProtocolFactory> protocolFactory(new TBinaryProtocolFactory());
::std::shared_ptr<ComposeReviewServiceHandler> handler(new ComposeReviewServiceHandler());
::std::shared_ptr<TProcessor> processor(new ComposeReviewServiceProcessor(handler));
::std::shared_ptr<TServerTransport> serverTransport(new TServerSocket(port));
::std::shared_ptr<TTransportFactory> transportFactory(new TBufferedTransportFactory());
::std::shared_ptr<TProtocolFactory> protocolFactory(new TBinaryProtocolFactory());
TSimpleServer server(processor, serverTransport, transportFactory, protocolFactory);
server.serve();
......
This diff is collapsed.
......@@ -20,12 +20,12 @@ class MovieIdServiceHandler : virtual public MovieIdServiceIf {
// Your initialization goes here
}
void UploadMovieId(const int64_t req_id, const std::string& title, const int32_t rating, const std::map<std::string, std::string> & carrier) {
void UploadMovieId(BaseRpcResponse& _return, const int64_t req_id, const std::string& title, const int32_t rating, const std::map<std::string, std::string> & carrier) {
// Your implementation goes here
printf("UploadMovieId\n");
}
void RegisterMovieId(const int64_t req_id, const std::string& title, const std::string& movie_id, const std::map<std::string, std::string> & carrier) {
void RegisterMovieId(BaseRpcResponse& _return, const int64_t req_id, const std::string& title, const std::string& movie_id, const std::map<std::string, std::string> & carrier) {
// Your implementation goes here
printf("RegisterMovieId\n");
}
......@@ -34,11 +34,11 @@ class MovieIdServiceHandler : virtual public MovieIdServiceIf {
int main(int argc, char **argv) {
int port = 9090;
::apache::thrift::stdcxx::shared_ptr<MovieIdServiceHandler> handler(new MovieIdServiceHandler());
::apache::thrift::stdcxx::shared_ptr<TProcessor> processor(new MovieIdServiceProcessor(handler));
::apache::thrift::stdcxx::shared_ptr<TServerTransport> serverTransport(new TServerSocket(port));
::apache::thrift::stdcxx::shared_ptr<TTransportFactory> transportFactory(new TBufferedTransportFactory());
::apache::thrift::stdcxx::shared_ptr<TProtocolFactory> protocolFactory(new TBinaryProtocolFactory());
::std::shared_ptr<MovieIdServiceHandler> handler(new MovieIdServiceHandler());
::std::shared_ptr<TProcessor> processor(new MovieIdServiceProcessor(handler));
::std::shared_ptr<TServerTransport> serverTransport(new TServerSocket(port));
::std::shared_ptr<TTransportFactory> transportFactory(new TBufferedTransportFactory());
::std::shared_ptr<TProtocolFactory> protocolFactory(new TBinaryProtocolFactory());
TSimpleServer server(processor, serverTransport, transportFactory, protocolFactory);
server.serve();
......
......@@ -20,12 +20,12 @@ class MovieReviewServiceHandler : virtual public MovieReviewServiceIf {
// Your initialization goes here
}
void UploadMovieReview(const int64_t req_id, const std::string& movie_id, const int64_t review_id, const int64_t timestamp, const std::map<std::string, std::string> & carrier) {
void UploadMovieReview(BaseRpcResponse& _return, const int64_t req_id, const std::string& movie_id, const int64_t review_id, const int64_t timestamp, const std::map<std::string, std::string> & carrier) {
// Your implementation goes here
printf("UploadMovieReview\n");
}
void ReadMovieReviews(std::vector<Review> & _return, const int64_t req_id, const std::string& movie_id, const int32_t start, const int32_t stop, const std::map<std::string, std::string> & carrier) {
void ReadMovieReviews(ReviewListRpcResponse& _return, const int64_t req_id, const std::string& movie_id, const int32_t start, const int32_t stop, const std::map<std::string, std::string> & carrier) {
// Your implementation goes here
printf("ReadMovieReviews\n");
}
......@@ -34,11 +34,11 @@ class MovieReviewServiceHandler : virtual public MovieReviewServiceIf {
int main(int argc, char **argv) {
int port = 9090;
::apache::thrift::stdcxx::shared_ptr<MovieReviewServiceHandler> handler(new MovieReviewServiceHandler());
::apache::thrift::stdcxx::shared_ptr<TProcessor> processor(new MovieReviewServiceProcessor(handler));
::apache::thrift::stdcxx::shared_ptr<TServerTransport> serverTransport(new TServerSocket(port));
::apache::thrift::stdcxx::shared_ptr<TTransportFactory> transportFactory(new TBufferedTransportFactory());
::apache::thrift::stdcxx::shared_ptr<TProtocolFactory> protocolFactory(new TBinaryProtocolFactory());
::std::shared_ptr<MovieReviewServiceHandler> handler(new MovieReviewServiceHandler());
::std::shared_ptr<TProcessor> processor(new MovieReviewServiceProcessor(handler));
::std::shared_ptr<TServerTransport> serverTransport(new TServerSocket(port));
::std::shared_ptr<TTransportFactory> transportFactory(new TBufferedTransportFactory());
::std::shared_ptr<TProtocolFactory> protocolFactory(new TBinaryProtocolFactory());
TSimpleServer server(processor, serverTransport, transportFactory, protocolFactory);
server.serve();
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment