Skip to content

Commit 379bdfa

Browse files
iceberggerchenshuo
authored andcommitted
Update ThriftServer.h
"THRIFT_OVERLOAD_IF has not been declared " compile error with 0.11.0 thrift, remove old style, tested with thrift 0.11.0
1 parent 174a394 commit 379bdfa

File tree

1 file changed

+16
-32
lines changed

1 file changed

+16
-32
lines changed

contrib/thrift/ThriftServer.h

Lines changed: 16 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,10 @@ class ThriftServer : boost::noncopyable,
2323
public TServer
2424
{
2525
public:
26-
template <typename ProcessorFactory>
27-
ThriftServer(const boost::shared_ptr<ProcessorFactory>& processorFactory,
26+
ThriftServer(const boost::shared_ptr<TProcessorFactory>& processorFactory,
2827
muduo::net::EventLoop* eventloop,
2928
const muduo::net::InetAddress& addr,
30-
const muduo::string& name,
31-
THRIFT_OVERLOAD_IF(ProcessorFactory, TProcessorFactory))
29+
const muduo::string& name)
3230
: TServer(processorFactory),
3331
server_(eventloop, addr, name),
3432
numWorkerThreads_(0),
@@ -38,12 +36,10 @@ class ThriftServer : boost::noncopyable,
3836
this, muduo::_1));
3937
}
4038

41-
template <typename Processor>
42-
ThriftServer(const boost::shared_ptr<Processor>& processor,
39+
ThriftServer(const boost::shared_ptr<TProcessor>& processor,
4340
muduo::net::EventLoop* eventloop,
4441
const muduo::net::InetAddress& addr,
45-
const muduo::string& name,
46-
THRIFT_OVERLOAD_IF(Processor, TProcessor))
42+
const muduo::string& name)
4743
: TServer(processor),
4844
server_(eventloop, addr, name),
4945
numWorkerThreads_(0),
@@ -53,13 +49,11 @@ class ThriftServer : boost::noncopyable,
5349
this, muduo::_1));
5450
}
5551

56-
template <typename ProcessorFactory>
57-
ThriftServer(const boost::shared_ptr<ProcessorFactory>& processorFactory,
52+
ThriftServer(const boost::shared_ptr<TProcessorFactory>& processorFactory,
5853
const boost::shared_ptr<TProtocolFactory>& protocolFactory,
5954
muduo::net::EventLoop* eventloop,
6055
const muduo::net::InetAddress& addr,
61-
const muduo::string& name,
62-
THRIFT_OVERLOAD_IF(ProcessorFactory, TProcessorFactory))
56+
const muduo::string& name)
6357
: TServer(processorFactory),
6458
server_(eventloop, addr, name),
6559
numWorkerThreads_(0),
@@ -71,13 +65,11 @@ class ThriftServer : boost::noncopyable,
7165
setOutputProtocolFactory(protocolFactory);
7266
}
7367

74-
template <typename Processor>
75-
ThriftServer(const boost::shared_ptr<Processor>& processor,
68+
ThriftServer(const boost::shared_ptr<TProcessor>& processor,
7669
const boost::shared_ptr<TProtocolFactory>& protocolFactory,
7770
muduo::net::EventLoop* eventloop,
7871
const muduo::net::InetAddress& addr,
79-
const muduo::string& name,
80-
THRIFT_OVERLOAD_IF(Processor, TProcessor))
72+
const muduo::string& name)
8173
: TServer(processor),
8274
server_(eventloop, addr, name),
8375
numWorkerThreads_(0),
@@ -89,14 +81,12 @@ class ThriftServer : boost::noncopyable,
8981
setOutputProtocolFactory(protocolFactory);
9082
}
9183

92-
template <typename ProcessorFactory>
93-
ThriftServer(const boost::shared_ptr<ProcessorFactory>& processorFactory,
84+
ThriftServer(const boost::shared_ptr<TProcessorFactory>& processorFactory,
9485
const boost::shared_ptr<TTransportFactory>& transportFactory,
9586
const boost::shared_ptr<TProtocolFactory>& protocolFactory,
9687
muduo::net::EventLoop* eventloop,
9788
const muduo::net::InetAddress& addr,
98-
const muduo::string& name,
99-
THRIFT_OVERLOAD_IF(ProcessorFactory, TProcessorFactory))
89+
const muduo::string& name)
10090
: TServer(processorFactory),
10191
server_(eventloop, addr, name),
10292
numWorkerThreads_(0),
@@ -110,14 +100,12 @@ class ThriftServer : boost::noncopyable,
110100
setOutputProtocolFactory(protocolFactory);
111101
}
112102

113-
template <typename Processor>
114-
ThriftServer(const boost::shared_ptr<Processor>& processor,
103+
ThriftServer(const boost::shared_ptr<TProcessor>& processor,
115104
const boost::shared_ptr<TTransportFactory>& transportFactory,
116105
const boost::shared_ptr<TProtocolFactory>& protocolFactory,
117106
muduo::net::EventLoop* eventloop,
118107
const muduo::net::InetAddress& addr,
119-
const muduo::string& name,
120-
THRIFT_OVERLOAD_IF(Processor, TProcessor))
108+
const muduo::string& name)
121109
: TServer(processor),
122110
server_(eventloop, addr, name),
123111
numWorkerThreads_(0),
@@ -131,16 +119,14 @@ class ThriftServer : boost::noncopyable,
131119
setOutputProtocolFactory(protocolFactory);
132120
}
133121

134-
template <typename ProcessorFactory>
135-
ThriftServer(const boost::shared_ptr<ProcessorFactory>& processorFactory,
122+
ThriftServer(const boost::shared_ptr<TProcessorFactory>& processorFactory,
136123
const boost::shared_ptr<TTransportFactory>& inputTransportFactory,
137124
const boost::shared_ptr<TTransportFactory>& outputTransportFactory,
138125
const boost::shared_ptr<TProtocolFactory>& inputProtocolFactory,
139126
const boost::shared_ptr<TProtocolFactory>& outputProtocolFactory,
140127
muduo::net::EventLoop* eventloop,
141128
const muduo::net::InetAddress& addr,
142-
const muduo::string& name,
143-
THRIFT_OVERLOAD_IF(ProcessorFactory, TProcessorFactory))
129+
const muduo::string& name)
144130
: TServer(processorFactory),
145131
server_(eventloop, addr, name),
146132
numWorkerThreads_(0),
@@ -154,16 +140,14 @@ class ThriftServer : boost::noncopyable,
154140
setOutputProtocolFactory(outputProtocolFactory);
155141
}
156142

157-
template <typename Processor>
158-
ThriftServer(const boost::shared_ptr<Processor>& processor,
143+
ThriftServer(const boost::shared_ptr<TProcessor>& processor,
159144
const boost::shared_ptr<TTransportFactory>& inputTransportFactory,
160145
const boost::shared_ptr<TTransportFactory>& outputTransportFactory,
161146
const boost::shared_ptr<TProtocolFactory>& inputProtocolFactory,
162147
const boost::shared_ptr<TProtocolFactory>& outputProtocolFactory,
163148
muduo::net::EventLoop* eventloop,
164149
const muduo::net::InetAddress& addr,
165-
const muduo::string& name,
166-
THRIFT_OVERLOAD_IF(Processor, TProcessor))
150+
const muduo::string& name)
167151
: TServer(processor),
168152
server_(eventloop, addr, name),
169153
numWorkerThreads_(0),

0 commit comments

Comments
 (0)