Upgrading dependency to Thrift 0.12.0
This commit is contained in:
parent
3e4590dcc0
commit
356978cb42
1302 changed files with 101701 additions and 26784 deletions
8
vendor/git.apache.org/thrift.git/tutorial/cpp/CMakeLists.txt
generated
vendored
8
vendor/git.apache.org/thrift.git/tutorial/cpp/CMakeLists.txt
generated
vendored
|
@ -44,9 +44,13 @@ add_custom_command(OUTPUT gen-cpp/Calculator.cpp gen-cpp/SharedService.cpp gen-c
|
|||
add_executable(TutorialServer CppServer.cpp)
|
||||
target_link_libraries(TutorialServer tutorialgencpp)
|
||||
LINK_AGAINST_THRIFT_LIBRARY(TutorialServer thrift)
|
||||
target_link_libraries(TutorialServer ${ZLIB_LIBRARIES})
|
||||
if (ZLIB_FOUND)
|
||||
target_link_libraries(TutorialServer ${ZLIB_LIBRARIES})
|
||||
endif ()
|
||||
|
||||
add_executable(TutorialClient CppClient.cpp)
|
||||
target_link_libraries(TutorialClient tutorialgencpp)
|
||||
LINK_AGAINST_THRIFT_LIBRARY(TutorialClient thrift)
|
||||
target_link_libraries(TutorialClient ${ZLIB_LIBRARIES})
|
||||
if (ZLIB_FOUND)
|
||||
target_link_libraries(TutorialClient ${ZLIB_LIBRARIES})
|
||||
endif ()
|
||||
|
|
7
vendor/git.apache.org/thrift.git/tutorial/cpp/CppClient.cpp
generated
vendored
7
vendor/git.apache.org/thrift.git/tutorial/cpp/CppClient.cpp
generated
vendored
|
@ -22,6 +22,7 @@
|
|||
#include <thrift/protocol/TBinaryProtocol.h>
|
||||
#include <thrift/transport/TSocket.h>
|
||||
#include <thrift/transport/TTransportUtils.h>
|
||||
#include <thrift/stdcxx.h>
|
||||
|
||||
#include "../gen-cpp/Calculator.h"
|
||||
|
||||
|
@ -34,9 +35,9 @@ using namespace tutorial;
|
|||
using namespace shared;
|
||||
|
||||
int main() {
|
||||
boost::shared_ptr<TTransport> socket(new TSocket("localhost", 9090));
|
||||
boost::shared_ptr<TTransport> transport(new TBufferedTransport(socket));
|
||||
boost::shared_ptr<TProtocol> protocol(new TBinaryProtocol(transport));
|
||||
stdcxx::shared_ptr<TTransport> socket(new TSocket("localhost", 9090));
|
||||
stdcxx::shared_ptr<TTransport> transport(new TBufferedTransport(socket));
|
||||
stdcxx::shared_ptr<TProtocol> protocol(new TBinaryProtocol(transport));
|
||||
CalculatorClient client(protocol);
|
||||
|
||||
try {
|
||||
|
|
41
vendor/git.apache.org/thrift.git/tutorial/cpp/CppServer.cpp
generated
vendored
41
vendor/git.apache.org/thrift.git/tutorial/cpp/CppServer.cpp
generated
vendored
|
@ -27,8 +27,7 @@
|
|||
#include <thrift/transport/TSocket.h>
|
||||
#include <thrift/transport/TTransportUtils.h>
|
||||
#include <thrift/TToString.h>
|
||||
|
||||
#include <boost/make_shared.hpp>
|
||||
#include <thrift/stdcxx.h>
|
||||
|
||||
#include <iostream>
|
||||
#include <stdexcept>
|
||||
|
@ -118,7 +117,7 @@ class CalculatorCloneFactory : virtual public CalculatorIfFactory {
|
|||
virtual ~CalculatorCloneFactory() {}
|
||||
virtual CalculatorIf* getHandler(const ::apache::thrift::TConnectionInfo& connInfo)
|
||||
{
|
||||
boost::shared_ptr<TSocket> sock = boost::dynamic_pointer_cast<TSocket>(connInfo.transport);
|
||||
stdcxx::shared_ptr<TSocket> sock = stdcxx::dynamic_pointer_cast<TSocket>(connInfo.transport);
|
||||
cout << "Incoming connection\n";
|
||||
cout << "\tSocketInfo: " << sock->getSocketInfo() << "\n";
|
||||
cout << "\tPeerHost: " << sock->getPeerHost() << "\n";
|
||||
|
@ -133,18 +132,18 @@ class CalculatorCloneFactory : virtual public CalculatorIfFactory {
|
|||
|
||||
int main() {
|
||||
TThreadedServer server(
|
||||
boost::make_shared<CalculatorProcessorFactory>(boost::make_shared<CalculatorCloneFactory>()),
|
||||
boost::make_shared<TServerSocket>(9090), //port
|
||||
boost::make_shared<TBufferedTransportFactory>(),
|
||||
boost::make_shared<TBinaryProtocolFactory>());
|
||||
stdcxx::make_shared<CalculatorProcessorFactory>(stdcxx::make_shared<CalculatorCloneFactory>()),
|
||||
stdcxx::make_shared<TServerSocket>(9090), //port
|
||||
stdcxx::make_shared<TBufferedTransportFactory>(),
|
||||
stdcxx::make_shared<TBinaryProtocolFactory>());
|
||||
|
||||
/*
|
||||
// if you don't need per-connection state, do the following instead
|
||||
TThreadedServer server(
|
||||
boost::make_shared<CalculatorProcessor>(boost::make_shared<CalculatorHandler>()),
|
||||
boost::make_shared<TServerSocket>(9090), //port
|
||||
boost::make_shared<TBufferedTransportFactory>(),
|
||||
boost::make_shared<TBinaryProtocolFactory>());
|
||||
stdcxx::make_shared<CalculatorProcessor>(stdcxx::make_shared<CalculatorHandler>()),
|
||||
stdcxx::make_shared<TServerSocket>(9090), //port
|
||||
stdcxx::make_shared<TBufferedTransportFactory>(),
|
||||
stdcxx::make_shared<TBinaryProtocolFactory>());
|
||||
*/
|
||||
|
||||
/**
|
||||
|
@ -152,25 +151,25 @@ int main() {
|
|||
|
||||
// This server only allows one connection at a time, but spawns no threads
|
||||
TSimpleServer server(
|
||||
boost::make_shared<CalculatorProcessor>(boost::make_shared<CalculatorHandler>()),
|
||||
boost::make_shared<TServerSocket>(9090),
|
||||
boost::make_shared<TBufferedTransportFactory>(),
|
||||
boost::make_shared<TBinaryProtocolFactory>());
|
||||
stdcxx::make_shared<CalculatorProcessor>(stdcxx::make_shared<CalculatorHandler>()),
|
||||
stdcxx::make_shared<TServerSocket>(9090),
|
||||
stdcxx::make_shared<TBufferedTransportFactory>(),
|
||||
stdcxx::make_shared<TBinaryProtocolFactory>());
|
||||
|
||||
const int workerCount = 4;
|
||||
|
||||
boost::shared_ptr<ThreadManager> threadManager =
|
||||
stdcxx::shared_ptr<ThreadManager> threadManager =
|
||||
ThreadManager::newSimpleThreadManager(workerCount);
|
||||
threadManager->threadFactory(
|
||||
boost::make_shared<PlatformThreadFactory>());
|
||||
stdcxx::make_shared<PlatformThreadFactory>());
|
||||
threadManager->start();
|
||||
|
||||
// This server allows "workerCount" connection at a time, and reuses threads
|
||||
TThreadPoolServer server(
|
||||
boost::make_shared<CalculatorProcessorFactory>(boost::make_shared<CalculatorCloneFactory>()),
|
||||
boost::make_shared<TServerSocket>(9090),
|
||||
boost::make_shared<TBufferedTransportFactory>(),
|
||||
boost::make_shared<TBinaryProtocolFactory>(),
|
||||
stdcxx::make_shared<CalculatorProcessorFactory>(stdcxx::make_shared<CalculatorCloneFactory>()),
|
||||
stdcxx::make_shared<TServerSocket>(9090),
|
||||
stdcxx::make_shared<TBufferedTransportFactory>(),
|
||||
stdcxx::make_shared<TBinaryProtocolFactory>(),
|
||||
threadManager);
|
||||
*/
|
||||
|
||||
|
|
2
vendor/git.apache.org/thrift.git/tutorial/cpp/Makefile.am
generated
vendored
2
vendor/git.apache.org/thrift.git/tutorial/cpp/Makefile.am
generated
vendored
|
@ -61,8 +61,6 @@ TutorialClient_LDADD = \
|
|||
#
|
||||
# Common thrift code generation rules
|
||||
#
|
||||
THRIFT = $(top_builddir)/compiler/cpp/thrift
|
||||
|
||||
gen-cpp/Calculator.cpp gen-cpp/SharedService.cpp gen-cpp/shared_constants.cpp gen-cpp/shared_types.cpp gen-cpp/tutorial_constants.cpp gen-cpp/tutorial_types.cpp: $(top_srcdir)/tutorial/tutorial.thrift
|
||||
$(THRIFT) --gen cpp -r $<
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue