MCPcopy Create free account
hub / github.com/baidu/braft / CounterServiceImpl

Class CounterServiceImpl

example/counter/server.cpp:329–347  ·  view source on GitHub ↗

Implements example::CounterService if you are using brpc.

Source from the content-addressed store, hash-verified

327
328// Implements example::CounterService if you are using brpc.
329class CounterServiceImpl : public CounterService {
330public:
331 explicit CounterServiceImpl(Counter* counter) : _counter(counter) {}
332 void fetch_add(::google::protobuf::RpcController* controller,
333 const ::example::FetchAddRequest* request,
334 ::example::CounterResponse* response,
335 ::google::protobuf::Closure* done) {
336 return _counter->fetch_add(request, response, done);
337 }
338 void get(::google::protobuf::RpcController* controller,
339 const ::example::GetRequest* request,
340 ::example::CounterResponse* response,
341 ::google::protobuf::Closure* done) {
342 brpc::ClosureGuard done_guard(done);
343 return _counter->get(response);
344 }
345private:
346 Counter* _counter;
347};
348
349} // namespace example
350

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected