summaryrefslogtreecommitdiffstats
path: root/contrib/libs/protoc/src/google/protobuf/compiler/cpp/enum.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/enum.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/enum.h')
-rw-r--r--contrib/libs/protoc/src/google/protobuf/compiler/cpp/enum.h57
1 files changed, 27 insertions, 30 deletions
diff --git a/contrib/libs/protoc/src/google/protobuf/compiler/cpp/enum.h b/contrib/libs/protoc/src/google/protobuf/compiler/cpp/enum.h
index 550f43b1ed4..58a62f5533a 100644
--- a/contrib/libs/protoc/src/google/protobuf/compiler/cpp/enum.h
+++ b/contrib/libs/protoc/src/google/protobuf/compiler/cpp/enum.h
@@ -35,67 +35,64 @@
#ifndef GOOGLE_PROTOBUF_COMPILER_CPP_ENUM_H__
#define GOOGLE_PROTOBUF_COMPILER_CPP_ENUM_H__
-#include <map>
-#include <set>
#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 "google/protobuf/compiler/cpp/options.h"
+#include "google/protobuf/io/printer.h"
namespace google {
namespace protobuf {
namespace compiler {
namespace cpp {
-
class EnumGenerator {
public:
- // See generator.cc for the meaning of dllexport_decl.
- EnumGenerator(const EnumDescriptor* descriptor,
- const std::map<TProtoStringType, TProtoStringType>& vars,
- const Options& options);
- ~EnumGenerator();
+ EnumGenerator(const EnumDescriptor* descriptor, const Options& options);
+
+ EnumGenerator(const EnumGenerator&) = delete;
+ EnumGenerator& operator=(const EnumGenerator&) = delete;
+
+ ~EnumGenerator() = default;
// Generate header code defining the enum. This code should be placed
// within the enum's package namespace, but NOT within any class, even for
// nested enums.
- void GenerateDefinition(io::Printer* printer);
+ void GenerateDefinition(io::Printer* p);
// Generate specialization of GetEnumDescriptor<MyEnum>().
// Precondition: in ::google::protobuf namespace.
- void GenerateGetEnumDescriptorSpecializations(io::Printer* printer);
+ void GenerateGetEnumDescriptorSpecializations(io::Printer* p);
// For enums nested within a message, generate code to import all the enum's
// symbols (e.g. the enum type name, all its values, etc.) into the class's
// namespace. This should be placed inside the class definition in the
// header.
- void GenerateSymbolImports(io::Printer* printer) const;
+ void GenerateSymbolImports(io::Printer* p) const;
// Source file stuff.
// Generate non-inline methods related to the enum, such as IsValidValue().
// Goes in the .cc file. EnumDescriptors are stored in an array, idx is
// the index in this array that corresponds with this enum.
- void GenerateMethods(int idx, io::Printer* printer);
+ void GenerateMethods(int idx, io::Printer* p);
private:
- const EnumDescriptor* descriptor_;
- const TProtoStringType classname_;
- const Options& options_;
- // whether to generate the *_ARRAYSIZE constant.
- const bool generate_array_size_;
+ friend class FileGenerator;
- std::map<TProtoStringType, TProtoStringType> variables_;
+ struct ValueLimits {
+ const EnumValueDescriptor* min;
+ const EnumValueDescriptor* max;
- friend class FileGenerator;
- GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(EnumGenerator);
+ static ValueLimits FromEnum(const EnumDescriptor* descriptor);
+ };
+
+ const EnumDescriptor* enum_;
+ Options options_;
+
+ bool generate_array_size_;
+ bool should_cache_;
+ bool has_reflection_;
+ ValueLimits limits_;
};
} // namespace cpp