Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-09 09:11:06

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 // Defines a TypeResolver for the Any message.
0009 
0010 #ifndef GOOGLE_PROTOBUF_UTIL_TYPE_RESOLVER_H__
0011 #define GOOGLE_PROTOBUF_UTIL_TYPE_RESOLVER_H__
0012 
0013 #include <string>
0014 
0015 // This inclusion is unused, but we cannot remove it without first fixing IWYU
0016 // issues in upstream dependencies.
0017 #include "google/protobuf/any.pb.h"  // IWYU pragma: keep
0018 #include "google/protobuf/type.pb.h"
0019 #include "absl/status/status.h"
0020 #include "google/protobuf/port.h"
0021 
0022 
0023 // Must be included last.
0024 #include "google/protobuf/port_def.inc"
0025 
0026 namespace google {
0027 namespace protobuf {
0028 class DescriptorPool;
0029 namespace util {
0030 
0031 // Abstract interface for a type resolver.
0032 //
0033 // Implementations of this interface must be thread-safe.
0034 class PROTOBUF_EXPORT TypeResolver {
0035  public:
0036   TypeResolver() {}
0037   TypeResolver(const TypeResolver&) = delete;
0038   TypeResolver& operator=(const TypeResolver&) = delete;
0039   virtual ~TypeResolver() {}
0040 
0041   // Resolves a type url for a message type.
0042   virtual absl::Status ResolveMessageType(
0043       const std::string& type_url, google::protobuf::Type* message_type) = 0;
0044 
0045   // Resolves a type url for an enum type.
0046   virtual absl::Status ResolveEnumType(const std::string& type_url,
0047                                        google::protobuf::Enum* enum_type) = 0;
0048 };
0049 
0050 }  // namespace util
0051 }  // namespace protobuf
0052 }  // namespace google
0053 
0054 #include "google/protobuf/port_undef.inc"
0055 
0056 #endif  // GOOGLE_PROTOBUF_UTIL_TYPE_RESOLVER_H__