Protocol Buffers - Google's data interchange format (grpc依赖)
https://developers.google.com/protocol-buffers/
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
47 lines
1.3 KiB
47 lines
1.3 KiB
2 years ago
|
// Protocol Buffers - Google's data interchange format
|
||
|
// Copyright 2023 Google LLC. All rights reserved.
|
||
|
//
|
||
1 year ago
|
// Use of this source code is governed by a BSD-style
|
||
|
// license that can be found in the LICENSE file or at
|
||
|
// https://developers.google.com/open-source/licenses/bsd
|
||
3 years ago
|
|
||
2 years ago
|
// Users should include array.h or map.h instead.
|
||
1 year ago
|
// IWYU pragma: private, include "upb/collections/array.h"
|
||
2 years ago
|
|
||
3 years ago
|
#ifndef UPB_MESSAGE_VALUE_H_
|
||
|
#define UPB_MESSAGE_VALUE_H_
|
||
|
|
||
1 year ago
|
#include <stdint.h>
|
||
|
|
||
1 year ago
|
#include "upb/base/string_view.h"
|
||
|
#include "upb/message/tagged_ptr.h"
|
||
|
#include "upb/message/types.h"
|
||
2 years ago
|
|
||
3 years ago
|
typedef union {
|
||
|
bool bool_val;
|
||
|
float float_val;
|
||
|
double double_val;
|
||
|
int32_t int32_val;
|
||
|
int64_t int64_val;
|
||
|
uint32_t uint32_val;
|
||
|
uint64_t uint64_val;
|
||
1 year ago
|
const struct upb_Array* array_val;
|
||
|
const struct upb_Map* map_val;
|
||
3 years ago
|
const upb_Message* msg_val;
|
||
|
upb_StringView str_val;
|
||
2 years ago
|
|
||
|
// EXPERIMENTAL: A tagged upb_Message*. Users must use this instead of
|
||
|
// msg_val if unlinked sub-messages may possibly be in use. See the
|
||
|
// documentation in kUpb_DecodeOption_ExperimentalAllowUnlinked for more
|
||
|
// information.
|
||
|
upb_TaggedMessagePtr tagged_msg_val;
|
||
3 years ago
|
} upb_MessageValue;
|
||
|
|
||
|
typedef union {
|
||
1 year ago
|
struct upb_Array* array;
|
||
|
struct upb_Map* map;
|
||
3 years ago
|
upb_Message* msg;
|
||
|
} upb_MutableMessageValue;
|
||
|
|
||
|
#endif /* UPB_MESSAGE_VALUE_H_ */
|