diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/grpc++/client_context.h | 6 | ||||
-rw-r--r-- | include/grpc/census.h | 4 |
2 files changed, 10 insertions, 0 deletions
diff --git a/include/grpc++/client_context.h b/include/grpc++/client_context.h index 5e10875260..4d96d862e7 100644 --- a/include/grpc++/client_context.h +++ b/include/grpc++/client_context.h @@ -46,6 +46,7 @@ struct grpc_call; struct grpc_completion_queue; +struct census_context; namespace grpc { @@ -107,6 +108,10 @@ class ClientContext { creds_ = creds; } + // Get and set census context + void set_census_context(census_context* ccp) { census_context_ = ccp; } + census_context* get_census_context() const { return census_context_; } + void TryCancel(); private: @@ -154,6 +159,7 @@ class ClientContext { gpr_timespec deadline_; grpc::string authority_; std::shared_ptr<Credentials> creds_; + census_context* census_context_; std::multimap<grpc::string, grpc::string> send_initial_metadata_; std::multimap<grpc::string, grpc::string> recv_initial_metadata_; std::multimap<grpc::string, grpc::string> trailing_metadata_; diff --git a/include/grpc/census.h b/include/grpc/census.h index b2049b3289..3fc07affc8 100644 --- a/include/grpc/census.h +++ b/include/grpc/census.h @@ -61,6 +61,10 @@ enum census_functions { int census_initialize(int functions); void census_shutdown(); +/* If any census feature has been initialized, this funtion will return a + * non-zero value. */ +int census_available(); + /* Internally, Census relies on a context, which should be propagated across * RPC's. From the RPC subsystems viewpoint, this is an opaque data structure. * A context must be used as the first argument to all other census |