GRPC C++  1.8.0
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
async_generic_service.h
Go to the documentation of this file.
1 /*
2  *
3  * Copyright 2015 gRPC authors.
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  */
18 
19 #ifndef GRPCXX_GENERIC_ASYNC_GENERIC_SERVICE_H
20 #define GRPCXX_GENERIC_ASYNC_GENERIC_SERVICE_H
21 
24 
25 struct grpc_server;
26 
27 namespace grpc {
28 
29 typedef ServerAsyncReaderWriter<ByteBuffer, ByteBuffer>
31 
32 class GenericServerContext final : public ServerContext {
33  public:
34  const grpc::string& method() const { return method_; }
35  const grpc::string& host() const { return host_; }
36 
37  private:
38  friend class Server;
39  friend class ServerInterface;
40 
41  grpc::string method_;
42  grpc::string host_;
43 };
44 
45 class AsyncGenericService final {
46  public:
47  AsyncGenericService() : server_(nullptr) {}
48 
50  GenericServerAsyncReaderWriter* reader_writer,
51  CompletionQueue* call_cq,
52  ServerCompletionQueue* notification_cq, void* tag);
53 
54  private:
55  friend class Server;
56  Server* server_;
57 };
58 
59 } // namespace grpc
60 
61 #endif // GRPCXX_GENERIC_ASYNC_GENERIC_SERVICE_H
AsyncGenericService()
Definition: async_generic_service.h:47
std::string string
Definition: config.h:35
Async server-side API for doing bidirectional streaming RPCs, where the incoming message stream comin...
Definition: async_stream.h:951
struct grpc_server grpc_server
A server listens to some port and responds to request calls.
Definition: grpc_types.h:66
Definition: async_generic_service.h:45
void RequestCall(GenericServerContext *ctx, GenericServerAsyncReaderWriter *reader_writer, CompletionQueue *call_cq, ServerCompletionQueue *notification_cq, void *tag)
Represents a gRPC server.
Definition: server.h:52
ServerAsyncReaderWriter< ByteBuffer, ByteBuffer > GenericServerAsyncReaderWriter
Definition: async_generic_service.h:30
A ServerContext allows the person implementing a service handler to:
Definition: server_context.h:96
Definition: server_interface.h:47
Definition: async_generic_service.h:32
A thin wrapper around grpc_completion_queue (see src/core/lib/surface/completion_queue.h).
Definition: completion_queue.h:94
A specific type of completion queue used by the processing of notifications by servers.
Definition: completion_queue.h:321
const grpc::string & host() const
Definition: async_generic_service.h:35
const grpc::string & method() const
Definition: async_generic_service.h:34