[
https://issues.apache.org/jira/browse/THRIFT-1573?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Denis updated THRIFT-1573:
--------------------------
Description:
If the TNonblockingServer is to construct:
TNonblockingServer server(processorFactory, protocolFactory, port,
threadManager);
the compiler generates an error:
error C2664: apache::thrift::server::TServer::TServer(const
apache::thrift::server::TServer &): cannot convert parameter 1 from "const
boost::shared_ptr<T>" to "const apache::thrift::server::TServer &"
e:\develop\cpp\lib\thrift\src\server\tnonblockingserver.h 264
patch:
{noformat}
Index: TServer.h
===================================================================
--- TServer.h (revision 1337971)
+++ TServer.h (working copy)
@@ -142,7 +142,7 @@
protected:
template<typename ProcessorFactory>
- TServer(const boost::shared_ptr<TProcessorFactory>& processorFactory,
+ TServer(const boost::shared_ptr<ProcessorFactory>& processorFactory,
THRIFT_OVERLOAD_IF(ProcessorFactory, TProcessorFactory)):
processorFactory_(processorFactory) {
setInputTransportFactory(boost::shared_ptr<TTransportFactory>(
@@ -166,7 +166,7 @@
}
template<typename ProcessorFactory>
- TServer(const boost::shared_ptr<TProcessorFactory>& processorFactory,
+ TServer(const boost::shared_ptr<ProcessorFactory>& processorFactory,
const boost::shared_ptr<TServerTransport>& serverTransport,
THRIFT_OVERLOAD_IF(ProcessorFactory, TProcessorFactory)):
processorFactory_(processorFactory),
{noformat}
was:
If the TNonblockingServer is to construct:
TNonblockingServer server(processorFactory, protocolFactory, port,
threadManager);
the compiler generates an error:
error C2664: apache::thrift::server::TServer::TServer(const
apache::thrift::server::TServer &): cannot convert parameter 1 from "const
boost::shared_ptr<T>" to "const apache::thrift::server::TServer &"
e:\develop\cpp\lib\thrift\src\server\tnonblockingserver.h 264
because that TServer class does not contain a constructor:
TServer(processorFactory)
as in the template:
template<typename ProcessorFactory>
TNonblockingServer(
const boost::shared_ptr<ProcessorFactory>& processorFactory,
const boost::shared_ptr<TProtocolFactory>& protocolFactory,
int port,
const boost::shared_ptr<ThreadManager>& threadManager =
boost::shared_ptr<ThreadManager>(),
THRIFT_OVERLOAD_IF(ProcessorFactory, TProcessorFactory)) :
TServer(processorFactory) {
init(port);
setInputProtocolFactory(protocolFactory);
setOutputProtocolFactory(protocolFactory);
setThreadManager(threadManager);
}
Patch Info: Patch Available
> Error on TNonblockingServer constructor
> ---------------------------------------
>
> Key: THRIFT-1573
> URL: https://issues.apache.org/jira/browse/THRIFT-1573
> Project: Thrift
> Issue Type: Bug
> Components: C++ - Library
> Affects Versions: 0.8
> Reporter: Denis
> Labels: TNonblockingServer
>
> If the TNonblockingServer is to construct:
> TNonblockingServer server(processorFactory, protocolFactory, port,
> threadManager);
> the compiler generates an error:
> error C2664: apache::thrift::server::TServer::TServer(const
> apache::thrift::server::TServer &): cannot convert parameter 1 from "const
> boost::shared_ptr<T>" to "const apache::thrift::server::TServer &"
> e:\develop\cpp\lib\thrift\src\server\tnonblockingserver.h 264
> patch:
> {noformat}
> Index: TServer.h
> ===================================================================
> --- TServer.h (revision 1337971)
> +++ TServer.h (working copy)
> @@ -142,7 +142,7 @@
>
> protected:
> template<typename ProcessorFactory>
> - TServer(const boost::shared_ptr<TProcessorFactory>& processorFactory,
> + TServer(const boost::shared_ptr<ProcessorFactory>& processorFactory,
> THRIFT_OVERLOAD_IF(ProcessorFactory, TProcessorFactory)):
> processorFactory_(processorFactory) {
> setInputTransportFactory(boost::shared_ptr<TTransportFactory>(
> @@ -166,7 +166,7 @@
> }
>
> template<typename ProcessorFactory>
> - TServer(const boost::shared_ptr<TProcessorFactory>& processorFactory,
> + TServer(const boost::shared_ptr<ProcessorFactory>& processorFactory,
> const boost::shared_ptr<TServerTransport>& serverTransport,
> THRIFT_OVERLOAD_IF(ProcessorFactory, TProcessorFactory)):
> processorFactory_(processorFactory),
> {noformat}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira