• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Protocol Buffers - Google's data interchange format
2 // Copyright 2024 Google LLC.  All rights reserved.
3 //
4 // Use of this source code is governed by a BSD-style
5 // license that can be found in the LICENSE file or at
6 // https://developers.google.com/open-source/licenses/bsd
7 
8 #ifndef GOOGLE_PROTOBUF_HPB_BACKEND_UPB_UPB_H__
9 #define GOOGLE_PROTOBUF_HPB_BACKEND_UPB_UPB_H__
10 
11 #include "google/protobuf/hpb/backend/upb/interop.h"
12 #include "google/protobuf/hpb/internal/internal.h"
13 #include "google/protobuf/hpb/internal/template_help.h"
14 #include "google/protobuf/hpb/ptr.h"
15 
16 namespace hpb::internal::backend::upb {
17 
18 template <typename T>
ClearMessage(hpb::internal::PtrOrRaw<T> message)19 void ClearMessage(hpb::internal::PtrOrRaw<T> message) {
20   auto ptr = Ptr(message);
21   auto minitable = hpb::interop::upb::GetMiniTable(ptr);
22   upb_Message_Clear(hpb::interop::upb::GetMessage(ptr), minitable);
23 }
24 
25 }  // namespace hpb::internal::backend::upb
26 
27 #endif  // GOOGLE_PROTOBUF_HPB_BACKEND_UPB_UPB_H__
28