diff options
Diffstat (limited to 'include/grpc++/impl/grpc_library.h')
-rw-r--r-- | include/grpc++/impl/grpc_library.h | 45 |
1 files changed, 6 insertions, 39 deletions
diff --git a/include/grpc++/impl/grpc_library.h b/include/grpc++/impl/grpc_library.h index 55c867ddff..f34a281ac3 100644 --- a/include/grpc++/impl/grpc_library.h +++ b/include/grpc++/impl/grpc_library.h @@ -1,6 +1,6 @@ /* * - * Copyright 2015 gRPC authors. + * Copyright 2018 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,46 +16,13 @@ * */ +// DEPRECATED: The headers in include/grpc++ are deprecated. Please include the +// headers in include/grpcpp instead. This header exists only for backwards +// compatibility. + #ifndef GRPCXX_IMPL_GRPC_LIBRARY_H #define GRPCXX_IMPL_GRPC_LIBRARY_H -#include <iostream> - -#include <grpc++/impl/codegen/config.h> -#include <grpc++/impl/codegen/core_codegen.h> -#include <grpc++/impl/codegen/grpc_library.h> -#include <grpc/grpc.h> - -namespace grpc { - -namespace internal { -class GrpcLibrary final : public GrpcLibraryInterface { - public: - void init() override { grpc_init(); } - void shutdown() override { grpc_shutdown(); } -}; - -static GrpcLibrary g_gli; -static CoreCodegen g_core_codegen; - -/// Instantiating this class ensures the proper initialization of gRPC. -class GrpcLibraryInitializer final { - public: - GrpcLibraryInitializer() { - if (grpc::g_glip == nullptr) { - grpc::g_glip = &g_gli; - } - if (grpc::g_core_codegen_interface == nullptr) { - grpc::g_core_codegen_interface = &g_core_codegen; - } - } - - /// A no-op method to force the linker to reference this class, which will - /// take care of initializing and shutting down the gRPC runtime. - int summon() { return 0; } -}; - -} // namespace internal -} // namespace grpc +#include <grpcpp/impl/grpc_library.h> #endif // GRPCXX_IMPL_GRPC_LIBRARY_H |