diff options
author | Craig Tiller <ctiller@google.com> | 2015-08-18 12:51:05 -0700 |
---|---|---|
committer | Craig Tiller <ctiller@google.com> | 2015-08-18 12:51:05 -0700 |
commit | 128f4a9cfe34825543dab4e29c875b59af40e666 (patch) | |
tree | 323e79e6d7dd98ef6aa23f93ec20736d10abd9ce /include/grpc++ | |
parent | f2066040d2568e6ae90f6690fab91c63cd17fd6b (diff) | |
parent | 4f21d3549c8f652a152ae086a74dd8415ecca8fa (diff) |
Merge github.com:grpc/grpc into y12kdm3
Diffstat (limited to 'include/grpc++')
-rw-r--r-- | include/grpc++/async_unary_call.h | 4 | ||||
-rw-r--r-- | include/grpc++/auth_context.h | 2 | ||||
-rw-r--r-- | include/grpc++/byte_buffer.h | 4 | ||||
-rw-r--r-- | include/grpc++/client_context.h | 9 | ||||
-rw-r--r-- | include/grpc++/dynamic_thread_pool.h | 9 | ||||
-rw-r--r-- | include/grpc++/generic_stub.h | 4 | ||||
-rw-r--r-- | include/grpc++/impl/grpc_library.h | 1 | ||||
-rw-r--r-- | include/grpc++/impl/serialization_traits.h | 6 | ||||
-rw-r--r-- | include/grpc++/impl/sync_no_cxx11.h | 8 | ||||
-rw-r--r-- | include/grpc++/impl/thd_no_cxx11.h | 21 | ||||
-rw-r--r-- | include/grpc++/server_context.h | 4 |
11 files changed, 42 insertions, 30 deletions
diff --git a/include/grpc++/async_unary_call.h b/include/grpc++/async_unary_call.h index d631ccd134..3d22df4b33 100644 --- a/include/grpc++/async_unary_call.h +++ b/include/grpc++/async_unary_call.h @@ -121,8 +121,8 @@ class ServerAsyncResponseWriter GRPC_FINAL } // The response is dropped if the status is not OK. if (status.ok()) { - finish_buf_.ServerSendStatus( - ctx_->trailing_metadata_, finish_buf_.SendMessage(msg)); + finish_buf_.ServerSendStatus(ctx_->trailing_metadata_, + finish_buf_.SendMessage(msg)); } else { finish_buf_.ServerSendStatus(ctx_->trailing_metadata_, status); } diff --git a/include/grpc++/auth_context.h b/include/grpc++/auth_context.h index f8ea8ad6f4..7dced90ce5 100644 --- a/include/grpc++/auth_context.h +++ b/include/grpc++/auth_context.h @@ -62,6 +62,7 @@ class AuthPropertyIterator AuthPropertyIterator(); AuthPropertyIterator(const grpc_auth_property* property, const grpc_auth_property_iterator* iter); + private: friend class SecureAuthContext; const grpc_auth_property* property_; @@ -92,4 +93,3 @@ class AuthContext { } // namespace grpc #endif // GRPCXX_AUTH_CONTEXT_H - diff --git a/include/grpc++/byte_buffer.h b/include/grpc++/byte_buffer.h index cb3c6a1159..6467776398 100644 --- a/include/grpc++/byte_buffer.h +++ b/include/grpc++/byte_buffer.h @@ -91,8 +91,8 @@ class SerializationTraits<ByteBuffer, void> { dest->set_buffer(byte_buffer); return Status::OK; } - static Status Serialize(const ByteBuffer& source, grpc_byte_buffer** buffer, - bool* own_buffer) { + static Status Serialize(const ByteBuffer& source, grpc_byte_buffer** buffer, + bool* own_buffer) { *buffer = source.buffer(); *own_buffer = false; return Status::OK; diff --git a/include/grpc++/client_context.h b/include/grpc++/client_context.h index d7fafac9b3..8de2ba4877 100644 --- a/include/grpc++/client_context.h +++ b/include/grpc++/client_context.h @@ -121,6 +121,10 @@ class PropagationOptions { gpr_uint32 propagate_; }; +namespace testing { +class InteropClientContextInspector; +} // namespace testing + class ClientContext { public: ClientContext(); @@ -181,7 +185,9 @@ class ClientContext { // Get and set census context void set_census_context(struct census_context* ccp) { census_context_ = ccp; } - struct census_context* census_context() const { return census_context_; } + struct census_context* census_context() const { + return census_context_; + } void TryCancel(); @@ -190,6 +196,7 @@ class ClientContext { ClientContext(const ClientContext&); ClientContext& operator=(const ClientContext&); + friend class ::grpc::testing::InteropClientContextInspector; friend class CallOpClientRecvStatus; friend class CallOpRecvInitialMetadata; friend class Channel; diff --git a/include/grpc++/dynamic_thread_pool.h b/include/grpc++/dynamic_thread_pool.h index f0cd35940f..a4d4885b51 100644 --- a/include/grpc++/dynamic_thread_pool.h +++ b/include/grpc++/dynamic_thread_pool.h @@ -55,11 +55,12 @@ class DynamicThreadPool GRPC_FINAL : public ThreadPoolInterface { private: class DynamicThread { - public: - DynamicThread(DynamicThreadPool *pool); + public: + DynamicThread(DynamicThreadPool* pool); ~DynamicThread(); - private: - DynamicThreadPool *pool_; + + private: + DynamicThreadPool* pool_; std::unique_ptr<grpc::thread> thd_; void ThreadFunc(); }; diff --git a/include/grpc++/generic_stub.h b/include/grpc++/generic_stub.h index c34e1fcf55..172f10e45a 100644 --- a/include/grpc++/generic_stub.h +++ b/include/grpc++/generic_stub.h @@ -52,8 +52,8 @@ class GenericStub GRPC_FINAL { // begin a call to a named method std::unique_ptr<GenericClientAsyncReaderWriter> Call( - ClientContext* context, const grpc::string& method, - CompletionQueue* cq, void* tag); + ClientContext* context, const grpc::string& method, CompletionQueue* cq, + void* tag); private: std::shared_ptr<ChannelInterface> channel_; diff --git a/include/grpc++/impl/grpc_library.h b/include/grpc++/impl/grpc_library.h index f9fa677901..ce4211418d 100644 --- a/include/grpc++/impl/grpc_library.h +++ b/include/grpc++/impl/grpc_library.h @@ -46,5 +46,4 @@ class GrpcLibrary { } // namespace grpc - #endif // GRPCXX_IMPL_GRPC_LIBRARY_H diff --git a/include/grpc++/impl/serialization_traits.h b/include/grpc++/impl/serialization_traits.h index 1f5c674e4c..3ea66a3405 100644 --- a/include/grpc++/impl/serialization_traits.h +++ b/include/grpc++/impl/serialization_traits.h @@ -37,12 +37,12 @@ namespace grpc { /// Defines how to serialize and deserialize some type. -/// +/// /// Used for hooking different message serialization API's into GRPC. /// Each SerializationTraits implementation must provide the following /// functions: /// static Status Serialize(const Message& msg, -/// grpc_byte_buffer** buffer, +/// grpc_byte_buffer** buffer, // bool* own_buffer); /// static Status Deserialize(grpc_byte_buffer* buffer, /// Message* msg, @@ -57,7 +57,7 @@ namespace grpc { /// msg. max_message_size is passed in as a bound on the maximum number of /// message bytes Deserialize should accept. /// -/// Both functions return a Status, allowing them to explain what went +/// Both functions return a Status, allowing them to explain what went /// wrong if required. template <class Message, class UnusedButHereForPartialTemplateSpecialization = void> diff --git a/include/grpc++/impl/sync_no_cxx11.h b/include/grpc++/impl/sync_no_cxx11.h index 5869b04c76..120a031045 100644 --- a/include/grpc++/impl/sync_no_cxx11.h +++ b/include/grpc++/impl/sync_no_cxx11.h @@ -38,7 +38,7 @@ namespace grpc { -template<class mutex> +template <class mutex> class lock_guard; class condition_variable; @@ -46,6 +46,7 @@ class mutex { public: mutex() { gpr_mu_init(&mu_); } ~mutex() { gpr_mu_destroy(&mu_); } + private: ::gpr_mu mu_; template <class mutex> @@ -58,6 +59,7 @@ class lock_guard { public: lock_guard(mutex &mu) : mu_(mu), locked(true) { gpr_mu_lock(&mu.mu_); } ~lock_guard() { unlock_internal(); } + protected: void lock_internal() { if (!locked) gpr_mu_lock(&mu_.mu_); @@ -67,6 +69,7 @@ class lock_guard { if (locked) gpr_mu_unlock(&mu_.mu_); locked = false; } + private: mutex &mu_; bool locked; @@ -76,7 +79,7 @@ class lock_guard { template <class mutex> class unique_lock : public lock_guard<mutex> { public: - unique_lock(mutex &mu) : lock_guard<mutex>(mu) { } + unique_lock(mutex &mu) : lock_guard<mutex>(mu) {} void lock() { this->lock_internal(); } void unlock() { this->unlock_internal(); } }; @@ -92,6 +95,7 @@ class condition_variable { } void notify_one() { gpr_cv_signal(&cv_); } void notify_all() { gpr_cv_broadcast(&cv_); } + private: gpr_cv cv_; }; diff --git a/include/grpc++/impl/thd_no_cxx11.h b/include/grpc++/impl/thd_no_cxx11.h index a6bdd7dfe9..84d03ce184 100644 --- a/include/grpc++/impl/thd_no_cxx11.h +++ b/include/grpc++/impl/thd_no_cxx11.h @@ -40,7 +40,8 @@ namespace grpc { class thread { public: - template<class T> thread(void (T::*fptr)(), T *obj) { + template <class T> + thread(void (T::*fptr)(), T *obj) { func_ = new thread_function<T>(fptr, obj); joined_ = false; start(); @@ -53,28 +54,28 @@ class thread { gpr_thd_join(thd_); joined_ = true; } + private: void start() { gpr_thd_options options = gpr_thd_options_default(); gpr_thd_options_set_joinable(&options); - gpr_thd_new(&thd_, thread_func, (void *) func_, &options); + gpr_thd_new(&thd_, thread_func, (void *)func_, &options); } static void thread_func(void *arg) { - thread_function_base *func = (thread_function_base *) arg; + thread_function_base *func = (thread_function_base *)arg; func->call(); } class thread_function_base { public: - virtual ~thread_function_base() { } + virtual ~thread_function_base() {} virtual void call() = 0; }; - template<class T> + template <class T> class thread_function : public thread_function_base { public: - thread_function(void (T::*fptr)(), T *obj) - : fptr_(fptr) - , obj_(obj) { } + thread_function(void (T::*fptr)(), T *obj) : fptr_(fptr), obj_(obj) {} virtual void call() { (obj_->*fptr_)(); } + private: void (T::*fptr_)(); T *obj_; @@ -84,8 +85,8 @@ class thread { bool joined_; // Disallow copy and assign. - thread(const thread&); - void operator=(const thread&); + thread(const thread &); + void operator=(const thread &); }; } // namespace grpc diff --git a/include/grpc++/server_context.h b/include/grpc++/server_context.h index 8262dee654..b87a1f0379 100644 --- a/include/grpc++/server_context.h +++ b/include/grpc++/server_context.h @@ -81,7 +81,7 @@ class CompletionQueue; class Server; namespace testing { -class InteropContextInspector; +class InteropServerContextInspector; } // namespace testing // Interface of server side rpc context. @@ -136,7 +136,7 @@ class ServerContext { } private: - friend class ::grpc::testing::InteropContextInspector; + friend class ::grpc::testing::InteropServerContextInspector; friend class ::grpc::Server; template <class W, class R> friend class ::grpc::ServerAsyncReader; |