Skip to content

Commit

Permalink
Auto-changes
Browse files Browse the repository at this point in the history
  • Loading branch information
ctiller committed Mar 25, 2016
1 parent b7b20fe commit f40df23
Show file tree
Hide file tree
Showing 272 changed files with 1,008 additions and 1,052 deletions.
2 changes: 1 addition & 1 deletion include/grpc++/generic/async_generic_service.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
#ifndef GRPCXX_GENERIC_ASYNC_GENERIC_SERVICE_H
#define GRPCXX_GENERIC_ASYNC_GENERIC_SERVICE_H

#include <grpc++/support/byte_buffer.h>
#include <grpc++/support/async_stream.h>
#include <grpc++/support/byte_buffer.h>

struct grpc_server;

Expand Down
6 changes: 4 additions & 2 deletions include/grpc++/impl/codegen/async_stream.h
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,8 @@ class ClientAsyncWriter GRPC_FINAL : public ClientAsyncWriterInterface<W> {
CallOpSet<CallOpSendMessage> write_ops_;
CallOpSet<CallOpClientSendClose> writes_done_ops_;
CallOpSet<CallOpRecvInitialMetadata, CallOpGenericRecvMessage,
CallOpClientRecvStatus> finish_ops_;
CallOpClientRecvStatus>
finish_ops_;
};

/// Client-side interface for asynchronous bi-directional streaming.
Expand Down Expand Up @@ -350,7 +351,8 @@ class ServerAsyncReader GRPC_FINAL : public ServerAsyncStreamingInterface,
CallOpSet<CallOpSendInitialMetadata> meta_ops_;
CallOpSet<CallOpRecvMessage<R>> read_ops_;
CallOpSet<CallOpSendInitialMetadata, CallOpSendMessage,
CallOpServerSendStatus> finish_ops_;
CallOpServerSendStatus>
finish_ops_;
};

template <class W>
Expand Down
9 changes: 6 additions & 3 deletions include/grpc++/impl/codegen/async_unary_call.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,12 @@ class ClientAsyncResponseReader GRPC_FINAL
class CallOpSetCollection : public CallOpSetCollectionInterface {
public:
SneakyCallOpSet<CallOpSendInitialMetadata, CallOpSendMessage,
CallOpClientSendClose> init_buf_;
CallOpClientSendClose>
init_buf_;
CallOpSet<CallOpRecvInitialMetadata> meta_buf_;
CallOpSet<CallOpRecvInitialMetadata, CallOpRecvMessage<R>,
CallOpClientRecvStatus> finish_buf_;
CallOpClientRecvStatus>
finish_buf_;
};
std::shared_ptr<CallOpSetCollection> collection_;
};
Expand Down Expand Up @@ -159,7 +161,8 @@ class ServerAsyncResponseWriter GRPC_FINAL
ServerContext* ctx_;
CallOpSet<CallOpSendInitialMetadata> meta_buf_;
CallOpSet<CallOpSendInitialMetadata, CallOpSendMessage,
CallOpServerSendStatus> finish_buf_;
CallOpServerSendStatus>
finish_buf_;
};

} // namespace grpc
Expand Down
3 changes: 2 additions & 1 deletion include/grpc++/impl/codegen/call.h
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,8 @@ class CallOpRecvMessage {
if (*status) {
got_message = true;
*status = SerializationTraits<R>::Deserialize(recv_buf_, message_,
max_message_size).ok();
max_message_size)
.ok();
} else {
got_message = false;
g_core_codegen_interface->grpc_byte_buffer_destroy(recv_buf_);
Expand Down
3 changes: 2 additions & 1 deletion include/grpc++/impl/codegen/client_unary_call.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ Status BlockingUnaryCall(ChannelInterface* channel, const RpcMethod& method,
Call call(channel->CreateCall(method, context, &cq));
CallOpSet<CallOpSendInitialMetadata, CallOpSendMessage,
CallOpRecvInitialMetadata, CallOpRecvMessage<OutputMessage>,
CallOpClientSendClose, CallOpClientRecvStatus> ops;
CallOpClientSendClose, CallOpClientRecvStatus>
ops;
Status status = ops.SendMessage(request);
if (!status.ok()) {
return status;
Expand Down
6 changes: 4 additions & 2 deletions include/grpc++/impl/codegen/impl/async_stream.h
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,8 @@ class ClientAsyncWriter GRPC_FINAL : public ClientAsyncWriterInterface<W> {
CallOpSet<CallOpSendMessage> write_ops_;
CallOpSet<CallOpClientSendClose> writes_done_ops_;
CallOpSet<CallOpRecvInitialMetadata, CallOpGenericRecvMessage,
CallOpClientRecvStatus> finish_ops_;
CallOpClientRecvStatus>
finish_ops_;
};

/// Client-side interface for asynchronous bi-directional streaming.
Expand Down Expand Up @@ -350,7 +351,8 @@ class ServerAsyncReader GRPC_FINAL : public ServerAsyncStreamingInterface,
CallOpSet<CallOpSendInitialMetadata> meta_ops_;
CallOpSet<CallOpRecvMessage<R>> read_ops_;
CallOpSet<CallOpSendInitialMetadata, CallOpSendMessage,
CallOpServerSendStatus> finish_ops_;
CallOpServerSendStatus>
finish_ops_;
};

template <class W>
Expand Down
18 changes: 12 additions & 6 deletions include/grpc++/impl/codegen/method_handler_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ class RpcMethodHandler : public MethodHandler {

GPR_CODEGEN_ASSERT(!param.server_context->sent_initial_metadata_);
CallOpSet<CallOpSendInitialMetadata, CallOpSendMessage,
CallOpServerSendStatus> ops;
CallOpServerSendStatus>
ops;
ops.SendInitialMetadata(param.server_context->initial_metadata_);
if (status.ok()) {
status = ops.SendMessage(rsp);
Expand All @@ -74,7 +75,8 @@ class RpcMethodHandler : public MethodHandler {
private:
// Application provided rpc handler function.
std::function<Status(ServiceType*, ServerContext*, const RequestType*,
ResponseType*)> func_;
ResponseType*)>
func_;
// The class the above handler function lives in.
ServiceType* service_;
};
Expand All @@ -96,7 +98,8 @@ class ClientStreamingHandler : public MethodHandler {

GPR_CODEGEN_ASSERT(!param.server_context->sent_initial_metadata_);
CallOpSet<CallOpSendInitialMetadata, CallOpSendMessage,
CallOpServerSendStatus> ops;
CallOpServerSendStatus>
ops;
ops.SendInitialMetadata(param.server_context->initial_metadata_);
if (status.ok()) {
status = ops.SendMessage(rsp);
Expand All @@ -108,7 +111,8 @@ class ClientStreamingHandler : public MethodHandler {

private:
std::function<Status(ServiceType*, ServerContext*, ServerReader<RequestType>*,
ResponseType*)> func_;
ResponseType*)>
func_;
ServiceType* service_;
};

Expand Down Expand Up @@ -143,7 +147,8 @@ class ServerStreamingHandler : public MethodHandler {

private:
std::function<Status(ServiceType*, ServerContext*, const RequestType*,
ServerWriter<ResponseType>*)> func_;
ServerWriter<ResponseType>*)>
func_;
ServiceType* service_;
};

Expand Down Expand Up @@ -174,7 +179,8 @@ class BidiStreamingHandler : public MethodHandler {

private:
std::function<Status(ServiceType*, ServerContext*,
ServerReaderWriter<ResponseType, RequestType>*)> func_;
ServerReaderWriter<ResponseType, RequestType>*)>
func_;
ServiceType* service_;
};

Expand Down
2 changes: 1 addition & 1 deletion include/grpc++/impl/codegen/rpc_service_method.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@
#include <memory>
#include <vector>

#include <grpc/impl/codegen/byte_buffer.h>
#include <grpc++/impl/codegen/config.h>
#include <grpc++/impl/codegen/rpc_method.h>
#include <grpc++/impl/codegen/status.h>
#include <grpc/impl/codegen/byte_buffer.h>

namespace grpc {
class ServerContext;
Expand Down
6 changes: 3 additions & 3 deletions include/grpc++/impl/codegen/server_context.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@
#include <map>
#include <memory>

#include <grpc/impl/codegen/compression_types.h>
#include <grpc/impl/codegen/time.h>
#include <grpc++/impl/codegen/security/auth_context.h>
#include <grpc++/impl/codegen/config.h>
#include <grpc++/impl/codegen/security/auth_context.h>
#include <grpc++/impl/codegen/string_ref.h>
#include <grpc++/impl/codegen/time.h>
#include <grpc/impl/codegen/compression_types.h>
#include <grpc/impl/codegen/time.h>

struct gpr_timespec;
struct grpc_metadata;
Expand Down
7 changes: 4 additions & 3 deletions include/grpc++/impl/codegen/server_interface.h
Original file line number Diff line number Diff line change
Expand Up @@ -192,10 +192,11 @@ class ServerInterface : public CallHook {
bool FinalizeResult(void** tag, bool* status) GRPC_OVERRIDE {
bool serialization_status =
*status && payload_ &&
SerializationTraits<Message>::Deserialize(
payload_, request_, server_->max_message_size()).ok();
SerializationTraits<Message>::Deserialize(payload_, request_,
server_->max_message_size())
.ok();
bool ret = RegisteredAsyncRequest::FinalizeResult(tag, status);
*status = serialization_status&&* status;
*status = serialization_status && *status;
return ret;
}

Expand Down
6 changes: 4 additions & 2 deletions include/grpc++/impl/codegen/sync_stream.h
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,8 @@ class ClientReader GRPC_FINAL : public ClientReaderInterface<R> {
ClientContext* context, const W& request)
: context_(context), call_(channel->CreateCall(method, context, &cq_)) {
CallOpSet<CallOpSendInitialMetadata, CallOpSendMessage,
CallOpClientSendClose> ops;
CallOpClientSendClose>
ops;
ops.SendInitialMetadata(context->send_initial_metadata_);
// TODO(ctiller): don't assert
GPR_CODEGEN_ASSERT(ops.SendMessage(request).ok());
Expand Down Expand Up @@ -235,7 +236,8 @@ class ClientWriter : public ClientWriterInterface<W> {
private:
ClientContext* context_;
CallOpSet<CallOpRecvInitialMetadata, CallOpGenericRecvMessage,
CallOpClientRecvStatus> finish_ops_;
CallOpClientRecvStatus>
finish_ops_;
CompletionQueue cq_;
Call call_;
};
Expand Down
6 changes: 3 additions & 3 deletions include/grpc++/support/byte_buffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@
#ifndef GRPCXX_SUPPORT_BYTE_BUFFER_H
#define GRPCXX_SUPPORT_BYTE_BUFFER_H

#include <grpc/grpc.h>
#include <grpc/byte_buffer.h>
#include <grpc/support/log.h>
#include <grpc++/impl/serialization_traits.h>
#include <grpc++/support/config.h>
#include <grpc++/support/slice.h>
#include <grpc++/support/status.h>
#include <grpc/byte_buffer.h>
#include <grpc/grpc.h>
#include <grpc/support/log.h>

#include <vector>

Expand Down
4 changes: 2 additions & 2 deletions include/grpc++/support/channel_arguments.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@
#ifndef GRPCXX_SUPPORT_CHANNEL_ARGUMENTS_H
#define GRPCXX_SUPPORT_CHANNEL_ARGUMENTS_H

#include <vector>
#include <list>
#include <vector>

#include <grpc++/support/config.h>
#include <grpc/compression.h>
#include <grpc/grpc.h>
#include <grpc++/support/config.h>

namespace grpc {
namespace testing {
Expand Down
2 changes: 1 addition & 1 deletion include/grpc++/support/slice.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
#ifndef GRPCXX_SUPPORT_SLICE_H
#define GRPCXX_SUPPORT_SLICE_H

#include <grpc/support/slice.h>
#include <grpc++/support/config.h>
#include <grpc/support/slice.h>

namespace grpc {

Expand Down
2 changes: 1 addition & 1 deletion include/grpc/byte_buffer_reader.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
#ifndef GRPC_BYTE_BUFFER_READER_H
#define GRPC_BYTE_BUFFER_READER_H

#include <grpc/grpc.h>
#include <grpc/byte_buffer.h>
#include <grpc/grpc.h>

#ifdef __cplusplus
extern "C" {
Expand Down
7 changes: 3 additions & 4 deletions include/grpc/compression.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@

#include <stdlib.h>

#include <grpc/impl/codegen/port_platform.h>
#include <grpc/impl/codegen/compression_types.h>
#include <grpc/impl/codegen/port_platform.h>

#ifdef __cplusplus
extern "C" {
Expand All @@ -59,9 +59,8 @@ GRPCAPI int grpc_compression_algorithm_name(
* compression algorithms encoded in the \a accepted_encodings bitset.
*
* It abort()s for unknown levels . */
GRPCAPI grpc_compression_algorithm
grpc_compression_algorithm_for_level(grpc_compression_level level,
uint32_t accepted_encodings);
GRPCAPI grpc_compression_algorithm grpc_compression_algorithm_for_level(
grpc_compression_level level, uint32_t accepted_encodings);

GRPCAPI void grpc_compression_options_init(grpc_compression_options *opts);

Expand Down
32 changes: 15 additions & 17 deletions include/grpc/grpc.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@

#include <grpc/status.h>

#include <stddef.h>
#include <grpc/byte_buffer.h>
#include <grpc/support/slice.h>
#include <grpc/support/time.h>
#include <grpc/impl/codegen/connectivity_state.h>
#include <grpc/impl/codegen/propagation_bits.h>
#include <grpc/impl/codegen/grpc_types.h>
#include <grpc/impl/codegen/propagation_bits.h>
#include <grpc/support/slice.h>
#include <grpc/support/time.h>
#include <stddef.h>

#ifdef __cplusplus
extern "C" {
Expand Down Expand Up @@ -154,9 +154,8 @@ GRPCAPI void grpc_alarm_cancel(grpc_alarm *alarm);
GRPCAPI void grpc_alarm_destroy(grpc_alarm *alarm);

/** Check the connectivity state of a channel. */
GRPCAPI grpc_connectivity_state
grpc_channel_check_connectivity_state(grpc_channel *channel,
int try_to_connect);
GRPCAPI grpc_connectivity_state grpc_channel_check_connectivity_state(
grpc_channel *channel, int try_to_connect);

/** Watch for a change in connectivity state.
Once the channel connectivity state is different from last_observed_state,
Expand Down Expand Up @@ -267,9 +266,10 @@ GRPCAPI grpc_call_error grpc_call_cancel(grpc_call *call, void *reserved);
and description passed in.
Importantly, this function does not send status nor description to the
remote endpoint. */
GRPCAPI grpc_call_error
grpc_call_cancel_with_status(grpc_call *call, grpc_status_code status,
const char *description, void *reserved);
GRPCAPI grpc_call_error grpc_call_cancel_with_status(grpc_call *call,
grpc_status_code status,
const char *description,
void *reserved);

/** Destroy a call.
THREAD SAFETY: grpc_call_destroy is thread-compatible */
Expand All @@ -283,13 +283,11 @@ GRPCAPI void grpc_call_destroy(grpc_call *call);
to \a cq_bound_to_call.
Note that \a cq_for_notification must have been registered to the server via
\a grpc_server_register_completion_queue. */
GRPCAPI grpc_call_error
grpc_server_request_call(grpc_server *server, grpc_call **call,
grpc_call_details *details,
grpc_metadata_array *request_metadata,
grpc_completion_queue *cq_bound_to_call,
grpc_completion_queue *cq_for_notification,
void *tag_new);
GRPCAPI grpc_call_error grpc_server_request_call(
grpc_server *server, grpc_call **call, grpc_call_details *details,
grpc_metadata_array *request_metadata,
grpc_completion_queue *cq_bound_to_call,
grpc_completion_queue *cq_for_notification, void *tag_new);

/** Registers a method in the server.
Methods to this (host, method) pair will not be reported by
Expand Down
9 changes: 4 additions & 5 deletions include/grpc/grpc_security.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,8 @@ grpc_auth_context_peer_identity(const grpc_auth_context *ctx);

/* Finds a property in the context. May return an empty iterator (first _next
will return NULL) if no property with this name was found in the context. */
GRPCAPI grpc_auth_property_iterator
grpc_auth_context_find_properties_by_name(const grpc_auth_context *ctx,
const char *name);
GRPCAPI grpc_auth_property_iterator grpc_auth_context_find_properties_by_name(
const grpc_auth_context *ctx, const char *name);

/* Gets the name of the property that indicates the peer identity. Will return
NULL if the peer is not authenticated. */
Expand Down Expand Up @@ -363,8 +362,8 @@ GRPCAPI int grpc_server_add_secure_http2_port(grpc_server *server,

/* Sets a credentials to a call. Can only be called on the client side before
grpc_call_start_batch. */
GRPCAPI grpc_call_error
grpc_call_set_credentials(grpc_call *call, grpc_call_credentials *creds);
GRPCAPI grpc_call_error grpc_call_set_credentials(grpc_call *call,
grpc_call_credentials *creds);

/* --- Auth Metadata Processing --- */

Expand Down
2 changes: 1 addition & 1 deletion include/grpc/impl/codegen/log.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
#ifndef GRPC_IMPL_CODEGEN_LOG_H
#define GRPC_IMPL_CODEGEN_LOG_H

#include <stdlib.h> /* for abort() */
#include <stdarg.h>
#include <stdlib.h> /* for abort() */

#include <grpc/impl/codegen/port_platform.h>

Expand Down
4 changes: 2 additions & 2 deletions include/grpc/impl/codegen/slice.h
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,8 @@ GPRAPI gpr_slice gpr_slice_new(void *p, size_t len, void (*destroy)(void *));

/* Equivalent to gpr_slice_new, but with a two argument destroy function that
also takes the slice length. */
GPRAPI gpr_slice
gpr_slice_new_with_len(void *p, size_t len, void (*destroy)(void *, size_t));
GPRAPI gpr_slice gpr_slice_new_with_len(void *p, size_t len,
void (*destroy)(void *, size_t));

/* Equivalent to gpr_slice_new(malloc(len), len, free), but saves one malloc()
call.
Expand Down
Loading

0 comments on commit f40df23

Please sign in to comment.