summaryrefslogtreecommitdiffstats
path: root/contrib/libs/protoc/src/google/protobuf/compiler/cpp/service.h
diff options
context:
space:
mode:
authornechda <[email protected]>2024-08-29 23:50:27 +0300
committernechda <[email protected]>2024-08-30 00:05:25 +0300
commite10d6638f07a82edae3ea8197b9f5c0affcc07ea (patch)
tree571c38cec05813766a1ad290c9d51ce7ace52919 /contrib/libs/protoc/src/google/protobuf/compiler/cpp/service.h
parente79b38f2bbbf78d295d1901d2a79f898022d5224 (diff)
Update cpp-protobuf to 22.5
Привет!\ Этот PR переключат cpp & python библиотеки protobuf на версию 22.5 Если у вас возникли проблемы после влития этого PR: 1. Если начали падать канон тесты, то проведите их переканонизацию 2. Прочитайте <https://wiki.yandex-team.ru/users/nechda/obnovlenie-cpp-protobuf-22.5/> страничку с основными изменениями 3. Если страничка в вики не помогла, то пишите в [DEVTOOLSSUPPORT](https://st.yandex-team.ru/DEVTOOLSSUPPORT) 7fecade616c20a841b9e9af7b7998bdfc8d2807d
Diffstat (limited to 'contrib/libs/protoc/src/google/protobuf/compiler/cpp/service.h')
-rw-r--r--contrib/libs/protoc/src/google/protobuf/compiler/cpp/service.h64
1 files changed, 27 insertions, 37 deletions
diff --git a/contrib/libs/protoc/src/google/protobuf/compiler/cpp/service.h b/contrib/libs/protoc/src/google/protobuf/compiler/cpp/service.h
index 56982cf566b..183a4ecb1c8 100644
--- a/contrib/libs/protoc/src/google/protobuf/compiler/cpp/service.h
+++ b/contrib/libs/protoc/src/google/protobuf/compiler/cpp/service.h
@@ -35,63 +35,52 @@
#ifndef GOOGLE_PROTOBUF_COMPILER_CPP_SERVICE_H__
#define GOOGLE_PROTOBUF_COMPILER_CPP_SERVICE_H__
-#include <map>
#include <string>
-#include <google/protobuf/descriptor.h>
-#include <google/protobuf/compiler/cpp/options.h>
-
-namespace google {
-namespace protobuf {
-namespace io {
-class Printer; // printer.h
-}
-} // namespace protobuf
-} // namespace google
+#include "google/protobuf/descriptor.h"
+#include "y_absl/container/flat_hash_map.h"
+#include "google/protobuf/compiler/cpp/options.h"
+#include "google/protobuf/io/printer.h"
namespace google {
namespace protobuf {
namespace compiler {
namespace cpp {
-
class ServiceGenerator {
public:
// See generator.cc for the meaning of dllexport_decl.
- explicit ServiceGenerator(const ServiceDescriptor* descriptor,
- const std::map<TProtoStringType, TProtoStringType>& vars,
- const Options& options);
- ~ServiceGenerator();
-
- // Header stuff.
+ ServiceGenerator(
+ const ServiceDescriptor* descriptor,
+ const y_absl::flat_hash_map<y_absl::string_view, TProtoStringType>& vars,
+ const Options& options)
+ : descriptor_(descriptor), options_(&options), vars_(vars) {
+ vars_["classname"] = descriptor_->name();
+ vars_["full_name"] = descriptor_->full_name();
+ }
+
+ ServiceGenerator(const ServiceGenerator&) = delete;
+ ServiceGenerator& operator=(const ServiceGenerator&) = delete;
+ ServiceGenerator(ServiceGenerator&&) = delete;
+ ServiceGenerator& operator=(ServiceGenerator&&) = delete;
+
+ ~ServiceGenerator() = default;
// Generate the class definitions for the service's interface and the
// stub implementation.
void GenerateDeclarations(io::Printer* printer);
- // Source file stuff.
-
// Generate implementations of everything declared by
// GenerateDeclarations().
void GenerateImplementation(io::Printer* printer);
private:
- enum RequestOrResponse { REQUEST, RESPONSE };
- enum VirtualOrNon { VIRTUAL, NON_VIRTUAL };
-
- // Header stuff.
-
- // Generate the service abstract interface.
- void GenerateInterface(io::Printer* printer);
-
- // Generate the stub class definition.
- void GenerateStubDefinition(io::Printer* printer);
+ enum RequestOrResponse { kRequest, kResponse };
+ enum VirtualOrNot { kVirtual, kNonVirtual };
// Prints signatures for all methods in the
- void GenerateMethodSignatures(VirtualOrNon virtual_or_non,
+ void GenerateMethodSignatures(VirtualOrNot virtual_or_not,
io::Printer* printer);
- // Source file stuff.
-
// Generate the default implementations of the service methods, which
// produce a "not implemented" error.
void GenerateNotImplementedMethods(io::Printer* printer);
@@ -102,19 +91,20 @@ class ServiceGenerator {
// Generate the Get{Request,Response}Prototype() methods.
void GenerateGetPrototype(RequestOrResponse which, io::Printer* printer);
+ // Generate the cases in CallMethod().
+ void GenerateCallMethodCases(io::Printer* printer);
+
// Generate the stub's implementations of the service methods.
void GenerateStubMethods(io::Printer* printer);
const ServiceDescriptor* descriptor_;
- std::map<TProtoStringType, TProtoStringType> vars_;
- const Options& options_;
+ const Options* options_;
+ y_absl::flat_hash_map<y_absl::string_view, TProtoStringType> vars_;
int index_in_metadata_;
friend class FileGenerator;
- GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(ServiceGenerator);
};
-
} // namespace cpp
} // namespace compiler
} // namespace protobuf