Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-19 09:23:19

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 #include "google/protobuf/port.h"
0017 
0018 namespace google {
0019 namespace protobuf {
0020 namespace compiler {
0021 class AccessInfoMap;
0022 class SplitMap;
0023 
0024 namespace cpp {
0025 
0026 enum class EnforceOptimizeMode {
0027   kNoEnforcement,  // Use the runtime specified by the file specific options.
0028   kSpeed,          // Full runtime with a generated code implementation.
0029   kCodeSize,       // Full runtime with a reflective implementation.
0030   kLiteRuntime,
0031 };
0032 
0033 enum class BoundsCheckMode {
0034   kNoEnforcement,       // No enforcement.
0035   kReturnDefaultValue,  // Return default value if out of bounds.
0036   kAbort,               // TrapOrAbort if out of bounds.
0037 };
0038 
0039 struct FieldListenerOptions {
0040   bool inject_field_listener_events = false;
0041   absl::flat_hash_set<std::string> forbidden_field_listener_events;
0042 };
0043 
0044 // Generator options (see generator.cc for a description of each):
0045 struct Options {
0046   const AccessInfoMap* access_info_map = nullptr;
0047   const SplitMap* split_map = nullptr;
0048   std::string dllexport_decl;
0049   std::string runtime_include_base;
0050   std::string annotation_pragma_name;
0051   std::string annotation_guard_name;
0052   FieldListenerOptions field_listener_options;
0053   EnforceOptimizeMode enforce_mode = EnforceOptimizeMode::kNoEnforcement;
0054   int num_cc_files = 0;
0055   BoundsCheckMode bounds_check_mode = BoundsCheckMode::kNoEnforcement;
0056   bool proto_h = false;
0057   bool transitive_pb_h = true;
0058   bool annotate_headers = false;
0059   bool lite_implicit_weak_fields = false;
0060   bool descriptor_implicit_weak_messages = false;
0061   bool bootstrap = false;
0062   bool opensource_runtime = false;
0063   bool annotate_accessor = false;
0064   bool force_split = false;
0065   bool force_eagerly_verified_lazy =
0066       google::protobuf::internal::ForceEagerlyVerifiedLazyInProtoc();
0067   bool force_inline_string = google::protobuf::internal::ForceInlineStringInProtoc();
0068   bool strip_nonfunctional_codegen = false;
0069   bool experimental_use_micro_string =
0070       google::protobuf::internal::EnableExperimentalMicroString();
0071 };
0072 
0073 }  // namespace cpp
0074 }  // namespace compiler
0075 }  // namespace protobuf
0076 }  // namespace google
0077 
0078 #endif  // GOOGLE_PROTOBUF_COMPILER_CPP_OPTIONS_H__