GRPC C++  1.6.0
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
generic_stub.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_GENERIC_STUB_H
20 #define GRPCXX_GENERIC_GENERIC_STUB_H
21 
24 
25 namespace grpc {
26 
30 
33 class GenericStub final {
34  public:
35  explicit GenericStub(std::shared_ptr<ChannelInterface> channel)
36  : channel_(channel) {}
37 
43  std::unique_ptr<GenericClientAsyncReaderWriter> Call(
44  ClientContext* context, const grpc::string& method, CompletionQueue* cq,
45  void* tag);
46 
47  private:
48  std::shared_ptr<ChannelInterface> channel_;
49 };
50 
51 } // namespace grpc
52 
53 #endif // GRPCXX_GENERIC_GENERIC_STUB_H
Async client-side interface for bi-directional streaming, where the outgoing message stream going to ...
Definition: async_stream.h:388
std::string string
Definition: config.h:35
A ClientContext allows the person implementing a service client to:
Definition: client_context.h:153
std::unique_ptr< GenericClientAsyncReaderWriter > Call(ClientContext *context, const grpc::string &method, CompletionQueue *cq, void *tag)
Begin a call to a named method method using context.
A thin wrapper around grpc_completion_queue (see src/core/lib/surface/completion_queue.h).
Definition: completion_queue.h:86
ClientAsyncReaderWriter< ByteBuffer, ByteBuffer > GenericClientAsyncReaderWriter
Definition: generic_stub.h:27
Generic stubs provide a type-unsafe interface to call gRPC methods by name.
Definition: generic_stub.h:33
GenericStub(std::shared_ptr< ChannelInterface > channel)
Definition: generic_stub.h:35