Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
Grpc
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
tci-gateway-module
Grpc
Commits
d76ea837
Commit
d76ea837
authored
8 years ago
by
kpayson64
Committed by
GitHub
8 years ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #7798 from y-zeng/ServerReaderWriterInterface
Add ServerReaderWriterInterface
parents
bacaceb5
59e835d4
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
include/grpc++/impl/codegen/sync_stream.h
+30
-7
30 additions, 7 deletions
include/grpc++/impl/codegen/sync_stream.h
with
30 additions
and
7 deletions
include/grpc++/impl/codegen/sync_stream.h
+
30
−
7
View file @
d76ea837
...
@@ -64,6 +64,15 @@ class ClientStreamingInterface {
...
@@ -64,6 +64,15 @@ class ClientStreamingInterface {
virtual
Status
Finish
()
=
0
;
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.
/// An interface that yields a sequence of messages of type \a R.
template
<
class
R
>
template
<
class
R
>
class
ReaderInterface
{
class
ReaderInterface
{
...
@@ -336,12 +345,17 @@ class ClientReaderWriter GRPC_FINAL : public ClientReaderWriterInterface<W, R> {
...
@@ -336,12 +345,17 @@ class ClientReaderWriter GRPC_FINAL : public ClientReaderWriterInterface<W, R> {
Call
call_
;
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
>
template
<
class
R
>
class
ServerReader
GRPC_FINAL
:
public
ReaderInterface
<
R
>
{
class
ServerReader
GRPC_FINAL
:
public
Server
ReaderInterface
<
R
>
{
public:
public:
ServerReader
(
Call
*
call
,
ServerContext
*
ctx
)
:
call_
(
call
),
ctx_
(
ctx
)
{}
ServerReader
(
Call
*
call
,
ServerContext
*
ctx
)
:
call_
(
call
),
ctx_
(
ctx
)
{}
void
SendInitialMetadata
()
{
void
SendInitialMetadata
()
GRPC_OVERRIDE
{
GPR_CODEGEN_ASSERT
(
!
ctx_
->
sent_initial_metadata_
);
GPR_CODEGEN_ASSERT
(
!
ctx_
->
sent_initial_metadata_
);
CallOpSet
<
CallOpSendInitialMetadata
>
ops
;
CallOpSet
<
CallOpSendInitialMetadata
>
ops
;
...
@@ -367,12 +381,17 @@ class ServerReader GRPC_FINAL : public ReaderInterface<R> {
...
@@ -367,12 +381,17 @@ class ServerReader GRPC_FINAL : public ReaderInterface<R> {
ServerContext
*
const
ctx_
;
ServerContext
*
const
ctx_
;
};
};
/// Server-side interface for streaming writes of message of type \a W.
template
<
class
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:
public:
ServerWriter
(
Call
*
call
,
ServerContext
*
ctx
)
:
call_
(
call
),
ctx_
(
ctx
)
{}
ServerWriter
(
Call
*
call
,
ServerContext
*
ctx
)
:
call_
(
call
),
ctx_
(
ctx
)
{}
void
SendInitialMetadata
()
{
void
SendInitialMetadata
()
GRPC_OVERRIDE
{
GPR_CODEGEN_ASSERT
(
!
ctx_
->
sent_initial_metadata_
);
GPR_CODEGEN_ASSERT
(
!
ctx_
->
sent_initial_metadata_
);
CallOpSet
<
CallOpSendInitialMetadata
>
ops
;
CallOpSet
<
CallOpSendInitialMetadata
>
ops
;
...
@@ -411,12 +430,16 @@ class ServerWriter GRPC_FINAL : public WriterInterface<W> {
...
@@ -411,12 +430,16 @@ class ServerWriter GRPC_FINAL : public WriterInterface<W> {
/// Server-side interface for bi-directional streaming.
/// Server-side interface for bi-directional streaming.
template
<
class
W
,
class
R
>
template
<
class
W
,
class
R
>
class
ServerReaderWriter
GRPC_FINAL
:
public
WriterInterface
<
W
>
,
class
ServerReaderWriterInterface
:
public
ServerStreamingInterface
,
public
ReaderInterface
<
R
>
{
public
WriterInterface
<
W
>
,
public
ReaderInterface
<
R
>
{};
template
<
class
W
,
class
R
>
class
ServerReaderWriter
GRPC_FINAL
:
public
ServerReaderWriterInterface
<
W
,
R
>
{
public:
public:
ServerReaderWriter
(
Call
*
call
,
ServerContext
*
ctx
)
:
call_
(
call
),
ctx_
(
ctx
)
{}
ServerReaderWriter
(
Call
*
call
,
ServerContext
*
ctx
)
:
call_
(
call
),
ctx_
(
ctx
)
{}
void
SendInitialMetadata
()
{
void
SendInitialMetadata
()
GRPC_OVERRIDE
{
GPR_CODEGEN_ASSERT
(
!
ctx_
->
sent_initial_metadata_
);
GPR_CODEGEN_ASSERT
(
!
ctx_
->
sent_initial_metadata_
);
CallOpSet
<
CallOpSendInitialMetadata
>
ops
;
CallOpSet
<
CallOpSendInitialMetadata
>
ops
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment