aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/grpc++/impl/codegen/grpc_library.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/grpc++/impl/codegen/grpc_library.h')
-rw-r--r--include/grpc++/impl/codegen/grpc_library.h22
1 files changed, 13 insertions, 9 deletions
diff --git a/include/grpc++/impl/codegen/grpc_library.h b/include/grpc++/impl/codegen/grpc_library.h
index 593785f43f..3cdc6f3f7c 100644
--- a/include/grpc++/impl/codegen/grpc_library.h
+++ b/include/grpc++/impl/codegen/grpc_library.h
@@ -34,6 +34,7 @@
#ifndef GRPCXX_IMPL_CODEGEN_GRPC_LIBRARY_H
#define GRPCXX_IMPL_CODEGEN_GRPC_LIBRARY_H
+#include <grpc++/impl/codegen/core_codegen_interface.h>
#include <grpc/impl/codegen/log.h>
namespace grpc {
@@ -44,20 +45,23 @@ class GrpcLibraryInterface {
virtual void shutdown() = 0;
};
+/// Initialized by \a grpc::GrpcLibraryInitializer from
+/// <grpc++/impl/grpc_library.h>
extern GrpcLibraryInterface* g_glip;
-class GrpcLibrary {
+/// Classes that require gRPC to be initialized should inherit from this class.
+class GrpcLibraryCodegen {
public:
- GrpcLibrary() {
- GPR_ASSERT(g_glip &&
- "gRPC library not initialized. See "
- "grpc::internal::GrpcLibraryInitializer.");
+ GrpcLibraryCodegen() {
+ GPR_CODEGEN_ASSERT(g_glip &&
+ "gRPC library not initialized. See "
+ "grpc::internal::GrpcLibraryInitializer.");
g_glip->init();
}
- virtual ~GrpcLibrary() {
- GPR_ASSERT(g_glip &&
- "gRPC library not initialized. See "
- "grpc::internal::GrpcLibraryInitializer.");
+ virtual ~GrpcLibraryCodegen() {
+ GPR_CODEGEN_ASSERT(g_glip &&
+ "gRPC library not initialized. See "
+ "grpc::internal::GrpcLibraryInitializer.");
g_glip->shutdown();
}
};