api change to string_ref

pull/3065/head
yang-g 9 years ago
parent d5539ec6e2
commit 1eeb21c4df
  1. 10
      include/grpc++/client_context.h
  2. 4
      include/grpc++/server_context.h

@ -138,12 +138,14 @@ class ClientContext {
void AddMetadata(const grpc::string& meta_key, void AddMetadata(const grpc::string& meta_key,
const grpc::string& meta_value); const grpc::string& meta_value);
const std::multimap<grpc::string, grpc::string>& GetServerInitialMetadata() { const std::multimap<grpc::string_ref, grpc::string_ref>&
GetServerInitialMetadata() {
GPR_ASSERT(initial_metadata_received_); GPR_ASSERT(initial_metadata_received_);
return recv_initial_metadata_; return recv_initial_metadata_;
} }
const std::multimap<grpc::string, grpc::string>& GetServerTrailingMetadata() { const std::multimap<grpc::string_ref, grpc::string_ref>&
GetServerTrailingMetadata() {
// TODO(yangg) check finished // TODO(yangg) check finished
return trailing_metadata_; return trailing_metadata_;
} }
@ -234,8 +236,8 @@ class ClientContext {
mutable std::shared_ptr<const AuthContext> auth_context_; mutable std::shared_ptr<const AuthContext> auth_context_;
struct census_context* census_context_; struct census_context* census_context_;
std::multimap<grpc::string, grpc::string> send_initial_metadata_; std::multimap<grpc::string, grpc::string> send_initial_metadata_;
std::multimap<grpc::string, grpc::string> recv_initial_metadata_; std::multimap<grpc::string_ref, grpc::string_ref> recv_initial_metadata_;
std::multimap<grpc::string, grpc::string> trailing_metadata_; std::multimap<grpc::string_ref, grpc::string_ref> trailing_metadata_;
grpc_call* propagate_from_call_; grpc_call* propagate_from_call_;
PropagationOptions propagation_options_; PropagationOptions propagation_options_;

@ -103,7 +103,7 @@ class ServerContext {
bool IsCancelled() const; bool IsCancelled() const;
const std::multimap<grpc::string, grpc::string>& client_metadata() { const std::multimap<grpc::string_ref, grpc::string_ref>& client_metadata() {
return client_metadata_; return client_metadata_;
} }
@ -185,7 +185,7 @@ class ServerContext {
CompletionQueue* cq_; CompletionQueue* cq_;
bool sent_initial_metadata_; bool sent_initial_metadata_;
mutable std::shared_ptr<const AuthContext> auth_context_; mutable std::shared_ptr<const AuthContext> auth_context_;
std::multimap<grpc::string, grpc::string> client_metadata_; std::multimap<grpc::string_ref, grpc::string_ref> client_metadata_;
std::multimap<grpc::string, grpc::string> initial_metadata_; std::multimap<grpc::string, grpc::string> initial_metadata_;
std::multimap<grpc::string, grpc::string> trailing_metadata_; std::multimap<grpc::string, grpc::string> trailing_metadata_;

Loading…
Cancel
Save