clang-format

pull/4775/head
David Garcia Quintas 9 years ago
parent a396276cde
commit f3ddb7c55a
  1. 3
      include/grpc++/channel.h
  2. 3
      include/grpc++/client_context.h
  3. 3
      include/grpc++/completion_queue.h
  4. 3
      include/grpc++/generic/generic_stub.h
  5. 11
      include/grpc++/impl/codegen/channel_interface.h
  6. 3
      include/grpc++/impl/codegen/server_interface.h
  7. 9
      include/grpc++/server.h
  8. 6
      src/cpp/server/server.cc
  9. 6
      test/cpp/end2end/hybrid_end2end_test.cc

@ -59,7 +59,8 @@ class Channel GRPC_FINAL : public ChannelInterface,
private:
template <class InputMessage, class OutputMessage>
friend Status BlockingUnaryCall(ChannelInterface* channel, const RpcMethod& method,
friend Status BlockingUnaryCall(ChannelInterface* channel,
const RpcMethod& method,
ClientContext* context,
const InputMessage& request,
OutputMessage* result);

@ -316,7 +316,8 @@ class ClientContext {
template <class R>
friend class ::grpc::ClientAsyncResponseReader;
template <class InputMessage, class OutputMessage>
friend Status BlockingUnaryCall(ChannelInterface* channel, const RpcMethod& method,
friend Status BlockingUnaryCall(ChannelInterface* channel,
const RpcMethod& method,
ClientContext* context,
const InputMessage& request,
OutputMessage* result);

@ -172,7 +172,8 @@ class CompletionQueue : public GrpcLibrary {
friend class ::grpc::Server;
friend class ::grpc::ServerContext;
template <class InputMessage, class OutputMessage>
friend Status BlockingUnaryCall(ChannelInterface* channel, const RpcMethod& method,
friend Status BlockingUnaryCall(ChannelInterface* channel,
const RpcMethod& method,
ClientContext* context,
const InputMessage& request,
OutputMessage* result);

@ -47,7 +47,8 @@ typedef ClientAsyncReaderWriter<ByteBuffer, ByteBuffer>
// by name.
class GenericStub GRPC_FINAL {
public:
explicit GenericStub(std::shared_ptr<ChannelInterface> channel) : channel_(channel) {}
explicit GenericStub(std::shared_ptr<ChannelInterface> channel)
: channel_(channel) {}
// begin a call to a named method
std::unique_ptr<GenericClientAsyncReaderWriter> Call(

@ -101,20 +101,21 @@ class ChannelInterface {
template <class R>
friend class ::grpc::ClientAsyncResponseReader;
template <class InputMessage, class OutputMessage>
friend Status BlockingUnaryCall(ChannelInterface* channel, const RpcMethod& method,
friend Status BlockingUnaryCall(ChannelInterface* channel,
const RpcMethod& method,
ClientContext* context,
const InputMessage& request,
OutputMessage* result);
friend class ::grpc::RpcMethod;
virtual Call CreateCall(const RpcMethod& method, ClientContext* context,
CompletionQueue* cq) = 0;
CompletionQueue* cq) = 0;
virtual void PerformOpsOnCall(CallOpSetInterface* ops, Call* call) = 0;
virtual void* RegisterMethod(const char* method) = 0;
virtual void NotifyOnStateChangeImpl(grpc_connectivity_state last_observed,
gpr_timespec deadline, CompletionQueue* cq,
void* tag) = 0;
gpr_timespec deadline,
CompletionQueue* cq, void* tag) = 0;
virtual bool WaitForStateChangeImpl(grpc_connectivity_state last_observed,
gpr_timespec deadline) = 0;
gpr_timespec deadline) = 0;
};
} // namespace grpc

@ -100,7 +100,8 @@ class ServerInterface : public CallHook {
/// \return bound port number on sucess, 0 on failure.
///
/// \warning It's an error to call this method on an already started server.
virtual int AddListeningPort(const grpc::string& addr, ServerCredentials* creds) = 0;
virtual int AddListeningPort(const grpc::string& addr,
ServerCredentials* creds) = 0;
/// Start the server.
///

@ -62,8 +62,7 @@ class ThreadPoolInterface;
/// Models a gRPC server.
///
/// Servers are configured and started via \a grpc::ServerBuilder.
class Server GRPC_FINAL : public ServerInterface,
public GrpcLibrary {
class Server GRPC_FINAL : public ServerInterface, public GrpcLibrary {
public:
~Server();
@ -113,7 +112,8 @@ class Server GRPC_FINAL : public ServerInterface,
/// Register a service. This call does not take ownership of the service.
/// The service must exist for the lifetime of the Server instance.
bool RegisterService(const grpc::string* host, Service* service) GRPC_OVERRIDE;
bool RegisterService(const grpc::string* host,
Service* service) GRPC_OVERRIDE;
/// Register a generic service. This call does not take ownership of the
/// service. The service must exist for the lifetime of the Server instance.
@ -130,7 +130,8 @@ class Server GRPC_FINAL : public ServerInterface,
/// \return bound port number on sucess, 0 on failure.
///
/// \warning It's an error to call this method on an already started server.
int AddListeningPort(const grpc::string& addr, ServerCredentials* creds) GRPC_OVERRIDE;
int AddListeningPort(const grpc::string& addr,
ServerCredentials* creds) GRPC_OVERRIDE;
/// Start the server.
///

@ -451,7 +451,8 @@ ServerInterface::BaseAsyncRequest::BaseAsyncRequest(
memset(&initial_metadata_array_, 0, sizeof(initial_metadata_array_));
}
bool ServerInterface::BaseAsyncRequest::FinalizeResult(void** tag, bool* status) {
bool ServerInterface::BaseAsyncRequest::FinalizeResult(void** tag,
bool* status) {
if (*status) {
for (size_t i = 0; i < initial_metadata_array_.count; i++) {
context_->client_metadata_.insert(
@ -506,7 +507,8 @@ ServerInterface::GenericAsyncRequest::GenericAsyncRequest(
notification_cq->cq(), this);
}
bool ServerInterface::GenericAsyncRequest::FinalizeResult(void** tag, bool* status) {
bool ServerInterface::GenericAsyncRequest::FinalizeResult(void** tag,
bool* status) {
// TODO(yangg) remove the copy here.
if (*status) {
static_cast<GenericServerContext*>(context_)->method_ =

@ -453,8 +453,7 @@ TEST_F(HybridEnd2endTest, GenericEchoAsyncRequestStream) {
// Add a second service with one sync method.
TEST_F(HybridEnd2endTest, GenericEchoAsyncRequestStream_SyncDupService) {
EchoTestService::WithAsyncMethod_RequestStream<
EchoTestService::WithGenericMethod_Echo<TestServiceImpl> >
service;
EchoTestService::WithGenericMethod_Echo<TestServiceImpl> > service;
AsyncGenericService generic_service;
TestServiceImplDupPkg dup_service;
SetUpServer(&service, &dup_service, &generic_service);
@ -473,8 +472,7 @@ TEST_F(HybridEnd2endTest, GenericEchoAsyncRequestStream_SyncDupService) {
// Add a second service with one async method.
TEST_F(HybridEnd2endTest, GenericEchoAsyncRequestStream_AsyncDupService) {
EchoTestService::WithAsyncMethod_RequestStream<
EchoTestService::WithGenericMethod_Echo<TestServiceImpl> >
service;
EchoTestService::WithGenericMethod_Echo<TestServiceImpl> > service;
AsyncGenericService generic_service;
duplicate::EchoTestService::AsyncService dup_service;
SetUpServer(&service, &dup_service, &generic_service);

Loading…
Cancel
Save