diff options
author | David Garcia Quintas <dgq@google.com> | 2016-08-31 00:25:29 +0200 |
---|---|---|
committer | David Garcia Quintas <dgq@google.com> | 2016-08-31 00:25:29 +0200 |
commit | e3817f4fd1f9c994e47e3e6fac4e8b8cce47c943 (patch) | |
tree | 35a6b17ead54f3fde1647549261fecc70873a897 /include/grpc++ | |
parent | 2f9dd0ed89a3661faf8de6426c7bc3b03d352b62 (diff) | |
parent | 336ce42714decea38bb8e42b6c543ac2ff8af1d6 (diff) |
Merge branch 'master' of github.com:grpc/grpc into codegen_cleanse
Diffstat (limited to 'include/grpc++')
-rw-r--r-- | include/grpc++/create_channel.h | 1 | ||||
-rw-r--r-- | include/grpc++/impl/codegen/client_context.h | 2 | ||||
-rw-r--r-- | include/grpc++/impl/codegen/sync_stream.h | 37 |
3 files changed, 31 insertions, 9 deletions
diff --git a/include/grpc++/create_channel.h b/include/grpc++/create_channel.h index e9ccb51503..0537695ed2 100644 --- a/include/grpc++/create_channel.h +++ b/include/grpc++/create_channel.h @@ -48,7 +48,6 @@ namespace grpc { /// \param target The URI of the endpoint to connect to. /// \param creds Credentials to use for the created channel. If it does not hold /// an object or is invalid, a lame channel is returned. -/// \param args Options for channel creation. std::shared_ptr<Channel> CreateChannel( const grpc::string& target, const std::shared_ptr<ChannelCredentials>& creds); diff --git a/include/grpc++/impl/codegen/client_context.h b/include/grpc++/impl/codegen/client_context.h index 3467ab14c2..247d14d124 100644 --- a/include/grpc++/impl/codegen/client_context.h +++ b/include/grpc++/impl/codegen/client_context.h @@ -269,7 +269,7 @@ class ClientContext { /// Set \a algorithm to be the compression algorithm used for the client call. /// - /// \param algorith The compression algorithm used for the client call. + /// \param algorithm The compression algorithm used for the client call. void set_compression_algorithm(grpc_compression_algorithm algorithm); /// Return the peer uri in a string. diff --git a/include/grpc++/impl/codegen/sync_stream.h b/include/grpc++/impl/codegen/sync_stream.h index e0556237f6..c064ac6f63 100644 --- a/include/grpc++/impl/codegen/sync_stream.h +++ b/include/grpc++/impl/codegen/sync_stream.h @@ -63,6 +63,15 @@ class ClientStreamingInterface { virtual Status Finish() = 0; }; +/// Common interface for all synchronous server side streaming. +class ServerStreamingInterface { + public: + virtual ~ServerStreamingInterface() {} + + /// Blocking send initial metadata to client. + virtual void SendInitialMetadata() = 0; +}; + /// An interface that yields a sequence of messages of type \a R. template <class R> class ReaderInterface { @@ -335,12 +344,17 @@ class ClientReaderWriter GRPC_FINAL : public ClientReaderWriterInterface<W, R> { Call call_; }; +/// Server-side interface for streaming reads of message of type \a R. +template <class R> +class ServerReaderInterface : public ServerStreamingInterface, + public ReaderInterface<R> {}; + template <class R> -class ServerReader GRPC_FINAL : public ReaderInterface<R> { +class ServerReader GRPC_FINAL : public ServerReaderInterface<R> { public: ServerReader(Call* call, ServerContext* ctx) : call_(call), ctx_(ctx) {} - void SendInitialMetadata() { + void SendInitialMetadata() GRPC_OVERRIDE { GPR_CODEGEN_ASSERT(!ctx_->sent_initial_metadata_); CallOpSet<CallOpSendInitialMetadata> ops; @@ -366,12 +380,17 @@ class ServerReader GRPC_FINAL : public ReaderInterface<R> { ServerContext* const ctx_; }; +/// Server-side interface for streaming writes of message of type \a W. template <class W> -class ServerWriter GRPC_FINAL : public WriterInterface<W> { +class ServerWriterInterface : public ServerStreamingInterface, + public WriterInterface<W> {}; + +template <class W> +class ServerWriter GRPC_FINAL : public ServerWriterInterface<W> { public: ServerWriter(Call* call, ServerContext* ctx) : call_(call), ctx_(ctx) {} - void SendInitialMetadata() { + void SendInitialMetadata() GRPC_OVERRIDE { GPR_CODEGEN_ASSERT(!ctx_->sent_initial_metadata_); CallOpSet<CallOpSendInitialMetadata> ops; @@ -410,12 +429,16 @@ class ServerWriter GRPC_FINAL : public WriterInterface<W> { /// Server-side interface for bi-directional streaming. template <class W, class R> -class ServerReaderWriter GRPC_FINAL : public WriterInterface<W>, - public ReaderInterface<R> { +class ServerReaderWriterInterface : public ServerStreamingInterface, + public WriterInterface<W>, + public ReaderInterface<R> {}; + +template <class W, class R> +class ServerReaderWriter GRPC_FINAL : public ServerReaderWriterInterface<W, R> { public: ServerReaderWriter(Call* call, ServerContext* ctx) : call_(call), ctx_(ctx) {} - void SendInitialMetadata() { + void SendInitialMetadata() GRPC_OVERRIDE { GPR_CODEGEN_ASSERT(!ctx_->sent_initial_metadata_); CallOpSet<CallOpSendInitialMetadata> ops; |