mirror of
https://github.com/valitydev/thrift.git
synced 2024-11-07 10:48:51 +00:00
2375312fa0
Summary: The Thrift compiler now generates static methods for every service to generate a reflection of the methods provided by the service. This reflection is fairly limited, but should be enough for what we want to do with SMC. Reviewed By: mcslee Test Plan: test/ReflectionTest.cpp Revert Plan: ok git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665226 13f79535-47bb-0310-9956-ffa450edef68
31 lines
973 B
C++
31 lines
973 B
C++
/*
|
|
../compiler/cpp/thrift -cpp DebugProtoTest.thrift
|
|
../compiler/cpp/thrift -cpp StressTest.thrift
|
|
g++ -Wall -I../lib/cpp/src -I/usr/local/include/boost-1_33_1 \
|
|
ReflectionTest.cpp \
|
|
gen-cpp/StressTest_types.cpp gen-cpp/DebugProtoTest_types.cpp \
|
|
gen-cpp/Service.cpp gen-cpp/PartiallyReflectable.cpp \
|
|
../lib/cpp/.libs/libthrift.a -o ReflectionTest
|
|
./ReflectionTest
|
|
*/
|
|
|
|
#include <iostream>
|
|
#include "gen-cpp/PartiallyReflectable.h"
|
|
#include "gen-cpp/Service.h"
|
|
#include "../lib/cpp/src/protocol/TDebugProtocol.h"
|
|
|
|
int main() {
|
|
using std::cout;
|
|
using std::endl;
|
|
|
|
facebook::thrift::reflection::limited::Service srv1;
|
|
thrift::test::PartiallyReflectableIf::getStaticLimitedReflection(srv1);
|
|
cout << facebook::thrift::ThriftDebugString(srv1) << endl << endl;
|
|
|
|
facebook::thrift::reflection::limited::Service srv2;
|
|
test::stress::ServiceIf::getStaticLimitedReflection(srv2);
|
|
cout << facebook::thrift::ThriftDebugString(srv2) << endl << endl;
|
|
|
|
return 0;
|
|
}
|