Back to home page

EIC code displayed by LXR

 
 

    


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

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 // Author: rennie@google.com (Jeffrey Rennie)
0009 
0010 #ifndef GOOGLE_PROTOBUF_COMPILER_CPP_OPTIONS_H__
0011 #define GOOGLE_PROTOBUF_COMPILER_CPP_OPTIONS_H__
0012 
0013 #include <string>
0014 
0015 #include "absl/container/flat_hash_set.h"
0016 
0017 namespace google {
0018 namespace protobuf {
0019 namespace compiler {
0020 class AccessInfoMap;
0021 class SplitMap;
0022 
0023 namespace cpp {
0024 
0025 enum class EnforceOptimizeMode {
0026   kNoEnforcement,  // Use the runtime specified by the file specific options.
0027   kSpeed,          // Full runtime with a generated code implementation.
0028   kCodeSize,       // Full runtime with a reflective implementation.
0029   kLiteRuntime,
0030 };
0031 
0032 struct FieldListenerOptions {
0033   bool inject_field_listener_events = false;
0034   absl::flat_hash_set<std::string> forbidden_field_listener_events;
0035 };
0036 
0037 // Generator options (see generator.cc for a description of each):
0038 struct Options {
0039   const AccessInfoMap* access_info_map = nullptr;
0040   const SplitMap* split_map = nullptr;
0041   std::string dllexport_decl;
0042   std::string runtime_include_base;
0043   std::string annotation_pragma_name;
0044   std::string annotation_guard_name;
0045   FieldListenerOptions field_listener_options;
0046   EnforceOptimizeMode enforce_mode = EnforceOptimizeMode::kNoEnforcement;
0047   int num_cc_files = 0;
0048   bool safe_boundary_check = false;
0049   bool proto_h = false;
0050   bool transitive_pb_h = true;
0051   bool annotate_headers = false;
0052   bool lite_implicit_weak_fields = false;
0053   bool descriptor_implicit_weak_messages = false;
0054   bool bootstrap = false;
0055   bool opensource_runtime = false;
0056   bool annotate_accessor = false;
0057   bool force_split = false;
0058   // TODO: clean this up after the change is rolled out for 2
0059   // weeks.
0060   bool profile_driven_cluster_aux_subtable = true;
0061 #ifdef PROTOBUF_STABLE_EXPERIMENTS
0062   bool force_eagerly_verified_lazy = true;
0063   bool force_inline_string = true;
0064 #else   // PROTOBUF_STABLE_EXPERIMENTS
0065   bool force_eagerly_verified_lazy = false;
0066   bool force_inline_string = false;
0067 #endif  // !PROTOBUF_STABLE_EXPERIMENTS
0068   bool strip_nonfunctional_codegen = false;
0069 };
0070 
0071 }  // namespace cpp
0072 }  // namespace compiler
0073 }  // namespace protobuf
0074 }  // namespace google
0075 
0076 #endif  // GOOGLE_PROTOBUF_COMPILER_CPP_OPTIONS_H__