aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/grpc++
diff options
context:
space:
mode:
Diffstat (limited to 'include/grpc++')
-rw-r--r--include/grpc++/ext/health_check_service_server_builder_option.h4
-rw-r--r--include/grpc++/ext/proto_server_reflection_plugin.h4
-rw-r--r--include/grpc++/generic/generic_stub.h6
-rw-r--r--include/grpc++/health_check_service_interface.h18
-rw-r--r--include/grpc++/impl/codegen/async_stream.h6
-rw-r--r--include/grpc++/impl/codegen/async_unary_call.h2
-rw-r--r--include/grpc++/impl/codegen/call.h4
-rw-r--r--include/grpc++/impl/codegen/call_hook.h3
-rw-r--r--include/grpc++/impl/codegen/client_context.h5
-rw-r--r--include/grpc++/impl/codegen/client_unary_call.h2
-rw-r--r--include/grpc++/impl/codegen/completion_queue.h3
-rw-r--r--include/grpc++/impl/codegen/completion_queue_tag.h8
-rw-r--r--include/grpc++/impl/codegen/config.h6
-rw-r--r--include/grpc++/impl/codegen/method_handler_impl.h24
-rw-r--r--include/grpc++/impl/codegen/rpc_method.h1
-rw-r--r--include/grpc++/impl/codegen/rpc_service_method.h8
-rw-r--r--include/grpc++/impl/codegen/security/auth_context.h2
-rw-r--r--include/grpc++/impl/codegen/server_context.h8
-rw-r--r--include/grpc++/impl/codegen/service_type.h1
-rw-r--r--include/grpc++/impl/codegen/status_code_enum.h6
-rw-r--r--include/grpc++/impl/codegen/string_ref.h16
-rw-r--r--include/grpc++/impl/codegen/stub_options.h1
-rw-r--r--include/grpc++/impl/codegen/sync_stream.h4
-rw-r--r--include/grpc++/impl/codegen/time.h19
-rw-r--r--include/grpc++/impl/server_builder_plugin.h14
-rw-r--r--include/grpc++/resource_quota.h1
-rw-r--r--include/grpc++/security/auth_metadata_processor.h22
-rw-r--r--include/grpc++/security/credentials.h18
-rw-r--r--include/grpc++/security/server_credentials.h16
-rw-r--r--include/grpc++/support/error_details.h16
-rw-r--r--include/grpc++/test/mock_stream.h40
-rw-r--r--include/grpc++/test/server_context_test_spouse.h8
32 files changed, 154 insertions, 142 deletions
diff --git a/include/grpc++/ext/health_check_service_server_builder_option.h b/include/grpc++/ext/health_check_service_server_builder_option.h
index 4861daacd4..a27841af01 100644
--- a/include/grpc++/ext/health_check_service_server_builder_option.h
+++ b/include/grpc++/ext/health_check_service_server_builder_option.h
@@ -44,8 +44,8 @@ namespace grpc {
class HealthCheckServiceServerBuilderOption : public ServerBuilderOption {
public:
- // The ownership of hc will be taken and transferred to the grpc server.
- // To explicitly disable default service, pass in a nullptr.
+ /// The ownership of hc will be taken and transferred to the grpc server.
+ /// To explicitly disable default service, pass in a nullptr.
explicit HealthCheckServiceServerBuilderOption(
std::unique_ptr<HealthCheckServiceInterface> hc);
~HealthCheckServiceServerBuilderOption() override {}
diff --git a/include/grpc++/ext/proto_server_reflection_plugin.h b/include/grpc++/ext/proto_server_reflection_plugin.h
index 66f39eb876..6497bba905 100644
--- a/include/grpc++/ext/proto_server_reflection_plugin.h
+++ b/include/grpc++/ext/proto_server_reflection_plugin.h
@@ -59,8 +59,8 @@ class ProtoServerReflectionPlugin : public ::grpc::ServerBuilderPlugin {
std::shared_ptr<grpc::ProtoServerReflection> reflection_service_;
};
-// Add proto reflection plugin to ServerBuilder. This function should be called
-// at the static initialization time.
+/// Add proto reflection plugin to ServerBuilder. This function should be called
+/// at the static initialization time.
void InitProtoReflectionServerBuilderPlugin();
} // namespace reflection
diff --git a/include/grpc++/generic/generic_stub.h b/include/grpc++/generic/generic_stub.h
index 02c00d0d45..3c11e55001 100644
--- a/include/grpc++/generic/generic_stub.h
+++ b/include/grpc++/generic/generic_stub.h
@@ -43,14 +43,14 @@ class CompletionQueue;
typedef ClientAsyncReaderWriter<ByteBuffer, ByteBuffer>
GenericClientAsyncReaderWriter;
-// Generic stubs provide a type-unsafe interface to call gRPC methods
-// by name.
+/// Generic stubs provide a type-unsafe interface to call gRPC methods
+/// by name.
class GenericStub final {
public:
explicit GenericStub(std::shared_ptr<ChannelInterface> channel)
: channel_(channel) {}
- // begin a call to a named method
+ /// begin a call to a named method
std::unique_ptr<GenericClientAsyncReaderWriter> Call(
ClientContext* context, const grpc::string& method, CompletionQueue* cq,
void* tag);
diff --git a/include/grpc++/health_check_service_interface.h b/include/grpc++/health_check_service_interface.h
index 0eed702683..8323e9e554 100644
--- a/include/grpc++/health_check_service_interface.h
+++ b/include/grpc++/health_check_service_interface.h
@@ -41,26 +41,26 @@ namespace grpc {
const char kHealthCheckServiceInterfaceArg[] =
"grpc.health_check_service_interface";
-// The gRPC server uses this interface to expose the health checking service
-// without depending on protobuf.
+/// The gRPC server uses this interface to expose the health checking service
+/// without depending on protobuf.
class HealthCheckServiceInterface {
public:
virtual ~HealthCheckServiceInterface() {}
- // Set or change the serving status of the given service_name.
+ /// Set or change the serving status of the given service_name.
virtual void SetServingStatus(const grpc::string& service_name,
bool serving) = 0;
- // Apply to all registered service names.
+ /// Apply to all registered service names.
virtual void SetServingStatus(bool serving) = 0;
};
-// Enable/disable the default health checking service. This applies to all C++
-// servers created afterwards. For each server, user can override the default
-// with a HealthCheckServiceServerBuilderOption.
-// NOT thread safe.
+/// Enable/disable the default health checking service. This applies to all C++
+/// servers created afterwards. For each server, user can override the default
+/// with a HealthCheckServiceServerBuilderOption.
+/// NOT thread safe.
void EnableDefaultHealthCheckService(bool enable);
-// NOT thread safe.
+/// NOT thread safe.
bool DefaultHealthCheckServiceEnabled();
} // namespace grpc
diff --git a/include/grpc++/impl/codegen/async_stream.h b/include/grpc++/impl/codegen/async_stream.h
index f97d824baf..39f0ebd86f 100644
--- a/include/grpc++/impl/codegen/async_stream.h
+++ b/include/grpc++/impl/codegen/async_stream.h
@@ -155,7 +155,7 @@ class ClientAsyncReader final : public ClientAsyncReaderInterface<R> {
ClientAsyncReader(call, context, request, tag);
}
- // always allocated against a call arena, no memory free required
+ /// always allocated against a call arena, no memory free required
static void operator delete(void* ptr, std::size_t size) {
assert(size == sizeof(ClientAsyncReader));
}
@@ -235,7 +235,7 @@ class ClientAsyncWriter final : public ClientAsyncWriterInterface<W> {
ClientAsyncWriter(call, context, response, tag);
}
- // always allocated against a call arena, no memory free required
+ /// always allocated against a call arena, no memory free required
static void operator delete(void* ptr, std::size_t size) {
assert(size == sizeof(ClientAsyncWriter));
}
@@ -338,7 +338,7 @@ class ClientAsyncReaderWriter final
ClientAsyncReaderWriter(call, context, tag);
}
- // always allocated against a call arena, no memory free required
+ /// always allocated against a call arena, no memory free required
static void operator delete(void* ptr, std::size_t size) {
assert(size == sizeof(ClientAsyncReaderWriter));
}
diff --git a/include/grpc++/impl/codegen/async_unary_call.h b/include/grpc++/impl/codegen/async_unary_call.h
index a147a6acbf..ea2da42198 100644
--- a/include/grpc++/impl/codegen/async_unary_call.h
+++ b/include/grpc++/impl/codegen/async_unary_call.h
@@ -71,7 +71,7 @@ class ClientAsyncResponseReader final
ClientAsyncResponseReader(call, context, request);
}
- // always allocated against a call arena, no memory free required
+ /// always allocated against a call arena, no memory free required
static void operator delete(void* ptr, std::size_t size) {
assert(size == sizeof(ClientAsyncResponseReader));
}
diff --git a/include/grpc++/impl/codegen/call.h b/include/grpc++/impl/codegen/call.h
index 9fe2bbb75e..bbd0fc2dc8 100644
--- a/include/grpc++/impl/codegen/call.h
+++ b/include/grpc++/impl/codegen/call.h
@@ -634,10 +634,10 @@ class SneakyCallOpSet : public CallOpSet<Op1, Op2, Op3, Op4, Op5, Op6> {
}
};
-// Straightforward wrapping of the C call object
+/// Straightforward wrapping of the C call object
class Call final {
public:
- /* call is owned by the caller */
+ /** call is owned by the caller */
Call(grpc_call* call, CallHook* call_hook, CompletionQueue* cq)
: call_hook_(call_hook),
cq_(cq),
diff --git a/include/grpc++/impl/codegen/call_hook.h b/include/grpc++/impl/codegen/call_hook.h
index 6a8258233d..812c4a91e7 100644
--- a/include/grpc++/impl/codegen/call_hook.h
+++ b/include/grpc++/impl/codegen/call_hook.h
@@ -39,7 +39,8 @@ namespace grpc {
class CallOpSetInterface;
class Call;
-/// Channel and Server implement this to allow them to hook performing ops
+/// An interface that Channel and Server implement to allow them to hook
+/// performing ops
class CallHook {
public:
virtual ~CallHook() {}
diff --git a/include/grpc++/impl/codegen/client_context.h b/include/grpc++/impl/codegen/client_context.h
index 3c50e6ba9d..c17ce20186 100644
--- a/include/grpc++/impl/codegen/client_context.h
+++ b/include/grpc++/impl/codegen/client_context.h
@@ -151,6 +151,7 @@ namespace testing {
class InteropClientContextInspector;
} // namespace testing
+/// Gives access to client side RPC configuration.
class ClientContext {
public:
ClientContext();
@@ -325,8 +326,8 @@ class ClientContext {
};
static void SetGlobalCallbacks(GlobalCallbacks* callbacks);
- // Should be used for framework-level extensions only.
- // Applications never need to call this method.
+ /// Should be used for framework-level extensions only.
+ /// Applications never need to call this method.
grpc_call* c_call() { return call_; }
private:
diff --git a/include/grpc++/impl/codegen/client_unary_call.h b/include/grpc++/impl/codegen/client_unary_call.h
index 4bf35ae778..b923498db8 100644
--- a/include/grpc++/impl/codegen/client_unary_call.h
+++ b/include/grpc++/impl/codegen/client_unary_call.h
@@ -47,7 +47,7 @@ class ClientContext;
class CompletionQueue;
class RpcMethod;
-// Wrapper that performs a blocking unary call
+/// Wrapper that performs a blocking unary call
template <class InputMessage, class OutputMessage>
Status BlockingUnaryCall(ChannelInterface* channel, const RpcMethod& method,
ClientContext* context, const InputMessage& request,
diff --git a/include/grpc++/impl/codegen/completion_queue.h b/include/grpc++/impl/codegen/completion_queue.h
index c8ab726b0f..57333d7158 100644
--- a/include/grpc++/impl/codegen/completion_queue.h
+++ b/include/grpc++/impl/codegen/completion_queue.h
@@ -159,7 +159,8 @@ class CompletionQueue : private GrpcLibraryCodegen {
/// will start to return false and \a AsyncNext will return \a
/// NextStatus::SHUTDOWN. Only once either one of these methods does that
/// (that is, once the queue has been \em drained) can an instance of this
- /// class be destroyed.
+ /// class be destroyed. Also note that applications must ensure that
+ /// no work is enqueued on this completion queue after this method is called.
void Shutdown();
/// Returns a \em raw pointer to the underlying \a grpc_completion_queue
diff --git a/include/grpc++/impl/codegen/completion_queue_tag.h b/include/grpc++/impl/codegen/completion_queue_tag.h
index 19a08500cf..0affc818e8 100644
--- a/include/grpc++/impl/codegen/completion_queue_tag.h
+++ b/include/grpc++/impl/codegen/completion_queue_tag.h
@@ -40,10 +40,10 @@ namespace grpc {
class CompletionQueueTag {
public:
virtual ~CompletionQueueTag() {}
- // Called prior to returning from Next(), return value is the status of the
- // operation (return status is the default thing to do). If this function
- // returns false, the tag is dropped and not returned from the completion
- // queue
+ /// Called prior to returning from Next(), return value is the status of the
+ /// operation (return status is the default thing to do). If this function
+ /// returns false, the tag is dropped and not returned from the completion
+ /// queue
virtual bool FinalizeResult(void** tag, bool* status) = 0;
};
diff --git a/include/grpc++/impl/codegen/config.h b/include/grpc++/impl/codegen/config.h
index a43bf65f91..79352eee3c 100644
--- a/include/grpc++/impl/codegen/config.h
+++ b/include/grpc++/impl/codegen/config.h
@@ -39,9 +39,9 @@
#define GRPC_CUSTOM_STRING std::string
#endif
-// The following macros are deprecated and appear only for users
-// with PB files generated using gRPC 1.0.x plugins. They should
-// not be used in new code
+/// The following macros are deprecated and appear only for users
+/// with PB files generated using gRPC 1.0.x plugins. They should
+/// not be used in new code
#define GRPC_OVERRIDE override // deprecated
#define GRPC_FINAL final // deprecated
diff --git a/include/grpc++/impl/codegen/method_handler_impl.h b/include/grpc++/impl/codegen/method_handler_impl.h
index 83b569ce74..8dfaf5883c 100644
--- a/include/grpc++/impl/codegen/method_handler_impl.h
+++ b/include/grpc++/impl/codegen/method_handler_impl.h
@@ -40,7 +40,7 @@
namespace grpc {
-// A wrapper class of an application provided rpc method handler.
+/// A wrapper class of an application provided rpc method handler.
template <class ServiceType, class RequestType, class ResponseType>
class RpcMethodHandler : public MethodHandler {
public:
@@ -77,7 +77,7 @@ class RpcMethodHandler : public MethodHandler {
}
private:
- // Application provided rpc handler function.
+ /// Application provided rpc handler function.
std::function<Status(ServiceType*, ServerContext*, const RequestType*,
ResponseType*)>
func_;
@@ -85,7 +85,7 @@ class RpcMethodHandler : public MethodHandler {
ServiceType* service_;
};
-// A wrapper class of an application provided client streaming handler.
+/// A wrapper class of an application provided client streaming handler.
template <class ServiceType, class RequestType, class ResponseType>
class ClientStreamingHandler : public MethodHandler {
public:
@@ -125,7 +125,7 @@ class ClientStreamingHandler : public MethodHandler {
ServiceType* service_;
};
-// A wrapper class of an application provided server streaming handler.
+/// A wrapper class of an application provided server streaming handler.
template <class ServiceType, class RequestType, class ResponseType>
class ServerStreamingHandler : public MethodHandler {
public:
@@ -166,13 +166,13 @@ class ServerStreamingHandler : public MethodHandler {
ServiceType* service_;
};
-// A wrapper class of an application provided bidi-streaming handler.
-// This also applies to server-streamed implementation of a unary method
-// with the additional requirement that such methods must have done a
-// write for status to be ok
-// Since this is used by more than 1 class, the service is not passed in.
-// Instead, it is expected to be an implicitly-captured argument of func
-// (through bind or something along those lines)
+/// A wrapper class of an application provided bidi-streaming handler.
+/// This also applies to server-streamed implementation of a unary method
+/// with the additional requirement that such methods must have done a
+/// write for status to be ok
+/// Since this is used by more than 1 class, the service is not passed in.
+/// Instead, it is expected to be an implicitly-captured argument of func
+/// (through bind or something along those lines)
template <class Streamer, bool WriteNeeded>
class TemplatedBidiStreamingHandler : public MethodHandler {
public:
@@ -249,7 +249,7 @@ class SplitServerStreamingHandler
ServerSplitStreamer<RequestType, ResponseType>, false>(func) {}
};
-// Handle unknown method by returning UNIMPLEMENTED error.
+/// Handle unknown method by returning UNIMPLEMENTED error.
class UnknownMethodHandler : public MethodHandler {
public:
template <class T>
diff --git a/include/grpc++/impl/codegen/rpc_method.h b/include/grpc++/impl/codegen/rpc_method.h
index 4897428074..ca7527507c 100644
--- a/include/grpc++/impl/codegen/rpc_method.h
+++ b/include/grpc++/impl/codegen/rpc_method.h
@@ -40,6 +40,7 @@
namespace grpc {
+/// Descriptor of an RPC method
class RpcMethod {
public:
enum RpcType {
diff --git a/include/grpc++/impl/codegen/rpc_service_method.h b/include/grpc++/impl/codegen/rpc_service_method.h
index eb8f9a1096..96bb739c99 100644
--- a/include/grpc++/impl/codegen/rpc_service_method.h
+++ b/include/grpc++/impl/codegen/rpc_service_method.h
@@ -52,7 +52,7 @@ namespace grpc {
class ServerContext;
class StreamContextInterface;
-// Base class for running an RPC handler.
+/// Base class for running an RPC handler.
class MethodHandler {
public:
virtual ~MethodHandler() {}
@@ -67,17 +67,17 @@ class MethodHandler {
virtual void RunHandler(const HandlerParameter& param) = 0;
};
-// Server side rpc method class
+/// Server side rpc method class
class RpcServiceMethod : public RpcMethod {
public:
- // Takes ownership of the handler
+ /// Takes ownership of the handler
RpcServiceMethod(const char* name, RpcMethod::RpcType type,
MethodHandler* handler)
: RpcMethod(name, type), server_tag_(nullptr), handler_(handler) {}
void set_server_tag(void* tag) { server_tag_ = tag; }
void* server_tag() const { return server_tag_; }
- // if MethodHandler is nullptr, then this is an async method
+ /// if MethodHandler is nullptr, then this is an async method
MethodHandler* handler() const { return handler_.get(); }
void ResetHandler() { handler_.reset(); }
void SetHandler(MethodHandler* handler) { handler_.reset(handler); }
diff --git a/include/grpc++/impl/codegen/security/auth_context.h b/include/grpc++/impl/codegen/security/auth_context.h
index 75f2482346..e83877bcaf 100644
--- a/include/grpc++/impl/codegen/security/auth_context.h
+++ b/include/grpc++/impl/codegen/security/auth_context.h
@@ -99,7 +99,7 @@ class AuthContext {
virtual AuthPropertyIterator begin() const = 0;
virtual AuthPropertyIterator end() const = 0;
- // Mutation functions: should only be used by an AuthMetadataProcessor.
+ /// Mutation functions: should only be used by an AuthMetadataProcessor.
virtual void AddProperty(const grpc::string& key,
const grpc::string_ref& value) = 0;
virtual bool SetPeerIdentityPropertyName(const grpc::string& name) = 0;
diff --git a/include/grpc++/impl/codegen/server_context.h b/include/grpc++/impl/codegen/server_context.h
index ada304d571..07e3710b4b 100644
--- a/include/grpc++/impl/codegen/server_context.h
+++ b/include/grpc++/impl/codegen/server_context.h
@@ -91,7 +91,7 @@ class InteropServerContextInspector;
class ServerContextTestSpouse;
} // namespace testing
-// Interface of server side rpc context.
+/// Interface of server side rpc context.
class ServerContext {
public:
ServerContext(); // for async calls
@@ -106,9 +106,9 @@ class ServerContext {
void AddInitialMetadata(const grpc::string& key, const grpc::string& value);
void AddTrailingMetadata(const grpc::string& key, const grpc::string& value);
- // IsCancelled is always safe to call when using sync API
- // When using async API, it is only safe to call IsCancelled after
- // the AsyncNotifyWhenDone tag has been delivered
+ /// IsCancelled is always safe to call when using sync API
+ /// When using async API, it is only safe to call IsCancelled after
+ /// the AsyncNotifyWhenDone tag has been delivered
bool IsCancelled() const;
// Cancel the Call from the server. This is a best-effort API and depending on
diff --git a/include/grpc++/impl/codegen/service_type.h b/include/grpc++/impl/codegen/service_type.h
index bd65ea009e..0df90678b1 100644
--- a/include/grpc++/impl/codegen/service_type.h
+++ b/include/grpc++/impl/codegen/service_type.h
@@ -61,6 +61,7 @@ class ServerAsyncStreamingInterface {
virtual void BindCall(Call* call) = 0;
};
+/// Desriptor of an RPC service and its various RPC methods
class Service {
public:
Service() : server_(nullptr) {}
diff --git a/include/grpc++/impl/codegen/status_code_enum.h b/include/grpc++/impl/codegen/status_code_enum.h
index 9a90a18e2a..2eb97e83c1 100644
--- a/include/grpc++/impl/codegen/status_code_enum.h
+++ b/include/grpc++/impl/codegen/status_code_enum.h
@@ -136,6 +136,12 @@ enum StatusCode {
/// The service is currently unavailable. This is a most likely a transient
/// condition and may be corrected by retrying with a backoff.
///
+ /// \warning: Although data MIGHT not have been transmitted when this
+ /// status occurs, there is NOT A GUARANTEE that the server has not seen
+ /// anything. So in general it is unsafe to retry on this status code
+ /// if the call is non-idempotent.
+ ///
+ ///
/// See litmus test above for deciding between FAILED_PRECONDITION, ABORTED,
/// and UNAVAILABLE.
UNAVAILABLE = 14,
diff --git a/include/grpc++/impl/codegen/string_ref.h b/include/grpc++/impl/codegen/string_ref.h
index 003793823c..4ed11b1b6c 100644
--- a/include/grpc++/impl/codegen/string_ref.h
+++ b/include/grpc++/impl/codegen/string_ref.h
@@ -55,14 +55,14 @@ namespace grpc {
/// compatibility.
class string_ref {
public:
- // types
+ /// types
typedef const char* const_iterator;
typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
- // constants
+ /// constants
const static size_t npos;
- // construct/copy.
+ /// construct/copy.
string_ref() : data_(nullptr), length_(0) {}
string_ref(const string_ref& other)
: data_(other.data_), length_(other.length_) {}
@@ -76,7 +76,7 @@ class string_ref {
string_ref(const char* s, size_t l) : data_(s), length_(l) {}
string_ref(const grpc::string& s) : data_(s.data()), length_(s.length()) {}
- // iterators
+ /// iterators
const_iterator begin() const { return data_; }
const_iterator end() const { return data_ + length_; }
const_iterator cbegin() const { return data_; }
@@ -94,16 +94,16 @@ class string_ref {
return const_reverse_iterator(begin());
}
- // capacity
+ /// capacity
size_t size() const { return length_; }
size_t length() const { return length_; }
size_t max_size() const { return length_; }
bool empty() const { return length_ == 0; }
- // element access
+ /// element access
const char* data() const { return data_; }
- // string operations
+ /// string operations
int compare(string_ref x) const {
size_t min_size = length_ < x.length_ ? length_ : x.length_;
int r = memcmp(data_, x.data_, min_size);
@@ -144,7 +144,7 @@ class string_ref {
size_t length_;
};
-// Comparison operators
+/// Comparison operators
inline bool operator==(string_ref x, string_ref y) { return x.compare(y) == 0; }
inline bool operator!=(string_ref x, string_ref y) { return x.compare(y) != 0; }
inline bool operator<(string_ref x, string_ref y) { return x.compare(y) < 0; }
diff --git a/include/grpc++/impl/codegen/stub_options.h b/include/grpc++/impl/codegen/stub_options.h
index 8e966a8dbf..41aef19ab0 100644
--- a/include/grpc++/impl/codegen/stub_options.h
+++ b/include/grpc++/impl/codegen/stub_options.h
@@ -36,6 +36,7 @@
namespace grpc {
+/// Useful interface for generated stubs
class StubOptions {};
} // namespace grpc
diff --git a/include/grpc++/impl/codegen/sync_stream.h b/include/grpc++/impl/codegen/sync_stream.h
index a010924cef..34b814e9e3 100644
--- a/include/grpc++/impl/codegen/sync_stream.h
+++ b/include/grpc++/impl/codegen/sync_stream.h
@@ -516,7 +516,7 @@ class ServerReaderWriterInterface : public ServerStreamingInterface,
public WriterInterface<W>,
public ReaderInterface<R> {};
-// Actual implementation of bi-directional streaming
+/// Actual implementation of bi-directional streaming
namespace internal {
template <class W, class R>
class ServerReaderWriterBody final {
@@ -576,7 +576,7 @@ class ServerReaderWriterBody final {
};
} // namespace internal
-// class to represent the user API for a bidirectional streaming call
+/// class to represent the user API for a bidirectional streaming call
template <class W, class R>
class ServerReaderWriter final : public ServerReaderWriterInterface<W, R> {
public:
diff --git a/include/grpc++/impl/codegen/time.h b/include/grpc++/impl/codegen/time.h
index e090ece756..81ca7bb3de 100644
--- a/include/grpc++/impl/codegen/time.h
+++ b/include/grpc++/impl/codegen/time.h
@@ -39,17 +39,16 @@
namespace grpc {
-/* If you are trying to use CompletionQueue::AsyncNext with a time class that
- isn't either gpr_timespec or std::chrono::system_clock::time_point, you
- will most likely be looking at this comment as your compiler will have
- fired an error below. In order to fix this issue, you have two potential
- solutions:
-
- 1. Use gpr_timespec or std::chrono::system_clock::time_point instead
- 2. Specialize the TimePoint class with whichever time class that you
- want to use here. See below for two examples of how to do this.
+/** If you are trying to use CompletionQueue::AsyncNext with a time class that
+ isn't either gpr_timespec or std::chrono::system_clock::time_point, you
+ will most likely be looking at this comment as your compiler will have
+ fired an error below. In order to fix this issue, you have two potential
+ solutions:
+
+ 1. Use gpr_timespec or std::chrono::system_clock::time_point instead
+ 2. Specialize the TimePoint class with whichever time class that you
+ want to use here. See below for two examples of how to do this.
*/
-
template <typename T>
class TimePoint {
public:
diff --git a/include/grpc++/impl/server_builder_plugin.h b/include/grpc++/impl/server_builder_plugin.h
index 61632e32fa..7697232807 100644
--- a/include/grpc++/impl/server_builder_plugin.h
+++ b/include/grpc++/impl/server_builder_plugin.h
@@ -48,19 +48,19 @@ class ServerBuilderPlugin {
virtual ~ServerBuilderPlugin() {}
virtual grpc::string name() = 0;
- // InitServer will be called in ServerBuilder::BuildAndStart(), after the
- // Server instance is created.
+ /// InitServer will be called in ServerBuilder::BuildAndStart(), after the
+ /// Server instance is created.
virtual void InitServer(ServerInitializer* si) = 0;
- // Finish will be called at the end of ServerBuilder::BuildAndStart().
+ /// Finish will be called at the end of ServerBuilder::BuildAndStart().
virtual void Finish(ServerInitializer* si) = 0;
- // ChangeArguments is an interface that can be used in
- // ServerBuilderOption::UpdatePlugins
+ /// ChangeArguments is an interface that can be used in
+ /// ServerBuilderOption::UpdatePlugins
virtual void ChangeArguments(const grpc::string& name, void* value) = 0;
- // UpdateChannelArguments will be called in ServerBuilder::BuildAndStart(),
- // before the Server instance is created.
+ /// UpdateChannelArguments will be called in ServerBuilder::BuildAndStart(),
+ /// before the Server instance is created.
virtual void UpdateChannelArguments(ChannelArguments* args) {}
virtual bool has_sync_methods() const { return false; }
diff --git a/include/grpc++/resource_quota.h b/include/grpc++/resource_quota.h
index 68a514658d..da14088ebb 100644
--- a/include/grpc++/resource_quota.h
+++ b/include/grpc++/resource_quota.h
@@ -47,6 +47,7 @@ namespace grpc {
/// all attached entities below the ResourceQuota bound.
class ResourceQuota final : private GrpcLibraryCodegen {
public:
+ // \param name - a unique name for this ResourceQuota.
explicit ResourceQuota(const grpc::string& name);
ResourceQuota();
~ResourceQuota();
diff --git a/include/grpc++/security/auth_metadata_processor.h b/include/grpc++/security/auth_metadata_processor.h
index 1ae32d0f6c..3536923146 100644
--- a/include/grpc++/security/auth_metadata_processor.h
+++ b/include/grpc++/security/auth_metadata_processor.h
@@ -49,19 +49,19 @@ class AuthMetadataProcessor {
virtual ~AuthMetadataProcessor() {}
- // If this method returns true, the Process function will be scheduled in
- // a different thread from the one processing the call.
+ /// If this method returns true, the Process function will be scheduled in
+ /// a different thread from the one processing the call.
virtual bool IsBlocking() const { return true; }
- // context is read/write: it contains the properties of the channel peer and
- // it is the job of the Process method to augment it with properties derived
- // from the passed-in auth_metadata.
- // consumed_auth_metadata needs to be filled with metadata that has been
- // consumed by the processor and will be removed from the call.
- // response_metadata is the metadata that will be sent as part of the
- // response.
- // If the return value is not Status::OK, the rpc call will be aborted with
- // the error code and error message sent back to the client.
+ /// context is read/write: it contains the properties of the channel peer and
+ /// it is the job of the Process method to augment it with properties derived
+ /// from the passed-in auth_metadata.
+ /// consumed_auth_metadata needs to be filled with metadata that has been
+ /// consumed by the processor and will be removed from the call.
+ /// response_metadata is the metadata that will be sent as part of the
+ /// response.
+ /// If the return value is not Status::OK, the rpc call will be aborted with
+ /// the error code and error message sent back to the client.
virtual Status Process(const InputMetadata& auth_metadata,
AuthContext* context,
OutputMetadata* consumed_auth_metadata,
diff --git a/include/grpc++/security/credentials.h b/include/grpc++/security/credentials.h
index 59861b78d8..8d9d181fde 100644
--- a/include/grpc++/security/credentials.h
+++ b/include/grpc++/security/credentials.h
@@ -204,23 +204,23 @@ std::shared_ptr<ChannelCredentials> InsecureChannelCredentials();
/// Credentials for a channel using Cronet.
std::shared_ptr<ChannelCredentials> CronetChannelCredentials(void* engine);
-// User defined metadata credentials.
+/// User defined metadata credentials.
class MetadataCredentialsPlugin {
public:
virtual ~MetadataCredentialsPlugin() {}
- // If this method returns true, the Process function will be scheduled in
- // a different thread from the one processing the call.
+ /// If this method returns true, the Process function will be scheduled in
+ /// a different thread from the one processing the call.
virtual bool IsBlocking() const { return true; }
- // Type of credentials this plugin is implementing.
+ /// Type of credentials this plugin is implementing.
virtual const char* GetType() const { return ""; }
- // Gets the auth metatada produced by this plugin.
- // The fully qualified method name is:
- // service_url + "/" + method_name.
- // The channel_auth_context contains (among other things), the identity of
- // the server.
+ /// Gets the auth metatada produced by this plugin.
+ /// The fully qualified method name is:
+ /// service_url + "/" + method_name.
+ /// The channel_auth_context contains (among other things), the identity of
+ /// the server.
virtual Status GetMetadata(
grpc::string_ref service_url, grpc::string_ref method_name,
const AuthContext& channel_auth_context,
diff --git a/include/grpc++/security/server_credentials.h b/include/grpc++/security/server_credentials.h
index 229bab8d84..4676b04c5d 100644
--- a/include/grpc++/security/server_credentials.h
+++ b/include/grpc++/security/server_credentials.h
@@ -46,13 +46,13 @@ struct grpc_server;
namespace grpc {
class Server;
-// Wrapper around \a grpc_server_credentials, a way to authenticate a server.
+/// Wrapper around \a grpc_server_credentials, a way to authenticate a server.
class ServerCredentials {
public:
virtual ~ServerCredentials();
- // This method is not thread-safe and has to be called before the server is
- // started. The last call to this function wins.
+ /// This method is not thread-safe and has to be called before the server is
+ /// started. The last call to this function wins.
virtual void SetAuthMetadataProcessor(
const std::shared_ptr<AuthMetadataProcessor>& processor) = 0;
@@ -70,7 +70,7 @@ class ServerCredentials {
/// Options to create ServerCredentials with SSL
struct SslServerCredentialsOptions {
- // Deprecated
+ /// Deprecated
SslServerCredentialsOptions()
: force_client_auth(false),
client_certificate_request(GRPC_SSL_DONT_REQUEST_CLIENT_CERTIFICATE) {}
@@ -84,12 +84,12 @@ struct SslServerCredentialsOptions {
};
grpc::string pem_root_certs;
std::vector<PemKeyCertPair> pem_key_cert_pairs;
- // Deprecated
+ /// Deprecated
bool force_client_auth;
- // If both force_client_auth and client_certificate_request fields are set,
- // force_client_auth takes effect i.e
- // REQUEST_AND_REQUIRE_CLIENT_CERTIFICATE_AND_VERIFY will be enforced.
+ /// If both force_client_auth and client_certificate_request fields are set,
+ /// force_client_auth takes effect i.e
+ /// REQUEST_AND_REQUIRE_CLIENT_CERTIFICATE_AND_VERIFY will be enforced.
grpc_ssl_client_certificate_request_type client_certificate_request;
};
diff --git a/include/grpc++/support/error_details.h b/include/grpc++/support/error_details.h
index 411175fb46..d4324d35cf 100644
--- a/include/grpc++/support/error_details.h
+++ b/include/grpc++/support/error_details.h
@@ -44,16 +44,16 @@ class Status;
namespace grpc {
-// Maps a grpc::Status to a google::rpc::Status.
-// The given \a to object will be cleared.
-// On success, returns status with OK.
-// Returns status with INVALID_ARGUMENT, if failed to deserialize.
-// Returns status with FAILED_PRECONDITION, if \a to is nullptr.
+/// Maps a grpc::Status to a google::rpc::Status.
+/// The given \a to object will be cleared.
+/// On success, returns status with OK.
+/// Returns status with INVALID_ARGUMENT, if failed to deserialize.
+/// Returns status with FAILED_PRECONDITION, if \a to is nullptr.
Status ExtractErrorDetails(const Status& from, ::google::rpc::Status* to);
-// Maps google::rpc::Status to a grpc::Status.
-// Returns OK on success.
-// Returns status with FAILED_PRECONDITION if \a to is nullptr.
+/// Maps google::rpc::Status to a grpc::Status.
+/// Returns OK on success.
+/// Returns status with FAILED_PRECONDITION if \a to is nullptr.
Status SetErrorDetails(const ::google::rpc::Status& from, Status* to);
} // namespace grpc
diff --git a/include/grpc++/test/mock_stream.h b/include/grpc++/test/mock_stream.h
index f2de9472d6..f6e94a48b3 100644
--- a/include/grpc++/test/mock_stream.h
+++ b/include/grpc++/test/mock_stream.h
@@ -50,14 +50,14 @@ class MockClientReader : public ClientReaderInterface<R> {
public:
MockClientReader() = default;
- // ClientStreamingInterface
+ /// ClientStreamingInterface
MOCK_METHOD0_T(Finish, Status());
- // ReaderInterface
+ /// ReaderInterface
MOCK_METHOD1_T(NextMessageSize, bool(uint32_t*));
MOCK_METHOD1_T(Read, bool(R*));
- // ClientReaderInterface
+ /// ClientReaderInterface
MOCK_METHOD0_T(WaitForInitialMetadata, void());
};
@@ -66,13 +66,13 @@ class MockClientWriter : public ClientWriterInterface<W> {
public:
MockClientWriter() = default;
- // ClientStreamingInterface
+ /// ClientStreamingInterface
MOCK_METHOD0_T(Finish, Status());
- // WriterInterface
+ /// WriterInterface
MOCK_METHOD2_T(Write, bool(const W&, const WriteOptions));
- // ClientWriterInterface
+ /// ClientWriterInterface
MOCK_METHOD0_T(WritesDone, bool());
};
@@ -81,22 +81,22 @@ class MockClientReaderWriter : public ClientReaderWriterInterface<W, R> {
public:
MockClientReaderWriter() = default;
- // ClientStreamingInterface
+ /// ClientStreamingInterface
MOCK_METHOD0_T(Finish, Status());
- // ReaderInterface
+ /// ReaderInterface
MOCK_METHOD1_T(NextMessageSize, bool(uint32_t*));
MOCK_METHOD1_T(Read, bool(R*));
- // WriterInterface
+ /// WriterInterface
MOCK_METHOD2_T(Write, bool(const W&, const WriteOptions));
- // ClientReaderWriterInterface
+ /// ClientReaderWriterInterface
MOCK_METHOD0_T(WaitForInitialMetadata, void());
MOCK_METHOD0_T(WritesDone, bool());
};
-// TODO: We do not support mocking an async RPC for now.
+/// TODO: We do not support mocking an async RPC for now.
template <class R>
class MockClientAsyncResponseReader
@@ -113,11 +113,11 @@ class MockClientAsyncReader : public ClientAsyncReaderInterface<R> {
public:
MockClientAsyncReader() = default;
- // ClientAsyncStreamingInterface
+ /// ClientAsyncStreamingInterface
MOCK_METHOD1_T(ReadInitialMetadata, void(void*));
MOCK_METHOD2_T(Finish, void(Status*, void*));
- // AsyncReaderInterface
+ /// AsyncReaderInterface
MOCK_METHOD2_T(Read, void(R*, void*));
};
@@ -126,14 +126,14 @@ class MockClientAsyncWriter : public ClientAsyncWriterInterface<W> {
public:
MockClientAsyncWriter() = default;
- // ClientAsyncStreamingInterface
+ /// ClientAsyncStreamingInterface
MOCK_METHOD1_T(ReadInitialMetadata, void(void*));
MOCK_METHOD2_T(Finish, void(Status*, void*));
- // AsyncWriterInterface
+ /// AsyncWriterInterface
MOCK_METHOD2_T(Write, void(const W&, void*));
- // ClientAsyncWriterInterface
+ /// ClientAsyncWriterInterface
MOCK_METHOD1_T(WritesDone, void(void*));
};
@@ -143,17 +143,17 @@ class MockClientAsyncReaderWriter
public:
MockClientAsyncReaderWriter() = default;
- // ClientAsyncStreamingInterface
+ /// ClientAsyncStreamingInterface
MOCK_METHOD1_T(ReadInitialMetadata, void(void*));
MOCK_METHOD2_T(Finish, void(Status*, void*));
- // AsyncWriterInterface
+ /// AsyncWriterInterface
MOCK_METHOD2_T(Write, void(const W&, void*));
- // AsyncReaderInterface
+ /// AsyncReaderInterface
MOCK_METHOD2_T(Read, void(R*, void*));
- // ClientAsyncReaderWriterInterface
+ /// ClientAsyncReaderWriterInterface
MOCK_METHOD1_T(WritesDone, void(void*));
};
diff --git a/include/grpc++/test/server_context_test_spouse.h b/include/grpc++/test/server_context_test_spouse.h
index bac0db7bdc..5bd07e7aec 100644
--- a/include/grpc++/test/server_context_test_spouse.h
+++ b/include/grpc++/test/server_context_test_spouse.h
@@ -41,13 +41,13 @@
namespace grpc {
namespace testing {
-// A test-only class to access private members and methods of ServerContext.
+/// A test-only class to access private members and methods of ServerContext.
class ServerContextTestSpouse {
public:
explicit ServerContextTestSpouse(ServerContext* ctx) : ctx_(ctx) {}
- // Inject client metadata to the ServerContext for the test. The test spouse
- // must be alive when ServerContext::client_metadata is called.
+ /// Inject client metadata to the ServerContext for the test. The test spouse
+ /// must be alive when ServerContext::client_metadata is called.
void AddClientMetadata(const grpc::string& key, const grpc::string& value) {
client_metadata_storage_.insert(
std::pair<grpc::string, grpc::string>(key, value));
@@ -70,7 +70,7 @@ class ServerContextTestSpouse {
}
private:
- ServerContext* ctx_; // not owned
+ ServerContext* ctx_; /// not owned
std::multimap<grpc::string, grpc::string> client_metadata_storage_;
};