aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/libs/protoc/src/google/protobuf/compiler/java/context.h
diff options
context:
space:
mode:
authornechda <nechda@yandex-team.com>2024-08-29 23:50:27 +0300
committernechda <nechda@yandex-team.com>2024-08-30 00:05:25 +0300
commite10d6638f07a82edae3ea8197b9f5c0affcc07ea (patch)
tree571c38cec05813766a1ad290c9d51ce7ace52919 /contrib/libs/protoc/src/google/protobuf/compiler/java/context.h
parente79b38f2bbbf78d295d1901d2a79f898022d5224 (diff)
downloadydb-e10d6638f07a82edae3ea8197b9f5c0affcc07ea.tar.gz
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/java/context.h')
-rw-r--r--contrib/libs/protoc/src/google/protobuf/compiler/java/context.h28
1 files changed, 22 insertions, 6 deletions
diff --git a/contrib/libs/protoc/src/google/protobuf/compiler/java/context.h b/contrib/libs/protoc/src/google/protobuf/compiler/java/context.h
index c224ab73f5..57b994a8e3 100644
--- a/contrib/libs/protoc/src/google/protobuf/compiler/java/context.h
+++ b/contrib/libs/protoc/src/google/protobuf/compiler/java/context.h
@@ -31,12 +31,13 @@
#ifndef GOOGLE_PROTOBUF_COMPILER_JAVA_CONTEXT_H__
#define GOOGLE_PROTOBUF_COMPILER_JAVA_CONTEXT_H__
-#include <map>
#include <memory>
#include <vector>
-#include <google/protobuf/stubs/common.h>
-#include <google/protobuf/compiler/java/options.h>
+#include "y_absl/container/flat_hash_map.h"
+#include "google/protobuf/compiler/java/helpers.h"
+#include "google/protobuf/compiler/java/options.h"
+#include "google/protobuf/port.h"
namespace google {
namespace protobuf {
@@ -65,6 +66,8 @@ struct OneofGeneratorInfo;
class Context {
public:
Context(const FileDescriptor* file, const Options& options);
+ Context(const Context&) = delete;
+ Context& operator=(const Context&) = delete;
~Context();
// Get the name resolver associated with this context. The resolver
@@ -97,14 +100,27 @@ class Context {
const std::vector<const FieldDescriptor*>& fields);
std::unique_ptr<ClassNameResolver> name_resolver_;
- std::map<const FieldDescriptor*, FieldGeneratorInfo>
+ y_absl::flat_hash_map<const FieldDescriptor*, FieldGeneratorInfo>
field_generator_info_map_;
- std::map<const OneofDescriptor*, OneofGeneratorInfo>
+ y_absl::flat_hash_map<const OneofDescriptor*, OneofGeneratorInfo>
oneof_generator_info_map_;
Options options_;
- GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(Context);
};
+template <typename Descriptor>
+void MaybePrintGeneratedAnnotation(Context* context, io::Printer* printer,
+ Descriptor* descriptor, bool immutable,
+ const TProtoStringType& suffix = "") {
+ if (IsOwnFile(descriptor, immutable)) {
+ PrintGeneratedAnnotation(printer, '$',
+ context->options().annotate_code
+ ? AnnotationFileName(descriptor, suffix)
+ : "",
+ context->options());
+ }
+}
+
+
} // namespace java
} // namespace compiler
} // namespace protobuf