diff options
author | Adam Cozzette <acozzette@google.com> | 2017-09-12 10:32:01 -0700 |
---|---|---|
committer | Adam Cozzette <acozzette@google.com> | 2017-09-14 10:03:57 -0700 |
commit | 13fd045dbb2b4dacea32be162a41d5a4b0d1802f (patch) | |
tree | c219e7eb18b82523e36c6748861c403a14ea66ae /src/google/protobuf/compiler/cpp/cpp_message.h | |
parent | d1bc27caef8377a710370189675cb0958443e8f1 (diff) |
Integrated internal changes from Google
Diffstat (limited to 'src/google/protobuf/compiler/cpp/cpp_message.h')
-rw-r--r-- | src/google/protobuf/compiler/cpp/cpp_message.h | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/google/protobuf/compiler/cpp/cpp_message.h b/src/google/protobuf/compiler/cpp/cpp_message.h index 352069eb..cf64f483 100644 --- a/src/google/protobuf/compiler/cpp/cpp_message.h +++ b/src/google/protobuf/compiler/cpp/cpp_message.h @@ -43,6 +43,7 @@ #include <string> #include <google/protobuf/compiler/cpp/cpp_field.h> #include <google/protobuf/compiler/cpp/cpp_helpers.h> +#include <google/protobuf/compiler/cpp/cpp_message_layout_helper.h> #include <google/protobuf/compiler/cpp/cpp_options.h> namespace google { @@ -62,12 +63,10 @@ class ExtensionGenerator; // extension.h class MessageGenerator { public: // See generator.cc for the meaning of dllexport_decl. - MessageGenerator(const Descriptor* descriptor, const Options& options, - SCCAnalyzer* scc_analyzer); + MessageGenerator(const Descriptor* descriptor, int index_in_file_messages, + const Options& options, SCCAnalyzer* scc_analyzer); ~MessageGenerator(); - // Appends the pre-order walk of the nested generators to list. - void Flatten(std::vector<MessageGenerator*>* list); // Append the two types of nested generators to the corresponding vector. void AddGenerators(std::vector<EnumGenerator*>* enum_generators, std::vector<ExtensionGenerator*>* extension_generators); @@ -96,8 +95,8 @@ class MessageGenerator { // Generate extra fields void GenerateExtraDefaultFields(io::Printer* printer); - // Generates code that allocates the message's default instance. - void GenerateDefaultInstanceAllocator(io::Printer* printer); + // Generates code that creates default instances for fields. + void GenerateFieldDefaultInstances(io::Printer* printer); // Generates code that initializes the message's default instance. This // is separate from allocating because all default instances must be @@ -208,6 +207,7 @@ class MessageGenerator { std::vector<uint32> RequiredFieldsBitMask() const; const Descriptor* descriptor_; + int index_in_file_messages_; string classname_; Options options_; FieldGeneratorMap field_generators_; @@ -218,7 +218,6 @@ class MessageGenerator { std::vector<const FieldDescriptor *> optimized_order_; std::vector<int> has_bit_indices_; int max_has_bit_index_; - google::protobuf::scoped_array<google::protobuf::scoped_ptr<MessageGenerator> > nested_generators_; google::protobuf::scoped_array<google::protobuf::scoped_ptr<EnumGenerator> > enum_generators_; google::protobuf::scoped_array<google::protobuf::scoped_ptr<ExtensionGenerator> > extension_generators_; int num_required_fields_; @@ -227,9 +226,10 @@ class MessageGenerator { // table_driven_ indicates the generated message uses table-driven parsing. bool table_driven_; - int index_in_file_messages_; + google::protobuf::scoped_ptr<MessageLayoutHelper> message_layout_helper_; SCCAnalyzer* scc_analyzer_; + string scc_name_; friend class FileGenerator; GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(MessageGenerator); |