Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-31 10:11:55

0001 // Protocol Buffers - Google's data interchange format
0002 // Copyright 2008 Google Inc.  All rights reserved.
0003 //
0004 // Use of this source code is governed by a BSD-style
0005 // license that can be found in the LICENSE file or at
0006 // https://developers.google.com/open-source/licenses/bsd
0007 
0008 #ifndef GOOGLE_PROTOBUF_COMPILER_CPP_FIELD_GENERATORS_GENERATORS_H__
0009 #define GOOGLE_PROTOBUF_COMPILER_CPP_FIELD_GENERATORS_GENERATORS_H__
0010 
0011 #include <memory>
0012 
0013 #include "google/protobuf/compiler/cpp/field.h"
0014 #include "google/protobuf/compiler/cpp/helpers.h"
0015 #include "google/protobuf/compiler/cpp/options.h"
0016 #include "google/protobuf/descriptor.h"
0017 
0018 // The functions in this file construct FieldGeneratorBase objects for
0019 // generating different "codegen types" of fields. The logic for selecting the
0020 // correct choice of generator lives in compiler/cpp/field.cc; this is merely
0021 // the API that file uses for constructing generators.
0022 //
0023 // Functions are of the form `Make<card><kind>Generator()`, where <card> is
0024 // `Singular`, `Repeated`, or `Oneof`, and <kind> is the field type, plus
0025 // `MakeMapGenerator()`, since map fields are always repeated message fields.
0026 //
0027 // The returned pointers are never null.
0028 
0029 namespace google {
0030 namespace protobuf {
0031 namespace compiler {
0032 namespace cpp {
0033 std::unique_ptr<FieldGeneratorBase> MakeSinguarPrimitiveGenerator(
0034     const FieldDescriptor* desc, const Options& options,
0035     MessageSCCAnalyzer* scc);
0036 
0037 std::unique_ptr<FieldGeneratorBase> MakeRepeatedPrimitiveGenerator(
0038     const FieldDescriptor* desc, const Options& options,
0039     MessageSCCAnalyzer* scc);
0040 
0041 std::unique_ptr<FieldGeneratorBase> MakeSinguarEnumGenerator(
0042     const FieldDescriptor* desc, const Options& options,
0043     MessageSCCAnalyzer* scc);
0044 
0045 std::unique_ptr<FieldGeneratorBase> MakeRepeatedEnumGenerator(
0046     const FieldDescriptor* desc, const Options& options,
0047     MessageSCCAnalyzer* scc);
0048 
0049 std::unique_ptr<FieldGeneratorBase> MakeSinguarStringGenerator(
0050     const FieldDescriptor* desc, const Options& options,
0051     MessageSCCAnalyzer* scc);
0052 
0053 std::unique_ptr<FieldGeneratorBase> MakeRepeatedStringGenerator(
0054     const FieldDescriptor* desc, const Options& options,
0055     MessageSCCAnalyzer* scc);
0056 
0057 std::unique_ptr<FieldGeneratorBase> MakeSingularStringViewGenerator(
0058     const FieldDescriptor* desc, const Options& options,
0059     MessageSCCAnalyzer* scc);
0060 
0061 std::unique_ptr<FieldGeneratorBase> MakeRepeatedStringViewGenerator(
0062     const FieldDescriptor* desc, const Options& options,
0063     MessageSCCAnalyzer* scc);
0064 
0065 std::unique_ptr<FieldGeneratorBase> MakeSinguarMessageGenerator(
0066     const FieldDescriptor* desc, const Options& options,
0067     MessageSCCAnalyzer* scc);
0068 
0069 std::unique_ptr<FieldGeneratorBase> MakeRepeatedMessageGenerator(
0070     const FieldDescriptor* desc, const Options& options,
0071     MessageSCCAnalyzer* scc);
0072 
0073 std::unique_ptr<FieldGeneratorBase> MakeOneofMessageGenerator(
0074     const FieldDescriptor* desc, const Options& options,
0075     MessageSCCAnalyzer* scc);
0076 
0077 std::unique_ptr<FieldGeneratorBase> MakeMapGenerator(
0078     const FieldDescriptor* desc, const Options& options,
0079     MessageSCCAnalyzer* scc);
0080 
0081 std::unique_ptr<FieldGeneratorBase> MakeSingularCordGenerator(
0082     const FieldDescriptor* desc, const Options& options,
0083     MessageSCCAnalyzer* scc);
0084 
0085 std::unique_ptr<FieldGeneratorBase> MakeOneofCordGenerator(
0086     const FieldDescriptor* desc, const Options& options,
0087     MessageSCCAnalyzer* scc);
0088 
0089 }  // namespace cpp
0090 }  // namespace compiler
0091 }  // namespace protobuf
0092 }  // namespace google
0093 
0094 #endif  // GOOGLE_PROTOBUF_COMPILER_CPP_FIELD_GENERATORS_GENERATORS_H__