39 #ifndef UPB_REFCOUNTED_H_ 40 #define UPB_REFCOUNTED_H_ 84 #define UPB_INLINE inline 85 #elif defined (__GNUC__) 86 #define UPB_INLINE static __inline__ 88 #define UPB_INLINE static 93 #if defined(__BYTE_ORDER__) && (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__) 94 #define UPB_BIG_ENDIAN 99 #define UPB_FORCEINLINE __inline__ __attribute__((always_inline)) 100 #define UPB_NOINLINE __attribute__((noinline)) 101 #define UPB_NORETURN __attribute__((__noreturn__)) 103 #define UPB_FORCEINLINE 114 #define _upb_snprintf __builtin_snprintf 115 #define _upb_vsnprintf __builtin_vsnprintf 116 #define _upb_va_copy(a, b) __va_copy(a, b) 117 #elif __STDC_VERSION__ >= 199901L 119 #define _upb_snprintf snprintf 120 #define _upb_vsnprintf vsnprintf 121 #define _upb_va_copy(a, b) va_copy(a, b) 123 #error Need implementations of [v]snprintf and va_copy 127 #if ((defined(__cplusplus) && __cplusplus >= 201103L) || \ 128 defined(__GXX_EXPERIMENTAL_CXX0X__)) && !defined(UPB_NO_CXX11) 138 #include <type_traits> 139 #define UPB_DISALLOW_COPY_AND_ASSIGN(class_name) \ 140 class_name(const class_name&) = delete; \ 141 void operator=(const class_name&) = delete; 142 #define UPB_DISALLOW_POD_OPS(class_name, full_class_name) \ 143 class_name() = delete; \ 144 ~class_name() = delete; \ 145 UPB_DISALLOW_COPY_AND_ASSIGN(class_name) 146 #define UPB_ASSERT_STDLAYOUT(type) \ 147 static_assert(std::is_standard_layout<type>::value, \ 148 #type " must be standard layout"); 150 #define UPB_DISALLOW_COPY_AND_ASSIGN(class_name) \ 151 class_name(const class_name&); \ 152 void operator=(const class_name&); 153 #define UPB_DISALLOW_POD_OPS(class_name, full_class_name) \ 156 UPB_DISALLOW_COPY_AND_ASSIGN(class_name) 157 #define UPB_ASSERT_STDLAYOUT(type) 173 #define UPB_C_UPCASTS(ty, base) \ 174 UPB_INLINE base *ty ## _upcast_mutable(ty *p) { return (base*)p; } \ 175 UPB_INLINE const base *ty ## _upcast(const ty *p) { return (const base*)p; } 177 #define UPB_C_UPCASTS2(ty, base, base2) \ 178 UPB_C_UPCASTS(ty, base) \ 179 UPB_INLINE base2 *ty ## _upcast2_mutable(ty *p) { return (base2*)p; } \ 180 UPB_INLINE const base2 *ty ## _upcast2(const ty *p) { return (const base2*)p; } 184 #define UPB_BEGIN_EXTERN_C extern "C" { 185 #define UPB_END_EXTERN_C } 186 #define UPB_PRIVATE_FOR_CPP private: 187 #define UPB_DECLARE_TYPE(cppname, cname) typedef cppname cname; 189 #define UPB_DECLARE_DERIVED_TYPE(cppname, cppbase, cname, cbase) \ 190 UPB_DECLARE_TYPE(cppname, cname) \ 191 UPB_C_UPCASTS(cname, cbase) \ 194 class Pointer<cppname> : public PointerBase<cppname, cppbase> { \ 196 explicit Pointer(cppname* ptr) : PointerBase(ptr) {} \ 199 class Pointer<const cppname> \ 200 : public PointerBase<const cppname, const cppbase> { \ 202 explicit Pointer(const cppname* ptr) : PointerBase(ptr) {} \ 206 #define UPB_DECLARE_DERIVED_TYPE2(cppname, cppbase, cppbase2, cname, cbase, \ 208 UPB_DECLARE_TYPE(cppname, cname) \ 209 UPB_C_UPCASTS2(cname, cbase, cbase2) \ 212 class Pointer<cppname> : public PointerBase2<cppname, cppbase, cppbase2> { \ 214 explicit Pointer(cppname* ptr) : PointerBase2(ptr) {} \ 217 class Pointer<const cppname> \ 218 : public PointerBase2<const cppname, const cppbase, const cppbase2> { \ 220 explicit Pointer(const cppname* ptr) : PointerBase2(ptr) {} \ 226 #define UPB_BEGIN_EXTERN_C 227 #define UPB_END_EXTERN_C 228 #define UPB_PRIVATE_FOR_CPP 229 #define UPB_DECLARE_TYPE(cppname, cname) \ 231 typedef struct cname cname; 232 #define UPB_DECLARE_DERIVED_TYPE(cppname, cppbase, cname, cbase) \ 233 UPB_DECLARE_TYPE(cppname, cname) \ 234 UPB_C_UPCASTS(cname, cbase) 235 #define UPB_DECLARE_DERIVED_TYPE2(cppname, cppbase, cppbase2, \ 236 cname, cbase, cbase2) \ 237 UPB_DECLARE_TYPE(cppname, cname) \ 238 UPB_C_UPCASTS2(cname, cbase, cbase2) 242 #define UPB_MAX(x, y) ((x) > (y) ? (x) : (y)) 243 #define UPB_MIN(x, y) ((x) < (y) ? (x) : (y)) 245 #define UPB_UNUSED(var) (void)var 250 #define UPB_ASSERT_VAR(var, predicate) UPB_UNUSED(var); assert(predicate) 261 template <
class T>
class Pointer;
273 template<
class To,
class From> To
down_cast(From*
f);
285 template<
class To,
class From> To dyn_cast(From*
f);
294 template <
class T>
inline Pointer<T> upcast(
T *
f) {
return Pointer<T>(
f); }
302 template <
class T,
class F>
inline T* upcast_to(
F *
f) {
303 return static_cast<T*
>(upcast(f));
309 template <
class T,
class Base>
312 explicit PointerBase(
T* ptr) : ptr_(ptr) {}
313 operator T*() {
return ptr_; }
314 operator Base*() {
return (
Base*)ptr_; }
320 template <
class T,
class Base,
class Base2>
321 class PointerBase2 :
public PointerBase<T, Base> {
323 explicit PointerBase2(
T* ptr) : PointerBase<
T,
Base>(ptr) {}
324 operator Base2*() {
return Pointer<Base>(*this); }
342 template <
class T>
class reffed_ptr {
344 reffed_ptr() : ptr_(
NULL) {}
348 reffed_ptr(
U*
val,
const void* ref_donor =
NULL)
349 : ptr_(upb::upcast(val)) {
352 ptr_->DonateRef(ref_donor,
this);
359 reffed_ptr(
const reffed_ptr<U>& other)
360 : ptr_(upb::upcast(other.
get())) {
361 if (ptr_) ptr_->Ref(
this);
364 ~reffed_ptr() {
if (ptr_) ptr_->Unref(
this); }
367 reffed_ptr& operator=(
const reffed_ptr<U>& other) {
372 reffed_ptr& operator=(
const reffed_ptr& other) {
380 void swap(reffed_ptr& other) {
381 if (ptr_ == other.ptr_) {
385 if (ptr_) ptr_->DonateRef(
this, &other);
386 if (other.ptr_) other.ptr_->DonateRef(&other,
this);
395 T* operator->()
const {
400 T*
get()
const {
return ptr_; }
405 reffed_ptr(ptr, ref_donor).swap(*
this);
414 reffed_ptr<U> dyn_cast() {
415 return reffed_ptr<U>(upb::dyn_cast<
U*>(
get()));
420 T* ReleaseTo(
const void* new_owner) {
422 ptr_->DonateRef(
this, new_owner);
449 #define UPB_STATUS_MAX_MESSAGE 128 457 class upb::ErrorSpace {
481 ErrorSpace* error_space();
484 const char *error_message()
const;
488 void SetErrorMessage(
const char* msg);
489 void SetFormattedErrorMessage(
const char*
fmt, ...);
494 void SetErrorCode(ErrorSpace*
space,
int code);
499 void CopyFrom(
const Status& other);
516 #define UPB_STATUS_INIT {true, 0, NULL, {0}} 544 inline Status::Status() {
Clear(); }
545 inline bool Status::ok()
const {
return upb_ok(
this); }
546 inline const char* Status::error_message()
const {
549 inline void Status::SetErrorMessage(
const char* msg) {
552 inline void Status::SetFormattedErrorMessage(
const char* fmt, ...) {
558 inline void Status::SetErrorCode(ErrorSpace* space,
int code) {
562 inline void Status::CopyFrom(
const Status& other) {
604 #define SET_TYPE(dest, val) UPB_UNUSED(val) 606 #define SET_TYPE(dest, val) dest = val 635 #define FUNCS(name, membername, type_t, converter, proto_type) \ 636 UPB_INLINE void upb_value_set ## name(upb_value *val, type_t cval) { \ 637 val->val = (converter)cval; \ 638 SET_TYPE(val->ctype, proto_type); \ 640 UPB_INLINE upb_value upb_value_ ## name(type_t val) { \ 642 upb_value_set ## name(&ret, val); \ 645 UPB_INLINE type_t upb_value_get ## name(upb_value val) { \ 646 assert(val.ctype == proto_type); \ 647 return (type_t)(converter)val.val; \ 675 #define UPB_TABKEY_NUM(n) n 676 #define UPB_TABKEY_NONE 0 682 #ifdef UPB_BIG_ENDIAN 683 #define UPB_TABKEY_STR(len1, len2, len3, len4, strval) \ 684 (uintptr_t)(len4 len3 len2 len1 strval) 686 #define UPB_TABKEY_STR(len1, len2, len3, len4, strval) \ 687 (uintptr_t)(len1 len2 len3 len4 strval) 691 char* mem = (
char*)key;
692 if (len) memcpy(len, mem,
sizeof(*len));
693 return mem +
sizeof(*len);
715 #if UINTPTR_MAX == 0xffffffffffffffffULL 716 #define UPB_PTR_IS_64BITS 717 #elif UINTPTR_MAX != 0xffffffff 718 #error Could not determine how many bits pointers are. 728 #ifdef UPB_PTR_IS_64BITS 740 #ifdef UPB_PTR_IS_64BITS 741 #define UPB_TABVALUE_INT_INIT(v) {{v}} 742 #define UPB_TABVALUE_EMPTY_INIT {{-1}} 747 #ifdef UPB_BIG_ENDIAN 748 #define UPB_TABVALUE_INT_INIT(v) {{0, v}} 749 #define UPB_TABVALUE_EMPTY_INIT {{-1, -1}} 751 #define UPB_TABVALUE_INT_INIT(v) {{v, 0}} 752 #define UPB_TABVALUE_EMPTY_INIT {{-1, -1}} 757 #define UPB_TABVALUE_PTR_INIT(v) UPB_TABVALUE_INT_INIT((uintptr_t)v) 759 #undef UPB_PTR_IS_64BITS 796 #define UPB_STRTABLE_INIT(count, mask, ctype, size_lg2, entries) \ 797 {{count, mask, ctype, size_lg2, entries}} 799 #define UPB_EMPTY_STRTABLE_INIT(ctype) \ 800 UPB_STRTABLE_INIT(0, 0, ctype, 0, NULL) 809 #define UPB_INTTABLE_INIT(count, mask, ctype, size_lg2, ent, a, asize, acount) \ 810 {{count, mask, ctype, size_lg2, ent}, a, asize, acount} 812 #define UPB_EMPTY_INTTABLE_INIT(ctype) \ 813 UPB_INTTABLE_INIT(0, 0, ctype, 0, NULL, NULL, 0, 0) 815 #define UPB_ARRAY_EMPTYENT -1 927 *v = upb_value_int32(0);
928 if (key < t->array_size) {
1049 namespace upb {
class RefCounted; }
1058 class upb::RefCounted {
1061 bool IsFrozen()
const;
1067 void Ref(
const void *owner)
const;
1071 void Unref(
const void *owner)
const;
1076 void DonateRef(
const void *from,
const void *to)
const;
1080 void CheckRef(
const void *owner)
const;
1110 #ifdef UPB_DEBUG_REFS 1116 #ifdef UPB_DEBUG_REFS 1117 #define UPB_REFCOUNT_INIT(refs, ref2s) \ 1118 {&static_refcount, NULL, NULL, 0, true, refs, ref2s} 1120 #define UPB_REFCOUNT_INIT(refs, ref2s) {&static_refcount, NULL, NULL, 0, true} 1139 #define UPB_REFCOUNTED_CMETHODS(type, upcastfunc) \ 1140 UPB_INLINE bool type ## _isfrozen(const type *v) { \ 1141 return upb_refcounted_isfrozen(upcastfunc(v)); \ 1143 UPB_INLINE void type ## _ref(const type *v, const void *owner) { \ 1144 upb_refcounted_ref(upcastfunc(v), owner); \ 1146 UPB_INLINE void type ## _unref(const type *v, const void *owner) { \ 1147 upb_refcounted_unref(upcastfunc(v), owner); \ 1149 UPB_INLINE void type ## _donateref(const type *v, const void *from, const void *to) { \ 1150 upb_refcounted_donateref(upcastfunc(v), from, to); \ 1152 UPB_INLINE void type ## _checkref(const type *v, const void *owner) { \ 1153 upb_refcounted_checkref(upcastfunc(v), owner); \ 1156 #define UPB_REFCOUNTED_CPPMETHODS \ 1157 bool IsFrozen() const { \ 1158 return upb::upcast_to<const upb::RefCounted>(this)->IsFrozen(); \ 1160 void Ref(const void *owner) const { \ 1161 return upb::upcast_to<const upb::RefCounted>(this)->Ref(owner); \ 1163 void Unref(const void *owner) const { \ 1164 return upb::upcast_to<const upb::RefCounted>(this)->Unref(owner); \ 1166 void DonateRef(const void *from, const void *to) const { \ 1167 return upb::upcast_to<const upb::RefCounted>(this)->DonateRef(from, to); \ 1169 void CheckRef(const void *owner) const { \ 1170 return upb::upcast_to<const upb::RefCounted>(this)->CheckRef(owner); \ 1205 #define upb_ref2(r, from) \ 1206 upb_refcounted_ref2((const upb_refcounted*)r, (upb_refcounted*)from) 1207 #define upb_unref2(r, from) \ 1208 upb_refcounted_unref2((const upb_refcounted*)r, (upb_refcounted*)from) 1235 inline bool RefCounted::IsFrozen()
const {
1238 inline void RefCounted::Ref(
const void *owner)
const {
1241 inline void RefCounted::Unref(
const void *owner)
const {
1244 inline void RefCounted::DonateRef(
const void *from,
const void *to)
const {
1247 inline void RefCounted::CheckRef(
const void *owner)
const {
1278 #define UPB_MAX_MESSAGE_DEPTH 64 1302 Def* Dup(
const void *owner)
const;
1307 Type def_type()
const;
1310 const char *full_name()
const;
1316 bool set_full_name(
const char* fullname, upb::Status*
s);
1317 bool set_full_name(
const std::string &fullname, upb::Status* s);
1330 static bool Freeze(Def*
const* defs,
int n, Status*
status);
1331 static bool Freeze(
const std::vector<Def*>& defs, Status* status);
1358 #define UPB_CPP_CASTS(cname, cpptype) \ 1361 inline cpptype *down_cast<cpptype *, Def>(Def * def) { \ 1362 return upb_downcast_##cname##_mutable(def); \ 1365 inline cpptype *dyn_cast<cpptype *, Def>(Def * def) { \ 1366 return upb_dyncast_##cname##_mutable(def); \ 1369 inline const cpptype *down_cast<const cpptype *, const Def>( \ 1371 return upb_downcast_##cname(def); \ 1374 inline const cpptype *dyn_cast<const cpptype *, const Def>(const Def *def) { \ 1375 return upb_dyncast_##cname(def); \ 1378 inline const cpptype *down_cast<const cpptype *, Def>(Def * def) { \ 1379 return upb_downcast_##cname(def); \ 1382 inline const cpptype *dyn_cast<const cpptype *, Def>(Def * def) { \ 1383 return upb_dyncast_##cname(def); \ 1387 #define UPB_CPP_CASTS(cname, cpptype) 1393 #define UPB_DEF_CASTS(lower, upper, cpptype) \ 1394 UPB_INLINE const upb_##lower *upb_dyncast_##lower(const upb_def *def) { \ 1395 if (upb_def_type(def) != UPB_DEF_##upper) return NULL; \ 1396 return (upb_##lower *)def; \ 1398 UPB_INLINE const upb_##lower *upb_downcast_##lower(const upb_def *def) { \ 1399 assert(upb_def_type(def) == UPB_DEF_##upper); \ 1400 return (const upb_##lower *)def; \ 1402 UPB_INLINE upb_##lower *upb_dyncast_##lower##_mutable(upb_def *def) { \ 1403 return (upb_##lower *)upb_dyncast_##lower(def); \ 1405 UPB_INLINE upb_##lower *upb_downcast_##lower##_mutable(upb_def *def) { \ 1406 return (upb_##lower *)upb_downcast_##lower(def); \ 1408 UPB_CPP_CASTS(lower, cpptype) 1410 #define UPB_DEFINE_DEF(cppname, lower, upper, cppmethods, members) \ 1411 UPB_DEFINE_CLASS2(cppname, upb::Def, upb::RefCounted, cppmethods, \ 1413 UPB_DEF_CASTS(lower, upper, cppname) 1415 #define UPB_DECLARE_DEF_TYPE(cppname, lower, upper) \ 1416 UPB_DECLARE_DERIVED_TYPE2(cppname, upb::Def, upb::RefCounted, \ 1417 upb_ ## lower, upb_def, upb_refcounted) \ 1418 UPB_DEF_CASTS(lower, upper, cppname) 1425 #undef UPB_DECLARE_DEF_TYPE 1426 #undef UPB_DEF_CASTS 1427 #undef UPB_CPP_CASTS 1488 #define UPB_MAX_FIELDNUMBER ((1 << 29) - 1) 1497 class upb::FieldDef {
1505 static bool CheckType(
int32_t val);
1506 static bool CheckLabel(
int32_t val);
1507 static bool CheckDescriptorType(
int32_t val);
1508 static bool CheckIntegerFormat(
int32_t val);
1512 static Type ConvertType(
int32_t val);
1513 static Label ConvertLabel(
int32_t val);
1514 static DescriptorType ConvertDescriptorType(
int32_t val);
1515 static IntegerFormat ConvertIntegerFormat(
int32_t val);
1518 static reffed_ptr<FieldDef> New();
1525 FieldDef* Dup(
const void* owner)
const;
1531 const char* full_name()
const;
1533 bool type_is_set()
const;
1535 Label
label()
const;
1536 const char*
name()
const;
1538 bool is_extension()
const;
1554 bool packed()
const;
1571 const char* containing_type_name();
1586 bool IsSubMessage()
const;
1587 bool IsString()
const;
1588 bool IsSequence()
const;
1589 bool IsPrimitive()
const;
1594 IntegerFormat integer_format()
const;
1598 bool is_tag_delimited()
const;
1606 int64_t default_int64()
const;
1607 int32_t default_int32()
const;
1610 bool default_bool()
const;
1611 float default_float()
const;
1612 double default_double()
const;
1616 const char *default_string(
size_t*
len)
const;
1630 bool EnumHasStringDefault()
const;
1631 bool EnumHasInt32Default()
const;
1637 bool HasSubDef()
const;
1643 const EnumDef* enum_subdef()
const;
1644 const MessageDef* message_subdef()
const;
1648 const Def* subdef()
const;
1653 const char* subdef_name()
const;
1657 bool set_full_name(
const char* fullname, upb::Status* s);
1658 bool set_full_name(
const std::string& fullname, upb::Status* s);
1662 bool set_containing_type_name(
const char *name, Status*
status);
1663 bool set_containing_type_name(
const std::string& name, Status* status);
1668 void set_lazy(
bool lazy);
1671 void set_packed(
bool packed);
1677 void set_type(Type type);
1678 void set_label(Label label);
1679 void set_descriptor_type(DescriptorType type);
1680 void set_is_extension(
bool is_extension);
1689 bool set_number(
uint32_t number, upb::Status* s);
1690 bool set_name(
const char* name, upb::Status* s);
1691 bool set_name(
const std::string& name, upb::Status* s);
1693 void set_integer_format(IntegerFormat
format);
1694 bool set_tag_delimited(
bool tag_delimited, upb::Status* s);
1702 void set_default_int64(
int64_t val);
1703 void set_default_int32(
int32_t val);
1704 void set_default_uint64(
uint64_t val);
1705 void set_default_uint32(
uint32_t val);
1706 void set_default_bool(
bool val);
1707 void set_default_float(
float val);
1708 void set_default_double(
double val);
1709 bool set_default_string(
const void *
str,
size_t len, Status *s);
1710 bool set_default_string(
const std::string &str, Status *s);
1711 void set_default_cstr(
const char *str, Status *s);
1722 bool set_subdef(
const Def* subdef, Status* s);
1723 bool set_enum_subdef(
const EnumDef* subdef, Status* s);
1724 bool set_message_subdef(
const MessageDef* subdef, Status* s);
1725 bool set_subdef_name(
const char* name, Status* s);
1726 bool set_subdef_name(
const std::string &name, Status* s);
1835 class upb::MessageDef {
1838 static reffed_ptr<MessageDef> New();
1844 const char* full_name()
const;
1845 bool set_full_name(
const char* fullname, Status* s);
1846 bool set_full_name(
const std::string& fullname, Status* s);
1851 bool Freeze(Status* s);
1854 int field_count()
const;
1857 int oneof_count()
const;
1874 bool AddField(FieldDef* f, Status* s);
1875 bool AddField(
const reffed_ptr<FieldDef>& f, Status* s);
1884 bool AddOneof(OneofDef* o, Status* s);
1885 bool AddOneof(
const reffed_ptr<OneofDef>& o, Status* s);
1888 FieldDef* FindFieldByNumber(
uint32_t number);
1890 const FieldDef* FindFieldByNumber(
uint32_t number)
const;
1937 MessageDef* Dup(
const void* owner)
const;
1940 void setmapentry(
bool map_entry);
1941 bool mapentry()
const;
1944 class field_iterator
1945 :
public std::iterator<std::forward_iterator_tag, FieldDef*> {
1947 explicit field_iterator(MessageDef* md);
1948 static field_iterator
end(MessageDef* md);
1952 bool operator!=(
const field_iterator& other)
const;
1953 bool operator==(
const field_iterator& other)
const;
1956 upb_msg_field_iter iter_;
1959 class const_field_iterator
1960 :
public std::iterator<std::forward_iterator_tag, const FieldDef*> {
1962 explicit const_field_iterator(
const MessageDef* md);
1963 static const_field_iterator
end(
const MessageDef* md);
1967 bool operator!=(
const const_field_iterator& other)
const;
1968 bool operator==(
const const_field_iterator& other)
const;
1971 upb_msg_field_iter iter_;
1975 class oneof_iterator
1976 :
public std::iterator<std::forward_iterator_tag, FieldDef*> {
1978 explicit oneof_iterator(MessageDef* md);
1979 static oneof_iterator
end(MessageDef* md);
1983 bool operator!=(
const oneof_iterator& other)
const;
1984 bool operator==(
const oneof_iterator& other)
const;
1987 upb_msg_oneof_iter iter_;
1990 class const_oneof_iterator
1991 :
public std::iterator<std::forward_iterator_tag, const FieldDef*> {
1993 explicit const_oneof_iterator(
const MessageDef* md);
1994 static const_oneof_iterator
end(
const MessageDef* md);
1998 bool operator!=(
const const_oneof_iterator& other)
const;
1999 bool operator==(
const const_oneof_iterator& other)
const;
2002 upb_msg_oneof_iter iter_;
2005 class FieldAccessor {
2007 explicit FieldAccessor(MessageDef* msg) : msg_(msg) {}
2008 field_iterator begin() {
return msg_->field_begin(); }
2009 field_iterator
end() {
return msg_->field_end(); }
2014 class ConstFieldAccessor {
2016 explicit ConstFieldAccessor(
const MessageDef* msg) : msg_(msg) {}
2017 const_field_iterator begin() {
return msg_->field_begin(); }
2018 const_field_iterator
end() {
return msg_->field_end(); }
2020 const MessageDef* msg_;
2023 class OneofAccessor {
2025 explicit OneofAccessor(MessageDef* msg) : msg_(msg) {}
2026 oneof_iterator begin() {
return msg_->oneof_begin(); }
2027 oneof_iterator
end() {
return msg_->oneof_end(); }
2032 class ConstOneofAccessor {
2034 explicit ConstOneofAccessor(
const MessageDef* msg) : msg_(msg) {}
2035 const_oneof_iterator begin() {
return msg_->oneof_begin(); }
2036 const_oneof_iterator
end() {
return msg_->oneof_end(); }
2038 const MessageDef* msg_;
2041 field_iterator field_begin();
2042 field_iterator field_end();
2043 const_field_iterator field_begin()
const;
2044 const_field_iterator field_end()
const;
2046 oneof_iterator oneof_begin();
2047 oneof_iterator oneof_end();
2048 const_oneof_iterator oneof_begin()
const;
2049 const_oneof_iterator oneof_end()
const;
2051 FieldAccessor fields() {
return FieldAccessor(
this); }
2052 ConstFieldAccessor fields()
const {
return ConstFieldAccessor(
this); }
2053 OneofAccessor oneofs() {
return OneofAccessor(
this); }
2054 ConstOneofAccessor oneofs()
const {
return ConstOneofAccessor(
this); }
2100 const char *name,
size_t len) {
2117 const char *name,
size_t len) {
2125 #define UPB_MAPENTRY_KEY 1 2126 #define UPB_MAPENTRY_VALUE 2 2168 class upb::EnumDef {
2171 static reffed_ptr<EnumDef> New();
2177 const char* full_name()
const;
2178 bool set_full_name(
const char* fullname, Status* s);
2179 bool set_full_name(
const std::string& fullname, Status* s);
2182 bool Freeze(Status* s);
2188 int32_t default_value()
const;
2192 bool set_default_value(
int32_t val, Status* status);
2197 int value_count()
const;
2201 bool AddValue(
const char* name,
int32_t num, Status* status);
2205 bool FindValueByName(
const char* name,
int32_t* num)
const;
2210 const char* FindValueByNumber(
int32_t num)
const;
2214 EnumDef* Dup(
const void* owner)
const;
2230 upb_enum_iter iter_;
2269 const char *name,
int32_t *num) {
2295 class upb::OneofDef {
2298 static reffed_ptr<OneofDef> New();
2304 const char* full_name()
const;
2311 const char*
name()
const;
2312 bool set_name(
const char* name, Status* s);
2315 int field_count()
const;
2330 bool AddField(
const reffed_ptr<FieldDef>& field, Status* s);
2352 const FieldDef* FindFieldByNumber(
uint32_t num)
const;
2356 OneofDef* Dup(
const void* owner)
const;
2359 class iterator :
public std::iterator<std::forward_iterator_tag, FieldDef*> {
2361 explicit iterator(OneofDef* md);
2362 static iterator
end(OneofDef* md);
2366 bool operator!=(
const iterator& other)
const;
2367 bool operator==(
const iterator& other)
const;
2370 upb_oneof_iter iter_;
2373 class const_iterator
2374 :
public std::iterator<std::forward_iterator_tag, const FieldDef*> {
2376 explicit const_iterator(
const OneofDef* md);
2377 static const_iterator
end(
const OneofDef* md);
2381 bool operator!=(
const const_iterator& other)
const;
2382 bool operator==(
const const_iterator& other)
const;
2385 upb_oneof_iter iter_;
2390 const_iterator begin()
const;
2391 const_iterator
end()
const;
2414 const void *ref_donor,
2422 const char *name,
size_t length);
2445 assert(str.size() == std::strlen(str.c_str()));
2452 inline Def* Def::Dup(
const void* owner)
const {
2456 inline const char* Def::full_name()
const {
return upb_def_fullname(
this); }
2457 inline bool Def::set_full_name(
const char* fullname, Status* s) {
2460 inline bool Def::set_full_name(
const std::string& fullname, Status* s) {
2463 inline bool Def::Freeze(Def*
const* defs,
int n, Status* status) {
2466 inline bool Def::Freeze(
const std::vector<Def*>& defs, Status* status) {
2467 return upb_def_freeze((Def*
const*)&defs[0], defs.size(), status);
2470 inline bool FieldDef::CheckType(
int32_t val) {
2473 inline bool FieldDef::CheckLabel(
int32_t val) {
2476 inline bool FieldDef::CheckDescriptorType(
int32_t val) {
2479 inline bool FieldDef::CheckIntegerFormat(
int32_t val) {
2483 assert(CheckType(val));
2486 inline FieldDef::Label FieldDef::ConvertLabel(
int32_t val) {
2487 assert(CheckLabel(val));
2488 return static_cast<FieldDef::Label
>(
val);
2490 inline FieldDef::DescriptorType FieldDef::ConvertDescriptorType(
int32_t val) {
2491 assert(CheckDescriptorType(val));
2492 return static_cast<FieldDef::DescriptorType
>(
val);
2494 inline FieldDef::IntegerFormat FieldDef::ConvertIntegerFormat(
int32_t val) {
2495 assert(CheckIntegerFormat(val));
2496 return static_cast<FieldDef::IntegerFormat
>(
val);
2499 inline reffed_ptr<FieldDef> FieldDef::New() {
2501 return reffed_ptr<FieldDef>(
f, &
f);
2503 inline FieldDef* FieldDef::Dup(
const void* owner)
const {
2506 inline const char* FieldDef::full_name()
const {
2509 inline bool FieldDef::set_full_name(
const char* fullname, Status* s) {
2512 inline bool FieldDef::set_full_name(
const std::string& fullname, Status* s) {
2515 inline bool FieldDef::type_is_set()
const {
2527 inline bool FieldDef::is_extension()
const {
2530 inline bool FieldDef::lazy()
const {
2533 inline void FieldDef::set_lazy(
bool lazy) {
2536 inline bool FieldDef::packed()
const {
2539 inline void FieldDef::set_packed(
bool packed) {
2548 inline const char* FieldDef::containing_type_name() {
2551 inline bool FieldDef::set_number(
uint32_t number, Status* s) {
2554 inline bool FieldDef::set_name(
const char *name, Status* s) {
2557 inline bool FieldDef::set_name(
const std::string& name, Status* s) {
2560 inline bool FieldDef::set_containing_type_name(
const char *name, Status* s) {
2563 inline bool FieldDef::set_containing_type_name(
const std::string &name,
2570 inline void FieldDef::set_is_extension(
bool is_extension) {
2573 inline void FieldDef::set_descriptor_type(FieldDef::DescriptorType type) {
2576 inline void FieldDef::set_label(
upb_label_t label) {
2579 inline bool FieldDef::IsSubMessage()
const {
2585 inline int64_t FieldDef::default_int64()
const {
2588 inline int32_t FieldDef::default_int32()
const {
2591 inline uint64_t FieldDef::default_uint64()
const {
2594 inline uint32_t FieldDef::default_uint32()
const {
2597 inline bool FieldDef::default_bool()
const {
2600 inline float FieldDef::default_float()
const {
2603 inline double FieldDef::default_double()
const {
2606 inline const char* FieldDef::default_string(
size_t* len)
const {
2609 inline void FieldDef::set_default_int64(
int64_t value) {
2612 inline void FieldDef::set_default_int32(
int32_t value) {
2615 inline void FieldDef::set_default_uint64(
uint64_t value) {
2618 inline void FieldDef::set_default_uint32(
uint32_t value) {
2621 inline void FieldDef::set_default_bool(
bool value) {
2624 inline void FieldDef::set_default_float(
float value) {
2627 inline void FieldDef::set_default_double(
double value) {
2630 inline bool FieldDef::set_default_string(
const void *str,
size_t len,
2634 inline bool FieldDef::set_default_string(
const std::string& str, Status* s) {
2637 inline void FieldDef::set_default_cstr(
const char* str, Status* s) {
2642 inline const MessageDef *FieldDef::message_subdef()
const {
2645 inline const EnumDef *FieldDef::enum_subdef()
const {
2648 inline const char* FieldDef::subdef_name()
const {
2651 inline bool FieldDef::set_subdef(
const Def* subdef, Status* s) {
2654 inline bool FieldDef::set_enum_subdef(
const EnumDef* subdef, Status* s) {
2657 inline bool FieldDef::set_message_subdef(
const MessageDef* subdef, Status* s) {
2660 inline bool FieldDef::set_subdef_name(
const char* name, Status* s) {
2663 inline bool FieldDef::set_subdef_name(
const std::string& name, Status* s) {
2667 inline reffed_ptr<MessageDef> MessageDef::New() {
2669 return reffed_ptr<MessageDef>(
m, &
m);
2671 inline const char *MessageDef::full_name()
const {
2674 inline bool MessageDef::set_full_name(
const char* fullname, Status* s) {
2677 inline bool MessageDef::set_full_name(
const std::string& fullname, Status* s) {
2680 inline bool MessageDef::Freeze(Status* status) {
2683 inline int MessageDef::field_count()
const {
2686 inline int MessageDef::oneof_count()
const {
2695 inline bool MessageDef::AddOneof(
upb_oneofdef* o, Status* s) {
2698 inline bool MessageDef::AddOneof(
const reffed_ptr<OneofDef>& o, Status* s) {
2701 inline FieldDef* MessageDef::FindFieldByNumber(
uint32_t number) {
2707 inline const FieldDef* MessageDef::FindFieldByNumber(
uint32_t number)
const {
2721 inline MessageDef* MessageDef::Dup(
const void *owner)
const {
2724 inline void MessageDef::setmapentry(
bool map_entry) {
2727 inline bool MessageDef::mapentry()
const {
2730 inline MessageDef::field_iterator MessageDef::field_begin() {
2731 return field_iterator(
this);
2733 inline MessageDef::field_iterator MessageDef::field_end() {
2736 inline MessageDef::const_field_iterator MessageDef::field_begin()
const {
2737 return const_field_iterator(
this);
2739 inline MessageDef::const_field_iterator MessageDef::field_end()
const {
2743 inline MessageDef::oneof_iterator MessageDef::oneof_begin() {
2744 return oneof_iterator(
this);
2746 inline MessageDef::oneof_iterator MessageDef::oneof_end() {
2749 inline MessageDef::const_oneof_iterator MessageDef::oneof_begin()
const {
2750 return const_oneof_iterator(
this);
2752 inline MessageDef::const_oneof_iterator MessageDef::oneof_end()
const {
2756 inline MessageDef::field_iterator::field_iterator(MessageDef* md) {
2761 MessageDef::field_iterator iter(md);
2772 const field_iterator &other)
const {
2776 const field_iterator &other)
const {
2777 return !(*
this == other);
2780 inline MessageDef::const_field_iterator::const_field_iterator(
2781 const MessageDef* md) {
2785 const MessageDef *md) {
2786 MessageDef::const_field_iterator iter(md);
2797 const const_field_iterator &other)
const {
2801 const const_field_iterator &other)
const {
2802 return !(*
this == other);
2805 inline MessageDef::oneof_iterator::oneof_iterator(MessageDef* md) {
2810 MessageDef::oneof_iterator iter(md);
2821 const oneof_iterator &other)
const {
2825 const oneof_iterator &other)
const {
2826 return !(*
this == other);
2829 inline MessageDef::const_oneof_iterator::const_oneof_iterator(
2830 const MessageDef* md) {
2834 const MessageDef *md) {
2835 MessageDef::const_oneof_iterator iter(md);
2846 const const_oneof_iterator &other)
const {
2850 const const_oneof_iterator &other)
const {
2851 return !(*
this == other);
2854 inline reffed_ptr<EnumDef> EnumDef::New() {
2856 return reffed_ptr<EnumDef>(
e, &
e);
2858 inline const char* EnumDef::full_name()
const {
2861 inline bool EnumDef::set_full_name(
const char* fullname, Status* s) {
2864 inline bool EnumDef::set_full_name(
const std::string& fullname, Status* s) {
2867 inline bool EnumDef::Freeze(Status* status) {
2870 inline int32_t EnumDef::default_value()
const {
2873 inline bool EnumDef::set_default_value(
int32_t val, Status* status) {
2877 inline bool EnumDef::AddValue(
const char* name,
int32_t num, Status* status) {
2884 inline bool EnumDef::FindValueByName(
const char* name,
int32_t *num)
const {
2887 inline const char* EnumDef::FindValueByNumber(
int32_t num)
const {
2890 inline EnumDef* EnumDef::Dup(
const void* owner)
const {
2903 inline bool EnumDef::Iterator::Done() {
return upb_enum_done(&iter_); }
2904 inline void EnumDef::Iterator::Next() {
return upb_enum_next(&iter_); }
2906 inline reffed_ptr<OneofDef> OneofDef::New() {
2908 return reffed_ptr<OneofDef>(o, &o);
2910 inline const char* OneofDef::full_name()
const {
2920 inline bool OneofDef::set_name(
const char* name, Status* s) {
2923 inline int OneofDef::field_count()
const {
2936 inline const FieldDef* OneofDef::FindFieldByNumber(
uint32_t num)
const {
2939 inline OneofDef::iterator OneofDef::begin() {
return iterator(
this); }
2941 inline OneofDef::const_iterator OneofDef::begin()
const {
2942 return const_iterator(
this);
2948 inline OneofDef::iterator::iterator(OneofDef* o) {
2952 OneofDef::iterator iter(o);
2964 return !(*
this == other);
2967 inline OneofDef::const_iterator::const_iterator(
const OneofDef* md) {
2971 const OneofDef *md) {
2972 OneofDef::const_iterator iter(md);
2983 const const_iterator &other)
const {
2987 const const_iterator &other)
const {
2988 return !(*
this == other);
3012 #ifndef UPB_STATICINIT_H_ 3013 #define UPB_STATICINIT_H_ 3017 #error This file cannot be included from C++ 3038 #define UPB_DEF_INIT(name, type, refs, ref2s) \ 3039 { UPB_REFCOUNT_INIT(refs, ref2s), name, type, false } 3079 #define UPB_FIELDDEF_INIT(label, type, intfmt, tagdelim, is_extension, lazy, \ 3080 packed, name, num, msgdef, subdef, selector_base, \ 3081 index, defaultval, refs, ref2s) \ 3083 UPB_DEF_INIT(name, UPB_DEF_FIELD, refs, ref2s), defaultval, {msgdef}, \ 3084 {subdef}, NULL, false, false, \ 3085 type == UPB_TYPE_STRING || type == UPB_TYPE_BYTES, true, is_extension, \ 3086 lazy, packed, intfmt, tagdelim, type, label, num, selector_base, index \ 3115 #define UPB_MSGDEF_INIT(name, selector_count, submsg_field_count, itof, ntof, \ 3118 UPB_DEF_INIT(name, UPB_DEF_MSG, refs, ref2s), selector_count, \ 3119 submsg_field_count, itof, ntof, \ 3120 UPB_EMPTY_STRTABLE_INIT(UPB_CTYPE_PTR), false \ 3134 #define UPB_ENUMDEF_INIT(name, ntoi, iton, defaultval, refs, ref2s) \ 3135 { UPB_DEF_INIT(name, UPB_DEF_ENUM, refs, ref2s), ntoi, iton, defaultval } 3148 #define UPB_ONEOFDEF_INIT(name, ntof, itof, refs, ref2s) \ 3149 { UPB_DEF_INIT(name, UPB_DEF_ENUM, refs, ref2s), ntof, itof } 3160 #define UPB_SYMTAB_INIT(symtab, refs, ref2s) \ 3161 { UPB_REFCOUNT_INIT(refs, ref2s), symtab } 3183 #ifndef UPB_HANDLERS_H 3184 #define UPB_HANDLERS_H 3191 class HandlerAttributes;
3193 template <
class T>
class Handler;
3194 template <
class T>
struct CanonicalType;
3211 #define UPB_MAX_HANDLER_DEPTH 64 3223 UPB_HANDLER_STARTSTR,
3226 UPB_HANDLER_STARTSUBMSG,
3227 UPB_HANDLER_ENDSUBMSG,
3228 UPB_HANDLER_STARTSEQ,
3232 #define UPB_HANDLER_MAX (UPB_HANDLER_ENDSEQ+1) 3234 #define UPB_BREAK NULL 3238 #define UPB_NO_CLOSURE &_upb_noclosure 3267 #define UPB_STARTMSG_SELECTOR 0 3268 #define UPB_ENDMSG_SELECTOR 1 3269 #define UPB_STATIC_SELECTOR_COUNT 2 3272 #define UPB_STARTSTR_SELECTOR 0 3273 #define UPB_STRING_SELECTOR 1 3274 #define UPB_ENDSTR_SELECTOR 2 3281 class upb::HandlerAttributes {
3283 HandlerAttributes();
3284 ~HandlerAttributes();
3289 bool SetHandlerData(
const void *handler_data);
3290 const void* handler_data()
const;
3296 bool SetClosureType(
const void *closure_type);
3297 const void* closure_type()
const;
3303 bool SetReturnClosureType(
const void *return_closure_type);
3304 const void* return_closure_type()
const;
3309 bool SetAlwaysOk(
bool always_ok);
3310 bool always_ok()
const;
3324 #define UPB_HANDLERATTR_INITIALIZER {NULL, NULL, NULL, false} 3347 class upb::BufferHandle {
3355 const char*
buffer()
const;
3359 size_t object_offset()
const;
3363 void SetBuffer(
const char*
buf,
size_t object_offset);
3368 void SetAttachedObject(
const T*
obj);
3372 const T* GetAttachedObject()
const;
3380 const char *buf,
size_t ofs);
3407 class upb::Handlers {
3409 typedef upb_selector_t Selector;
3412 typedef Handler<void *(*)(void *, const void *)> StartFieldHandler;
3413 typedef Handler<bool (*)(void *, const void *)> EndFieldHandler;
3414 typedef Handler<bool (*)(void *, const void *)> StartMessageHandler;
3415 typedef Handler<bool (*)(void *, const void *, Status*)> EndMessageHandler;
3416 typedef Handler<void *(*)(void *, const void *, size_t)> StartStringHandler;
3417 typedef Handler<
size_t (*)(
void *,
const void *,
const char *,
size_t,
3418 const BufferHandle *)> StringHandler;
3420 template <
class T>
struct ValueHandler {
3421 typedef Handler<bool(*)(void *, const void *, T)>
H;
3434 typedef void GenericFunction();
3436 typedef void HandlersCallback(
const void *closure, upb_handlers *h);
3440 static reffed_ptr<Handlers> New(
const MessageDef *m);
3447 static reffed_ptr<const Handlers> NewFrozen(
const MessageDef *m,
3449 const void *closure);
3459 const Status* status();
3465 bool Freeze(Status* s);
3469 static bool Freeze(Handlers*
const*
handlers,
int n, Status* s);
3470 static bool Freeze(
const std::vector<Handlers*>& handlers, Status* s);
3473 const MessageDef* message_def()
const;
3488 bool SetStartMessageHandler(
const StartMessageHandler& handler);
3498 bool SetEndMessageHandler(
const EndMessageHandler& handler);
3520 bool SetInt32Handler (
const FieldDef* f,
const Int32Handler& h);
3521 bool SetInt64Handler (
const FieldDef* f,
const Int64Handler& h);
3522 bool SetUInt32Handler(
const FieldDef* f,
const UInt32Handler& h);
3523 bool SetUInt64Handler(
const FieldDef* f,
const UInt64Handler& h);
3524 bool SetFloatHandler (
const FieldDef* f,
const FloatHandler& h);
3525 bool SetDoubleHandler(
const FieldDef* f,
const DoubleHandler& h);
3526 bool SetBoolHandler (
const FieldDef* f,
const BoolHandler& h);
3533 bool SetValueHandler(
3573 bool SetStartStringHandler(
const FieldDef* f,
const StartStringHandler& h);
3574 bool SetStringHandler(
const FieldDef* f,
const StringHandler& h);
3575 bool SetEndStringHandler(
const FieldDef* f,
const EndFieldHandler& h);
3591 bool SetStartSequenceHandler(
const FieldDef* f,
const StartFieldHandler& h);
3608 bool SetStartSubMessageHandler(
const FieldDef* f,
const StartFieldHandler& h);
3621 bool SetEndSubMessageHandler(
const FieldDef *f,
const EndFieldHandler &h);
3634 bool SetEndSequenceHandler(
const FieldDef* f,
const EndFieldHandler& h);
3638 bool SetSubHandlers(
const FieldDef* f,
const Handlers*
sub);
3639 const Handlers* GetSubHandlers(
const FieldDef* f)
const;
3643 const Handlers* GetSubHandlers(Selector startsubmsg)
const;
3651 static bool GetSelector(
const FieldDef* f, Type type, Selector* s);
3654 static Selector GetEndSelector(Selector start_selector);
3658 GenericFunction* GetHandler(Selector selector);
3661 bool GetAttributes(Selector selector, HandlerAttributes*
attr);
3664 const void* GetHandlerData(Selector selector);
3676 const upb_handlers *h, upb_selector_t s);
3678 const upb_handlers *h, upb_selector_t s);
3680 struct upb_handlers {
3736 #define UpbMakeHandler(f) upb::MatchFunc(f).template GetFunc<f>() 3739 #define UpbBind(f, d) upb::MatchFunc(f).template GetFunc<f>((d)) 3746 #define UpbMakeHandler(f) upb::MatchFunc(f).GetFunc<f>() 3748 #define UpbBind(f, d) upb::MatchFunc(f).GetFunc<f>((d)) 3755 #define UpbMakeHandlerT(f) upb::MatchFunc(f).template GetFunc<f>() 3758 #define UpbBindT(f, d) upb::MatchFunc(f).template GetFunc<f>((d)) 3763 template <
class T>
class Handler {
3769 template <
class F> Handler(
F func);
3773 void AddCleanup(Handlers* h)
const {
3774 if (cleanup_func_) {
3775 bool ok = h->AddCleanup(cleanup_data_, cleanup_func_);
3781 friend class Handlers;
3783 mutable HandlerAttributes attr_;
3784 mutable bool registered_;
3785 void *cleanup_data_;
3842 const void *closure);
3897 const upb_handlers *sub);
3901 upb_selector_t sel);
3923 class upb::BytesHandler {
3966 #ifndef UPB_HANDLERS_INL_H_ 3967 #define UPB_HANDLERS_INL_H_ 4021 #define UPB_INT32_MAX 0x7fffffffLL 4022 #define UPB_INT32_MIN (-UPB_INT32_MAX - 1) 4023 #define UPB_INT64_MAX 0x7fffffffffffffffLL 4024 #define UPB_INT64_MIN (-UPB_INT64_MAX - 1) 4026 #if INT_MAX == UPB_INT32_MAX && INT_MIN == UPB_INT32_MIN 4027 #define UPB_INT_IS_32BITS 1 4030 #if LONG_MAX == UPB_INT32_MAX && LONG_MIN == UPB_INT32_MIN 4031 #define UPB_LONG_IS_32BITS 1 4034 #if LONG_MAX == UPB_INT64_MAX && LONG_MIN == UPB_INT64_MIN 4035 #define UPB_LONG_IS_64BITS 1 4038 #if LLONG_MAX == UPB_INT64_MAX && LLONG_MIN == UPB_INT64_MIN 4039 #define UPB_LLONG_IS_64BITS 1 4044 #if UPB_INT_IS_32BITS 4045 #define UPB_INT32_T int 4046 #define UPB_UINT32_T unsigned int 4048 #if UPB_LONG_IS_32BITS 4049 #define UPB_TWO_32BIT_TYPES 1 4050 #define UPB_INT32ALT_T long 4051 #define UPB_UINT32ALT_T unsigned long 4054 #elif UPB_LONG_IS_32BITS 4055 #define UPB_INT32_T long 4056 #define UPB_UINT32_T unsigned long 4060 #if UPB_LONG_IS_64BITS 4061 #define UPB_INT64_T long 4062 #define UPB_UINT64_T unsigned long 4064 #if UPB_LLONG_IS_64BITS 4065 #define UPB_TWO_64BIT_TYPES 1 4066 #define UPB_INT64ALT_T long long 4067 #define UPB_UINT64ALT_T unsigned long long 4070 #elif UPB_LLONG_IS_64BITS 4071 #define UPB_INT64_T long long 4072 #define UPB_UINT64_T unsigned long long 4075 #undef UPB_INT32_MAX 4076 #undef UPB_INT32_MIN 4077 #undef UPB_INT64_MAX 4078 #undef UPB_INT64_MIN 4079 #undef UPB_INT_IS_32BITS 4080 #undef UPB_LONG_IS_32BITS 4081 #undef UPB_LONG_IS_64BITS 4082 #undef UPB_LLONG_IS_64BITS 4087 typedef void CleanupFunc(
void *ptr);
4094 class CouldntRemoveConst {};
4095 template <
class T>
struct remove_constptr {
typedef CouldntRemoveConst
type; };
4096 template <
class T>
struct remove_constptr<const T *> {
typedef T *
type; };
4100 template <
class T,
class U>
struct disable_if_same {
typedef void Type; };
4101 template <
class T>
struct disable_if_same<T, T> {};
4103 template <
class T>
void DeletePointer(
void *
p) {
delete static_cast<T
>(
p); }
4105 template <
class T1,
class T2>
4106 struct FirstUnlessVoidOrBool {
4111 struct FirstUnlessVoidOrBool<void, T2> {
4116 struct FirstUnlessVoidOrBool<bool, T2> {
4120 template<
class T,
class U>
4126 struct is_same<T, T> {
4130 template<
class T,
class U>
4139 template <
class C,
class R =
void>
4157 struct UnboundFunc {
4158 CleanupFunc *GetCleanup() {
return NULL; }
4159 void *GetData() {
return NULL; }
4162 template <
class R,
class P1, R F(P1),
class I>
4163 struct Func1 :
public UnboundFunc {
4166 static R Call(P1 p1) {
return F(p1); }
4169 template <
class R,
class P1,
class P2, R F(P1, P2),
class I>
4170 struct Func2 :
public UnboundFunc {
4173 static R Call(P1 p1, P2 p2) {
return F(p1, p2); }
4176 template <
class R,
class P1,
class P2,
class P3, R F(P1, P2, P3),
class I>
4177 struct Func3 :
public UnboundFunc {
4180 static R Call(P1 p1, P2 p2, P3 p3) {
return F(p1, p2, p3); }
4183 template <
class R,
class P1,
class P2,
class P3,
class P4,
R F(P1, P2, P3, P4),
4185 struct Func4 :
public UnboundFunc {
4188 static R Call(P1 p1, P2 p2, P3 p3, P4 p4) {
return F(p1, p2, p3, p4); }
4191 template <
class R,
class P1,
class P2,
class P3,
class P4,
class P5,
4192 R F(P1, P2, P3, P4, P5),
class I>
4193 struct Func5 :
public UnboundFunc {
4196 static R Call(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5) {
4197 return F(p1, p2, p3, p4, p5);
4211 explicit BoundFunc(MutableP2 data_) :
data(data_) {}
4212 CleanupFunc *GetCleanup() {
return &DeletePointer<MutableP2>; }
4213 MutableP2 GetData() {
return data; }
4217 template <
class R,
class P1,
class P2, R F(P1, P2),
class I>
4218 struct BoundFunc2 :
public BoundFunc<P2> {
4219 typedef BoundFunc<P2>
Base;
4221 explicit BoundFunc2(
typename Base::MutableP2 arg) : Base(arg) {}
4224 template <
class R,
class P1,
class P2,
class P3, R F(P1, P2, P3),
class I>
4225 struct BoundFunc3 :
public BoundFunc<P2> {
4226 typedef BoundFunc<P2>
Base;
4228 explicit BoundFunc3(
typename Base::MutableP2 arg) : Base(arg) {}
4231 template <
class R,
class P1,
class P2,
class P3,
class P4,
R F(P1, P2, P3, P4),
4233 struct BoundFunc4 :
public BoundFunc<P2> {
4234 typedef BoundFunc<P2>
Base;
4236 explicit BoundFunc4(
typename Base::MutableP2 arg) : Base(arg) {}
4239 template <
class R,
class P1,
class P2,
class P3,
class P4,
class P5,
4240 R F(P1, P2, P3, P4, P5),
class I>
4241 struct BoundFunc5 :
public BoundFunc<P2> {
4242 typedef BoundFunc<P2>
Base;
4244 explicit BoundFunc5(
typename Base::MutableP2 arg) : Base(arg) {}
4254 template <
class R,
class P1>
4257 Func1<R, P1, F, FuncInfo<P1, R> > GetFunc() {
4258 return Func1<R, P1, F, FuncInfo<P1, R> >();
4262 template <
class R,
class P1,
class P2>
4264 template <R F(P1, P2)>
4265 Func2<R, P1, P2, F, FuncInfo<P1, R> > GetFunc() {
4266 return Func2<R, P1, P2, F, FuncInfo<P1, R> >();
4269 template <R F(P1, P2)>
4270 BoundFunc2<R, P1, P2, F, FuncInfo<P1, R> > GetFunc(
4272 return BoundFunc2<R, P1, P2, F, FuncInfo<P1, R> >(param2);
4276 template <
class R,
class P1,
class P2,
class P3>
4278 template <R F(P1, P2, P3)>
4279 Func3<R, P1, P2, P3, F, FuncInfo<P1, R> > GetFunc() {
4280 return Func3<R, P1, P2, P3, F, FuncInfo<P1, R> >();
4283 template <R F(P1, P2, P3)>
4284 BoundFunc3<R, P1, P2, P3, F, FuncInfo<P1, R> > GetFunc(
4286 return BoundFunc3<R, P1, P2, P3, F, FuncInfo<P1, R> >(param2);
4290 template <
class R,
class P1,
class P2,
class P3,
class P4>
4292 template <R F(P1, P2, P3, P4)>
4293 Func4<R, P1, P2, P3, P4, F, FuncInfo<P1, R> > GetFunc() {
4294 return Func4<R, P1, P2, P3, P4, F, FuncInfo<P1, R> >();
4297 template <R F(P1, P2, P3, P4)>
4298 BoundFunc4<R, P1, P2, P3, P4, F, FuncInfo<P1, R> > GetFunc(
4300 return BoundFunc4<R, P1, P2, P3, P4, F, FuncInfo<P1, R> >(param2);
4304 template <
class R,
class P1,
class P2,
class P3,
class P4,
class P5>
4306 template <R F(P1, P2, P3, P4, P5)>
4307 Func5<R, P1, P2, P3, P4, P5, F, FuncInfo<P1, R> > GetFunc() {
4308 return Func5<R, P1, P2, P3, P4, P5, F, FuncInfo<P1, R> >();
4311 template <R F(P1, P2, P3, P4, P5)>
4312 BoundFunc5<R, P1, P2, P3, P4, P5, F, FuncInfo<P1, R> > GetFunc(
4314 return BoundFunc5<R, P1, P2, P3, P4, P5, F, FuncInfo<P1, R> >(param2);
4320 template <
class R,
class P1>
4321 inline FuncSig1<R, P1> MatchFunc(
R (*f)(P1)) {
4323 return FuncSig1<R, P1>();
4326 template <
class R,
class P1,
class P2>
4327 inline FuncSig2<R, P1, P2> MatchFunc(
R (*f)(P1, P2)) {
4329 return FuncSig2<R, P1, P2>();
4332 template <
class R,
class P1,
class P2,
class P3>
4333 inline FuncSig3<R, P1, P2, P3> MatchFunc(
R (*f)(P1, P2, P3)) {
4335 return FuncSig3<R, P1, P2, P3>();
4338 template <
class R,
class P1,
class P2,
class P3,
class P4>
4339 inline FuncSig4<R, P1, P2, P3, P4> MatchFunc(
R (*f)(P1, P2, P3, P4)) {
4341 return FuncSig4<R, P1, P2, P3, P4>();
4344 template <
class R,
class P1,
class P2,
class P3,
class P4,
class P5>
4345 inline FuncSig5<R, P1, P2, P3, P4, P5> MatchFunc(
R (*f)(P1, P2, P3, P4, P5)) {
4347 return FuncSig5<R, P1, P2, P3, P4, P5>();
4353 template <
class R,
class C, R (C::*F)()>
4354 R CallMethod0(
C *obj) {
4355 return ((*obj).*
F)();
4358 template <
class R,
class C,
class P1, R (C::*F)(P1)>
4359 R CallMethod1(
C *obj, P1 arg1) {
4360 return ((*obj).*
F)(arg1);
4363 template <
class R,
class C,
class P1,
class P2, R (C::*F)(P1, P2)>
4364 R CallMethod2(
C *obj, P1 arg1, P2 arg2) {
4365 return ((*obj).*
F)(arg1, arg2);
4368 template <
class R,
class C,
class P1,
class P2,
class P3, R (C::*F)(P1, P2, P3)>
4369 R CallMethod3(
C *obj, P1 arg1, P2 arg2, P3
arg3) {
4370 return ((*obj).*
F)(arg1, arg2,
arg3);
4373 template <
class R,
class C,
class P1,
class P2,
class P3,
class P4,
4374 R (C::*
F)(P1, P2, P3, P4)>
4375 R CallMethod4(C *obj, P1 arg1, P2 arg2, P3 arg3, P4
arg4) {
4376 return ((*obj).*F)(arg1, arg2,
arg3,
arg4);
4383 template <
class R,
class C>
4385 template <R (C::*F)()>
4386 Func1<R, C *, CallMethod0<R, C, F>, FuncInfo<C *, R> > GetFunc() {
4387 return Func1<R, C *, CallMethod0<R, C, F>, FuncInfo<C *, R> >();
4391 template <
class R,
class C,
class P1>
4393 template <R (C::*F)(P1)>
4394 Func2<R, C *, P1, CallMethod1<R, C, P1, F>, FuncInfo<C *, R> > GetFunc() {
4395 return Func2<R, C *, P1, CallMethod1<R, C, P1, F>, FuncInfo<C *, R> >();
4398 template <R (C::*F)(P1)>
4399 BoundFunc2<R, C *, P1, CallMethod1<R, C, P1, F>, FuncInfo<C *, R> > GetFunc(
4401 return BoundFunc2<R, C *, P1, CallMethod1<R, C, P1, F>, FuncInfo<C *, R> >(
4406 template <
class R,
class C,
class P1,
class P2>
4408 template <R (C::*F)(P1, P2)>
4409 Func3<R, C *, P1, P2, CallMethod2<R, C, P1, P2, F>, FuncInfo<C *, R> >
4411 return Func3<R, C *, P1, P2, CallMethod2<R, C, P1, P2, F>,
4412 FuncInfo<C *, R> >();
4415 template <R (C::*F)(P1, P2)>
4416 BoundFunc3<R, C *, P1, P2, CallMethod2<R, C, P1, P2, F>, FuncInfo<C *, R> >
4418 return BoundFunc3<R, C *, P1, P2, CallMethod2<R, C, P1, P2, F>,
4419 FuncInfo<C *, R> >(param1);
4423 template <
class R,
class C,
class P1,
class P2,
class P3>
4425 template <R (C::*F)(P1, P2, P3)>
4426 Func4<R, C *, P1, P2, P3, CallMethod3<R, C, P1, P2, P3, F>, FuncInfo<C *, R> >
4428 return Func4<R, C *, P1, P2, P3, CallMethod3<R, C, P1, P2, P3, F>,
4429 FuncInfo<C *, R> >();
4432 template <R (C::*F)(P1, P2, P3)>
4433 BoundFunc4<R, C *, P1, P2, P3, CallMethod3<R, C, P1, P2, P3, F>,
4436 return BoundFunc4<R, C *, P1, P2, P3, CallMethod3<R, C, P1, P2, P3, F>,
4437 FuncInfo<C *, R> >(param1);
4441 template <
class R,
class C,
class P1,
class P2,
class P3,
class P4>
4443 template <R (C::*F)(P1, P2, P3, P4)>
4444 Func5<R, C *, P1, P2, P3, P4, CallMethod4<R, C, P1, P2, P3, P4, F>,
4447 return Func5<R, C *, P1, P2, P3, P4, CallMethod4<R, C, P1, P2, P3, P4, F>,
4448 FuncInfo<C *, R> >();
4451 template <R (C::*F)(P1, P2, P3, P4)>
4452 BoundFunc5<R, C *, P1, P2, P3, P4, CallMethod4<R, C, P1, P2, P3, P4, F>,
4455 return BoundFunc5<
R, C *, P1, P2, P3, P4,
4456 CallMethod4<R, C, P1, P2, P3, P4, F>, FuncInfo<C *, R> >(
4461 template <
class R,
class C>
4462 inline MethodSig0<R, C> MatchFunc(
R (C::*f)()) {
4464 return MethodSig0<R, C>();
4467 template <
class R,
class C,
class P1>
4468 inline MethodSig1<R, C, P1> MatchFunc(
R (C::*f)(P1)) {
4470 return MethodSig1<R, C, P1>();
4473 template <
class R,
class C,
class P1,
class P2>
4474 inline MethodSig2<R, C, P1, P2> MatchFunc(
R (C::*f)(P1, P2)) {
4476 return MethodSig2<R, C, P1, P2>();
4479 template <
class R,
class C,
class P1,
class P2,
class P3>
4480 inline MethodSig3<R, C, P1, P2, P3> MatchFunc(
R (C::*f)(P1, P2, P3)) {
4482 return MethodSig3<R, C, P1, P2, P3>();
4485 template <
class R,
class C,
class P1,
class P2,
class P3,
class P4>
4486 inline MethodSig4<R, C, P1, P2, P3, P4> MatchFunc(
R (C::*f)(P1, P2, P3, P4)) {
4488 return MethodSig4<R, C, P1, P2, P3, P4>();
4508 template <
class F,
class R,
class Enable =
void>
4509 struct MaybeWrapReturn;
4513 struct MaybeWrapReturn<F, typename F::Return> {
4518 template <
class P1,
class P2,
void F(P1, P2)>
4519 bool ReturnTrue2(P1 p1, P2 p2) {
4524 template <
class P1,
class P2,
class P3,
void F(P1, P2, P3)>
4525 bool ReturnTrue3(P1 p1, P2 p2, P3 p3) {
4531 template <
class P1,
class P2,
void F(P1, P2)>
4532 void *ReturnClosure2(P1 p1, P2 p2) {
4537 template <
class P1,
class P2,
class P3,
void F(P1, P2, P3)>
4538 void *ReturnClosure3(P1 p1, P2 p2, P3 p3) {
4544 template <
class R,
class P1,
class P2, R F(P1, P2)>
4545 void *CastReturnToVoidPtr2(P1 p1, P2 p2) {
4549 template <
class R,
class P1,
class P2,
class P3, R F(P1, P2, P3)>
4550 void *CastReturnToVoidPtr3(P1 p1, P2 p2, P3 p3) {
4551 return F(p1, p2, p3);
4555 template <
class P1,
class P2,
bool F(P1, P2)>
4556 void *ReturnClosureOrBreak2(P1 p1, P2 p2) {
4560 template <
class P1,
class P2,
class P3,
bool F(P1, P2, P3)>
4561 void *ReturnClosureOrBreak3(P1 p1, P2 p2, P3 p3) {
4566 template <
class P1,
class P2,
4567 void F(P1, P2,
const char *,
size_t,
const BufferHandle *)>
4568 size_t ReturnStringLen(P1 p1, P2 p2,
const char *p3,
size_t p4,
4569 const BufferHandle *p5) {
4570 F(p1, p2, p3, p4, p5);
4576 template <
class P1,
class P2,
4577 bool F(P1, P2,
const char *,
size_t,
const BufferHandle *)>
4578 size_t ReturnNOr0(P1 p1, P2 p2,
const char *p3,
size_t p4,
4579 const BufferHandle *p5) {
4580 return F(p1, p2, p3, p4, p5) ? p4 : 0;
4585 template <
class P1,
class P2,
void F(P1, P2),
class I>
4586 struct MaybeWrapReturn<Func2<void, P1, P2, F, I>, bool> {
4587 typedef Func2<bool, P1, P2, ReturnTrue2<P1, P2, F>, I> Func;
4590 template <
class P1,
class P2,
class P3,
void F(P1, P2, P3),
class I>
4591 struct MaybeWrapReturn<Func3<void, P1, P2, P3, F, I>, bool> {
4592 typedef Func3<bool, P1, P2, P3, ReturnTrue3<P1, P2, P3, F>, I> Func;
4597 template <
class P1,
class P2,
void F(P1, P2),
class I>
4598 struct MaybeWrapReturn<Func2<void, P1, P2, F, I>, void *> {
4599 typedef Func2<void *, P1, P2, ReturnClosure2<P1, P2, F>, I> Func;
4602 template <
class P1,
class P2,
class P3,
void F(P1, P2, P3),
class I>
4603 struct MaybeWrapReturn<Func3<void, P1, P2, P3, F, I>, void *> {
4604 typedef Func3<void *, P1, P2, P3, ReturnClosure3<P1, P2, P3, F>, I> Func;
4609 template <
class R,
class P1,
class P2, R *F(P1, P2),
class I>
4610 struct MaybeWrapReturn<Func2<R *, P1, P2,
F, I>,
void *,
4612 typedef Func2<void *, P1, P2, CastReturnToVoidPtr2<R *, P1, P2, F>, I> Func;
4615 template <
class R,
class P1,
class P2,
class P3, R *F(P1, P2, P3),
class I>
4616 struct MaybeWrapReturn<Func3<R *, P1, P2, P3,
F, I>,
void *,
4618 typedef Func3<void *, P1, P2, P3, CastReturnToVoidPtr3<R *, P1, P2, P3, F>, I>
4624 template <
class P1,
class P2,
bool F(P1, P2),
class I>
4625 struct MaybeWrapReturn<Func2<bool, P1, P2, F, I>, void *> {
4626 typedef Func2<void *, P1, P2, ReturnClosureOrBreak2<P1, P2, F>, I> Func;
4629 template <
class P1,
class P2,
class P3,
bool F(P1, P2, P3),
class I>
4630 struct MaybeWrapReturn<Func3<bool, P1, P2, P3, F, I>, void *> {
4631 typedef Func3<void *, P1, P2, P3, ReturnClosureOrBreak3<P1, P2, P3, F>, I>
4637 template <
class P1,
class P2,
4638 void F(P1, P2,
const char *,
size_t,
const BufferHandle *),
class I>
4639 struct MaybeWrapReturn<
4640 Func5<void, P1, P2, const char *,
size_t,
const BufferHandle *,
F, I>,
4642 typedef Func5<
size_t, P1, P2,
const char *,
size_t,
const BufferHandle *,
4643 ReturnStringLen<P1, P2, F>, I> Func;
4648 template <
class P1,
class P2,
4649 bool F(P1, P2,
const char *,
size_t,
const BufferHandle *),
class I>
4650 struct MaybeWrapReturn<
4651 Func5<bool, P1, P2, const char *,
size_t,
const BufferHandle *,
F, I>,
4653 typedef Func5<
size_t, P1, P2,
const char *,
size_t,
const BufferHandle *,
4654 ReturnNOr0<P1, P2, F>, I> Func;
4663 template <
class F,
class T>
4664 struct ConvertParams;
4667 template <
class R,
class P1, R F(P1)>
4668 R IgnoreHandlerData2(
void *p1,
const void *hd) {
4670 return F(static_cast<P1>(p1));
4673 template <
class R,
class P1,
class P2Wrapper,
class P2Wrapped,
4675 R IgnoreHandlerData3(
void *p1,
const void *hd, P2Wrapper p2) {
4677 return F(static_cast<P1>(p1), p2);
4680 template <
class R,
class P1,
class P2,
class P3, R F(P1, P2, P3)>
4681 R IgnoreHandlerData4(
void *p1,
const void *hd, P2 p2, P3 p3) {
4683 return F(static_cast<P1>(p1), p2, p3);
4686 template <
class R,
class P1,
class P2,
class P3,
class P4, R F(P1, P2, P3, P4)>
4687 R IgnoreHandlerData5(
void *p1,
const void *hd, P2 p2, P3 p3, P4 p4) {
4689 return F(static_cast<P1>(p1), p2, p3, p4);
4692 template <
class R,
class P1, R F(P1, const
char*,
size_t)>
4693 R IgnoreHandlerDataIgnoreHandle(
void *p1,
const void *hd,
const char *p2,
4694 size_t p3,
const BufferHandle *
handle) {
4697 return F(static_cast<P1>(p1), p2, p3);
4701 template <
class R,
class P1,
class P2, R F(P1, P2)>
4702 R CastHandlerData2(
void *c,
const void *hd) {
4703 return F(static_cast<P1>(c), static_cast<P2>(hd));
4706 template <
class R,
class P1,
class P2,
class P3Wrapper,
class P3Wrapped,
4707 R
F(P1, P2, P3Wrapped)>
4708 R CastHandlerData3(
void *c,
const void *hd, P3Wrapper p3) {
4709 return F(static_cast<P1>(c), static_cast<P2>(hd), p3);
4712 template <
class R,
class P1,
class P2,
class P3,
class P4,
class P5,
4713 R
F(P1, P2, P3, P4, P5)>
4714 R CastHandlerData5(
void *c,
const void *hd, P3 p3, P4 p4, P5 p5) {
4715 return F(static_cast<P1>(c), static_cast<P2>(hd), p3, p4, p5);
4718 template <
class R,
class P1,
class P2, R F(P1, P2, const
char *,
size_t)>
4719 R CastHandlerDataIgnoreHandle(
void *c,
const void *hd,
const char *p3,
4720 size_t p4,
const BufferHandle *handle) {
4722 return F(static_cast<P1>(c), static_cast<P2>(hd), p3, p4);
4726 template <
class R,
class P1, R F(P1),
class I,
class T>
4727 struct ConvertParams<Func1<R, P1, F, I>, T> {
4728 typedef Func2<R, void *, const void *, IgnoreHandlerData2<R, P1, F>, I> Func;
4731 template <
class R,
class P1,
class P2, R
F(P1, P2),
class I,
4732 class R2,
class P1_2,
class P2_2,
class P3_2>
4733 struct ConvertParams<Func2<R, P1, P2, F, I>,
4734 R2 (*)(P1_2, P2_2, P3_2)> {
4735 typedef Func3<
R,
void *,
const void *, P3_2,
4736 IgnoreHandlerData3<R, P1, P3_2, P2, F>, I> Func;
4741 template <
class R,
class P1, R F(P1, const
char *,
size_t),
class I,
class T>
4742 struct ConvertParams<Func3<R, P1, const char *,
size_t,
F, I>, T> {
4743 typedef Func5<
R,
void *,
const void *,
const char *,
size_t,
4744 const BufferHandle *, IgnoreHandlerDataIgnoreHandle<R, P1, F>,
4748 template <
class R,
class P1,
class P2,
class P3,
class P4, R
F(P1, P2, P3, P4),
4750 struct ConvertParams<Func4<R, P1, P2, P3, P4, F, I>, T> {
4751 typedef Func5<
R,
void *,
const void *, P2, P3, P4,
4752 IgnoreHandlerData5<R, P1, P2, P3, P4, F>, I> Func;
4756 template <
class R,
class P1,
class P2, R F(P1, P2),
class I,
class T>
4757 struct ConvertParams<BoundFunc2<R, P1, P2, F, I>, T> {
4758 typedef Func2<R, void *, const void *, CastHandlerData2<R, P1, P2, F>, I>
4762 template <
class R,
class P1,
class P2,
class P3, R
F(P1, P2, P3),
class I,
4763 class R2,
class P1_2,
class P2_2,
class P3_2>
4764 struct ConvertParams<BoundFunc3<R, P1, P2, P3, F, I>,
4765 R2 (*)(P1_2, P2_2, P3_2)> {
4766 typedef Func3<
R,
void *,
const void *, P3_2,
4767 CastHandlerData3<R, P1, P2, P3_2, P3, F>, I> Func;
4771 template <
class R,
class P1,
class P2, R
F(P1, P2,
const char *,
size_t),
4773 struct ConvertParams<BoundFunc4<R, P1, P2, const char *,
size_t,
F, I>, T> {
4774 typedef Func5<
R,
void *,
const void *,
const char *,
size_t,
4775 const BufferHandle *, CastHandlerDataIgnoreHandle<R, P1, P2, F>,
4779 template <
class R,
class P1,
class P2,
class P3,
class P4,
class P5,
4780 R
F(P1, P2, P3, P4, P5),
class I,
class T>
4781 struct ConvertParams<BoundFunc5<R, P1, P2, P3, P4, P5, F, I>, T> {
4782 typedef Func5<
R,
void *,
const void *, P3, P4, P5,
4783 CastHandlerData5<R, P1, P2, P3, P4, P5, F>, I> Func;
4788 #define TYPE_METHODS(utype, ltype, ctype, vtype) \ 4789 template <> struct CanonicalType<vtype> { \ 4790 typedef ctype Type; \ 4793 inline bool Handlers::SetValueHandler<vtype>( \ 4794 const FieldDef *f, \ 4795 const Handlers::utype ## Handler& handler) { \ 4796 assert(!handler.registered_); \ 4797 handler.AddCleanup(this); \ 4798 handler.registered_ = true; \ 4799 return upb_handlers_set##ltype(this, f, handler.handler_, &handler.attr_); \ 4802 TYPE_METHODS(
Double,
double,
double,
double)
4803 TYPE_METHODS(
Float,
float,
float,
float)
4808 TYPE_METHODS(
Bool,
bool,
bool,
bool)
4810 #ifdef UPB_TWO_32BIT_TYPES 4815 #ifdef UPB_TWO_64BIT_TYPES 4821 template <>
struct CanonicalType<Status*> {
4822 typedef Status*
Type;
4828 #define TYPE_METHODS(utype, ctype) \ 4829 inline bool Handlers::Set##utype##Handler(const FieldDef *f, \ 4830 const utype##Handler &h) { \ 4831 return SetValueHandler<ctype>(f, h); \ 4834 TYPE_METHODS(
Double,
double)
4835 TYPE_METHODS(
Float,
float)
4840 TYPE_METHODS(
Bool,
bool)
4843 template <
class F>
struct ReturnOf;
4845 template <
class R,
class P1,
class P2>
4846 struct ReturnOf<R (*)(P1, P2)> {
4850 template <
class R,
class P1,
class P2,
class P3>
4851 struct ReturnOf<R (*)(P1, P2, P3)> {
4855 template <
class R,
class P1,
class P2,
class P3,
class P4>
4856 struct ReturnOf<R (*)(P1, P2, P3, P4)> {
4860 template <
class R,
class P1,
class P2,
class P3,
class P4,
class P5>
4861 struct ReturnOf<R (*)(P1, P2, P3, P4, P5)> {
4865 template<
class T>
const void *UniquePtrForType() {
4866 static const char ch = 0;
4872 inline Handler<T>::Handler(F
func)
4873 : registered_(
false),
4874 cleanup_data_(func.GetData()),
4875 cleanup_func_(func.GetCleanup()) {
4877 typedef typename ReturnOf<T>::Return Return;
4878 typedef typename ConvertParams<F, T>::Func ConvertedParamsFunc;
4879 typedef typename MaybeWrapReturn<ConvertedParamsFunc, Return>::Func
4881 handler_ = ReturnWrappedFunc().Call;
4889 attr_.SetAlwaysOk(always_ok);
4892 attr_.SetClosureType(UniquePtrForType<typename F::FuncInfo::Closure>());
4900 typedef typename FirstUnlessVoidOrBool<
typename F::FuncInfo::Return,
4901 typename F::FuncInfo::Closure>
::value 4903 attr_.SetReturnClosureType(UniquePtrForType<EffectiveReturn>());
4907 inline Handler<T>::~Handler() {
4908 assert(registered_);
4913 inline bool HandlerAttributes::SetHandlerData(
const void *hd) {
4916 inline const void* HandlerAttributes::handler_data()
const {
4919 inline bool HandlerAttributes::SetClosureType(
const void *type) {
4922 inline const void* HandlerAttributes::closure_type()
const {
4925 inline bool HandlerAttributes::SetReturnClosureType(
const void *type) {
4928 inline const void* HandlerAttributes::return_closure_type()
const {
4931 inline bool HandlerAttributes::SetAlwaysOk(
bool always_ok) {
4934 inline bool HandlerAttributes::always_ok()
const {
4943 inline size_t BufferHandle::object_offset()
const {
4946 inline void BufferHandle::SetBuffer(
const char* buf,
size_t ofs) {
4950 void BufferHandle::SetAttachedObject(
const T* obj) {
4954 const T* BufferHandle::GetAttachedObject()
const {
4960 inline reffed_ptr<Handlers> Handlers::New(
const MessageDef *m) {
4962 return reffed_ptr<Handlers>(
h, &
h);
4964 inline reffed_ptr<const Handlers> Handlers::NewFrozen(
4966 const void *closure) {
4968 return reffed_ptr<const Handlers>(
h, &
h);
4970 inline const Status* Handlers::status() {
4973 inline void Handlers::ClearError() {
4976 inline bool Handlers::Freeze(Status *s) {
4977 upb::Handlers* h =
this;
4980 inline bool Handlers::Freeze(Handlers *
const *handlers,
int n, Status *s) {
4983 inline bool Handlers::Freeze(
const std::vector<Handlers*>& h, Status* status) {
4986 inline const MessageDef *Handlers::message_def()
const {
4992 inline bool Handlers::SetStartMessageHandler(
4993 const Handlers::StartMessageHandler &handler) {
4994 assert(!handler.registered_);
4995 handler.registered_ =
true;
4996 handler.AddCleanup(
this);
4999 inline bool Handlers::SetEndMessageHandler(
5000 const Handlers::EndMessageHandler &handler) {
5001 assert(!handler.registered_);
5002 handler.registered_ =
true;
5003 handler.AddCleanup(
this);
5006 inline bool Handlers::SetStartStringHandler(
const FieldDef *f,
5007 const StartStringHandler &handler) {
5008 assert(!handler.registered_);
5009 handler.registered_ =
true;
5010 handler.AddCleanup(
this);
5013 inline bool Handlers::SetEndStringHandler(
const FieldDef *f,
5014 const EndFieldHandler &handler) {
5015 assert(!handler.registered_);
5016 handler.registered_ =
true;
5017 handler.AddCleanup(
this);
5020 inline bool Handlers::SetStringHandler(
const FieldDef *f,
5021 const StringHandler& handler) {
5022 assert(!handler.registered_);
5023 handler.registered_ =
true;
5024 handler.AddCleanup(
this);
5027 inline bool Handlers::SetStartSequenceHandler(
5028 const FieldDef *f,
const StartFieldHandler &handler) {
5029 assert(!handler.registered_);
5030 handler.registered_ =
true;
5031 handler.AddCleanup(
this);
5034 inline bool Handlers::SetStartSubMessageHandler(
5035 const FieldDef *f,
const StartFieldHandler &handler) {
5036 assert(!handler.registered_);
5037 handler.registered_ =
true;
5038 handler.AddCleanup(
this);
5041 inline bool Handlers::SetEndSubMessageHandler(
const FieldDef *f,
5042 const EndFieldHandler &handler) {
5043 assert(!handler.registered_);
5044 handler.registered_ =
true;
5045 handler.AddCleanup(
this);
5048 inline bool Handlers::SetEndSequenceHandler(
const FieldDef *f,
5049 const EndFieldHandler &handler) {
5050 assert(!handler.registered_);
5051 handler.registered_ =
true;
5052 handler.AddCleanup(
this);
5055 inline bool Handlers::SetSubHandlers(
const FieldDef *f,
const Handlers *sub) {
5058 inline const Handlers *Handlers::GetSubHandlers(
const FieldDef *f)
const {
5061 inline const Handlers *Handlers::GetSubHandlers(Handlers::Selector sel)
const {
5064 inline bool Handlers::GetSelector(
const FieldDef *f,
Handlers::Type type,
5065 Handlers::Selector *s) {
5068 inline Handlers::Selector Handlers::GetEndSelector(Handlers::Selector
start) {
5071 inline Handlers::GenericFunction *Handlers::GetHandler(
5072 Handlers::Selector selector) {
5075 inline const void *Handlers::GetHandlerData(Handlers::Selector selector) {
5079 inline BytesHandler::BytesHandler() {
5083 inline BytesHandler::~BytesHandler() {}
5090 #undef UPB_TWO_32BIT_TYPES 5091 #undef UPB_TWO_64BIT_TYPES 5094 #undef UPB_INT32ALT_T 5095 #undef UPB_UINT32ALT_T 5098 #undef UPB_INT64ALT_T 5099 #undef UPB_UINT64ALT_T 5125 class SeededAllocator;
5139 class upb::Environment {
5161 SetAllocationFunction(allocator->GetAllocationFunction(),
allocator);
5169 void ReportErrorsTo(Status* status);
5180 bool ReportError(
const Status* status);
5186 void* Malloc(
size_t size);
5192 void* Realloc(
void* ptr,
size_t oldsize,
size_t size);
5204 size_t BytesAllocated()
const;
5255 class upb::SeededAllocator {
5257 SeededAllocator(
void *mem,
size_t len);
5311 inline Environment::Environment() {
5314 inline Environment::~Environment() {
5317 inline void Environment::SetAllocationFunction(
upb_alloc_func *alloc,
5321 inline void Environment::SetErrorFunction(
upb_error_func *func,
void *ud) {
5324 inline void Environment::ReportErrorsTo(Status* status) {
5327 inline bool Environment::ok()
const {
5330 inline bool Environment::ReportError(
const Status* status) {
5333 inline void *Environment::Malloc(
size_t size) {
5336 inline void *Environment::Realloc(
void *ptr,
size_t oldsize,
size_t size) {
5342 inline size_t Environment::BytesAllocated()
const {
5346 inline SeededAllocator::SeededAllocator(
void *mem,
size_t len) {
5349 inline SeededAllocator::~SeededAllocator() {
5352 inline void SeededAllocator::SetFallbackAllocator(
upb_alloc_func *alloc,
5356 inline upb_alloc_func *SeededAllocator::GetAllocationFunction() {
5445 template <
class T> Sink(
const Handlers* handlers,
T* closure);
5448 template <
class T>
void Reset(
const Handlers* handlers,
T* closure);
5454 template <
class T>
T* GetObject()
const;
5472 bool StartMessage();
5473 bool EndMessage(Status* status);
5478 bool PutInt32(Handlers::Selector s,
int32_t val);
5479 bool PutInt64(Handlers::Selector s,
int64_t val);
5480 bool PutUInt32(Handlers::Selector s,
uint32_t val);
5481 bool PutUInt64(Handlers::Selector s,
uint64_t val);
5482 bool PutFloat(Handlers::Selector s,
float val);
5483 bool PutDouble(Handlers::Selector s,
double val);
5484 bool PutBool(Handlers::Selector s,
bool val);
5491 bool StartString(Handlers::Selector s,
size_t size_hint, Sink* sub);
5492 size_t PutStringBuffer(Handlers::Selector s,
const char *buf,
size_t len,
5493 const BufferHandle *
handle);
5494 bool EndString(Handlers::Selector s);
5501 bool StartSubMessage(Handlers::Selector s, Sink* sub);
5502 bool EndSubMessage(Handlers::Selector s);
5510 bool StartSequence(Handlers::Selector s, Sink* sub);
5511 bool EndSequence(Handlers::Selector s);
5525 class upb::BytesSink {
5533 template <
class T> BytesSink(
const BytesHandler* handler,
T* closure);
5536 template <
class T>
void Reset(
const BytesHandler* handler,
T* closure);
5538 bool Start(
size_t size_hint,
void **subc);
5539 size_t PutBuffer(
void *subc,
const char *buf,
size_t len,
5540 const BufferHandle *handle);
5555 class upb::BufferSource {
5558 BufferSource(
const char* buf,
size_t len, BytesSink*
sink);
5567 static bool PutBuffer(
const char* buf,
size_t len, BytesSink* sink);
5569 template <
class T>
static bool PutBuffer(
const T& str, BytesSink* sink) {
5570 return PutBuffer(str.c_str(), str.size(),
sink);
5596 if (!start)
return true;
5600 return *subc !=
NULL;
5604 const char *buf,
size_t size,
5611 if (!putbuf)
return true;
5623 if (!end)
return true;
5637 if (ret && len != 0) {
5647 #define PUTVAL(type, ctype) \ 5648 UPB_INLINE bool upb_sink_put##type(upb_sink *s, upb_selector_t sel, \ 5650 typedef upb_##type##_handlerfunc functype; \ 5653 if (!s->handlers) return true; \ 5654 func = (functype *)upb_handlers_gethandler(s->handlers, sel); \ 5655 if (!func) return true; \ 5656 hd = upb_handlers_gethandlerdata(s->handlers, sel); \ 5657 return func(s->closure, hd, val); \ 5675 const char *buf,
size_t n,
5683 if (!handler)
return n;
5685 return handler(s->
closure, hd, buf, n, handle);
5689 typedef upb_startmsg_handlerfunc
func;
5695 if (!startmsg)
return true;
5697 return startmsg(s->
closure, hd);
5707 if (!endmsg)
return true;
5709 return endmsg(s->
closure, hd, status);
5722 if (!startseq)
return true;
5735 if (!endseq)
return true;
5737 return endseq(s->
closure, hd);
5750 if (!startstr)
return true;
5763 if (!endstr)
return true;
5765 return endstr(s->
closure, hd);
5781 if (!startsubmsg)
return true;
5794 if (!endsubmsg)
return s->
closure;
5796 return endsubmsg(s->
closure, hd);
5805 template <
class T> Sink::Sink(
const Handlers* handlers,
T* closure) {
5809 inline void Sink::Reset(
const Handlers* handlers,
T* closure) {
5812 inline bool Sink::StartMessage() {
5815 inline bool Sink::EndMessage(Status* status) {
5818 inline bool Sink::PutInt32(Handlers::Selector sel,
int32_t val) {
5819 return upb_sink_putint32(
this, sel, val);
5821 inline bool Sink::PutInt64(Handlers::Selector sel,
int64_t val) {
5822 return upb_sink_putint64(
this, sel, val);
5824 inline bool Sink::PutUInt32(Handlers::Selector sel,
uint32_t val) {
5825 return upb_sink_putuint32(
this, sel, val);
5827 inline bool Sink::PutUInt64(Handlers::Selector sel,
uint64_t val) {
5828 return upb_sink_putuint64(
this, sel, val);
5830 inline bool Sink::PutFloat(Handlers::Selector sel,
float val) {
5831 return upb_sink_putfloat(
this, sel, val);
5833 inline bool Sink::PutDouble(Handlers::Selector sel,
double val) {
5834 return upb_sink_putdouble(
this, sel, val);
5836 inline bool Sink::PutBool(Handlers::Selector sel,
bool val) {
5837 return upb_sink_putbool(
this, sel, val);
5839 inline bool Sink::StartString(Handlers::Selector sel,
size_t size_hint,
5843 inline size_t Sink::PutStringBuffer(Handlers::Selector sel,
const char *buf,
5844 size_t len,
const BufferHandle* handle) {
5847 inline bool Sink::EndString(Handlers::Selector sel) {
5850 inline bool Sink::StartSubMessage(Handlers::Selector sel, Sink* sub) {
5853 inline bool Sink::EndSubMessage(Handlers::Selector sel) {
5856 inline bool Sink::StartSequence(Handlers::Selector sel, Sink* sub) {
5859 inline bool Sink::EndSequence(Handlers::Selector sel) {
5864 BytesSink::BytesSink(
const BytesHandler* handler,
T* closure) {
5865 Reset(handler, closure);
5875 inline size_t BytesSink::PutBuffer(
void *subc,
const char *buf,
size_t len,
5876 const BufferHandle *handle) {
5883 inline bool BufferSource::PutBuffer(
const char *buf,
size_t len,
5923 static bool Set(Handlers *h,
const FieldDef *f,
size_t ofs,
int32_t hasbit);
5927 static const Data* GetData(
const Handlers* h, Handlers::Selector s,
5948 inline bool Shim::Set(Handlers* h,
const FieldDef* f,
size_t ofs,
5952 inline const Shim::Data* Shim::GetData(
const Handlers* h, Handlers::Selector s,
5972 #ifndef UPB_SYMTAB_H_ 5973 #define UPB_SYMTAB_H_ 5978 namespace upb {
class SymbolTable; }
5993 class upb::SymbolTable {
5997 static reffed_ptr<SymbolTable> New();
6026 const Def* Resolve(
const char*
base,
const char* sym)
const;
6030 const Def* Lookup(
const char *sym)
const;
6031 const MessageDef* LookupMessage(
const char *sym)
const;
6032 const EnumDef* LookupEnum(
const char *sym)
const;
6069 bool Add(Def*
const* defs,
int n,
void* ref_donor,
upb_status* status);
6071 bool Add(
const std::vector<Def*>& defs,
void *owner, Status* status) {
6072 return Add((Def*
const*)&defs[0], defs.size(), owner, status);
6119 inline reffed_ptr<SymbolTable> SymbolTable::New() {
6121 return reffed_ptr<SymbolTable>(
s, &
s);
6124 inline void SymbolTable::Freeze() {
6127 inline const Def *SymbolTable::Resolve(
const char *base,
6128 const char *sym)
const {
6131 inline const Def* SymbolTable::Lookup(
const char *sym)
const {
6134 inline const MessageDef *SymbolTable::LookupMessage(
const char *sym)
const {
6138 Def*
const* defs,
int n,
void* ref_donor,
upb_status* status) {
6151 #ifndef UPB_DESCRIPTOR_H 6152 #define UPB_DESCRIPTOR_H 6191 upb::Def** GetDefs(
void* owner,
int* n);
6194 static Handlers* NewHandlers(
const void* owner);
6220 inline upb::Def** Reader::GetDefs(
void* owner,
int* n) {
6238 #ifndef GOOGLE_PROTOBUF_DESCRIPTOR_UPB_H_ 6239 #define GOOGLE_PROTOBUF_DESCRIPTOR_UPB_H_ 6290 #define SEL_GOOGLE_PROTOBUF_DESCRIPTORPROTO_FIELD_STARTSUBMSG 2 6291 #define SEL_GOOGLE_PROTOBUF_DESCRIPTORPROTO_NESTED_TYPE_STARTSUBMSG 3 6292 #define SEL_GOOGLE_PROTOBUF_DESCRIPTORPROTO_ENUM_TYPE_STARTSUBMSG 4 6293 #define SEL_GOOGLE_PROTOBUF_DESCRIPTORPROTO_EXTENSION_RANGE_STARTSUBMSG 5 6294 #define SEL_GOOGLE_PROTOBUF_DESCRIPTORPROTO_EXTENSION_STARTSUBMSG 6 6295 #define SEL_GOOGLE_PROTOBUF_DESCRIPTORPROTO_OPTIONS_STARTSUBMSG 7 6296 #define SEL_GOOGLE_PROTOBUF_DESCRIPTORPROTO_FIELD_STARTSEQ 8 6297 #define SEL_GOOGLE_PROTOBUF_DESCRIPTORPROTO_FIELD_ENDSEQ 9 6298 #define SEL_GOOGLE_PROTOBUF_DESCRIPTORPROTO_FIELD_ENDSUBMSG 10 6299 #define SEL_GOOGLE_PROTOBUF_DESCRIPTORPROTO_NESTED_TYPE_STARTSEQ 11 6300 #define SEL_GOOGLE_PROTOBUF_DESCRIPTORPROTO_NESTED_TYPE_ENDSEQ 12 6301 #define SEL_GOOGLE_PROTOBUF_DESCRIPTORPROTO_NESTED_TYPE_ENDSUBMSG 13 6302 #define SEL_GOOGLE_PROTOBUF_DESCRIPTORPROTO_ENUM_TYPE_STARTSEQ 14 6303 #define SEL_GOOGLE_PROTOBUF_DESCRIPTORPROTO_ENUM_TYPE_ENDSEQ 15 6304 #define SEL_GOOGLE_PROTOBUF_DESCRIPTORPROTO_ENUM_TYPE_ENDSUBMSG 16 6305 #define SEL_GOOGLE_PROTOBUF_DESCRIPTORPROTO_EXTENSION_RANGE_STARTSEQ 17 6306 #define SEL_GOOGLE_PROTOBUF_DESCRIPTORPROTO_EXTENSION_RANGE_ENDSEQ 18 6307 #define SEL_GOOGLE_PROTOBUF_DESCRIPTORPROTO_EXTENSION_RANGE_ENDSUBMSG 19 6308 #define SEL_GOOGLE_PROTOBUF_DESCRIPTORPROTO_EXTENSION_STARTSEQ 20 6309 #define SEL_GOOGLE_PROTOBUF_DESCRIPTORPROTO_EXTENSION_ENDSEQ 21 6310 #define SEL_GOOGLE_PROTOBUF_DESCRIPTORPROTO_EXTENSION_ENDSUBMSG 22 6311 #define SEL_GOOGLE_PROTOBUF_DESCRIPTORPROTO_OPTIONS_ENDSUBMSG 23 6312 #define SEL_GOOGLE_PROTOBUF_DESCRIPTORPROTO_NAME_STRING 24 6313 #define SEL_GOOGLE_PROTOBUF_DESCRIPTORPROTO_NAME_STARTSTR 25 6314 #define SEL_GOOGLE_PROTOBUF_DESCRIPTORPROTO_NAME_ENDSTR 26 6317 #define SEL_GOOGLE_PROTOBUF_DESCRIPTORPROTO_EXTENSIONRANGE_START_INT32 2 6318 #define SEL_GOOGLE_PROTOBUF_DESCRIPTORPROTO_EXTENSIONRANGE_END_INT32 3 6321 #define SEL_GOOGLE_PROTOBUF_ENUMDESCRIPTORPROTO_VALUE_STARTSUBMSG 2 6322 #define SEL_GOOGLE_PROTOBUF_ENUMDESCRIPTORPROTO_OPTIONS_STARTSUBMSG 3 6323 #define SEL_GOOGLE_PROTOBUF_ENUMDESCRIPTORPROTO_VALUE_STARTSEQ 4 6324 #define SEL_GOOGLE_PROTOBUF_ENUMDESCRIPTORPROTO_VALUE_ENDSEQ 5 6325 #define SEL_GOOGLE_PROTOBUF_ENUMDESCRIPTORPROTO_VALUE_ENDSUBMSG 6 6326 #define SEL_GOOGLE_PROTOBUF_ENUMDESCRIPTORPROTO_OPTIONS_ENDSUBMSG 7 6327 #define SEL_GOOGLE_PROTOBUF_ENUMDESCRIPTORPROTO_NAME_STRING 8 6328 #define SEL_GOOGLE_PROTOBUF_ENUMDESCRIPTORPROTO_NAME_STARTSTR 9 6329 #define SEL_GOOGLE_PROTOBUF_ENUMDESCRIPTORPROTO_NAME_ENDSTR 10 6332 #define SEL_GOOGLE_PROTOBUF_ENUMOPTIONS_UNINTERPRETED_OPTION_STARTSUBMSG 2 6333 #define SEL_GOOGLE_PROTOBUF_ENUMOPTIONS_UNINTERPRETED_OPTION_STARTSEQ 3 6334 #define SEL_GOOGLE_PROTOBUF_ENUMOPTIONS_UNINTERPRETED_OPTION_ENDSEQ 4 6335 #define SEL_GOOGLE_PROTOBUF_ENUMOPTIONS_UNINTERPRETED_OPTION_ENDSUBMSG 5 6336 #define SEL_GOOGLE_PROTOBUF_ENUMOPTIONS_ALLOW_ALIAS_BOOL 6 6339 #define SEL_GOOGLE_PROTOBUF_ENUMVALUEDESCRIPTORPROTO_OPTIONS_STARTSUBMSG 2 6340 #define SEL_GOOGLE_PROTOBUF_ENUMVALUEDESCRIPTORPROTO_OPTIONS_ENDSUBMSG 3 6341 #define SEL_GOOGLE_PROTOBUF_ENUMVALUEDESCRIPTORPROTO_NAME_STRING 4 6342 #define SEL_GOOGLE_PROTOBUF_ENUMVALUEDESCRIPTORPROTO_NAME_STARTSTR 5 6343 #define SEL_GOOGLE_PROTOBUF_ENUMVALUEDESCRIPTORPROTO_NAME_ENDSTR 6 6344 #define SEL_GOOGLE_PROTOBUF_ENUMVALUEDESCRIPTORPROTO_NUMBER_INT32 7 6347 #define SEL_GOOGLE_PROTOBUF_ENUMVALUEOPTIONS_UNINTERPRETED_OPTION_STARTSUBMSG 2 6348 #define SEL_GOOGLE_PROTOBUF_ENUMVALUEOPTIONS_UNINTERPRETED_OPTION_STARTSEQ 3 6349 #define SEL_GOOGLE_PROTOBUF_ENUMVALUEOPTIONS_UNINTERPRETED_OPTION_ENDSEQ 4 6350 #define SEL_GOOGLE_PROTOBUF_ENUMVALUEOPTIONS_UNINTERPRETED_OPTION_ENDSUBMSG 5 6353 #define SEL_GOOGLE_PROTOBUF_FIELDDESCRIPTORPROTO_OPTIONS_STARTSUBMSG 2 6354 #define SEL_GOOGLE_PROTOBUF_FIELDDESCRIPTORPROTO_OPTIONS_ENDSUBMSG 3 6355 #define SEL_GOOGLE_PROTOBUF_FIELDDESCRIPTORPROTO_NAME_STRING 4 6356 #define SEL_GOOGLE_PROTOBUF_FIELDDESCRIPTORPROTO_NAME_STARTSTR 5 6357 #define SEL_GOOGLE_PROTOBUF_FIELDDESCRIPTORPROTO_NAME_ENDSTR 6 6358 #define SEL_GOOGLE_PROTOBUF_FIELDDESCRIPTORPROTO_EXTENDEE_STRING 7 6359 #define SEL_GOOGLE_PROTOBUF_FIELDDESCRIPTORPROTO_EXTENDEE_STARTSTR 8 6360 #define SEL_GOOGLE_PROTOBUF_FIELDDESCRIPTORPROTO_EXTENDEE_ENDSTR 9 6361 #define SEL_GOOGLE_PROTOBUF_FIELDDESCRIPTORPROTO_NUMBER_INT32 10 6362 #define SEL_GOOGLE_PROTOBUF_FIELDDESCRIPTORPROTO_LABEL_INT32 11 6363 #define SEL_GOOGLE_PROTOBUF_FIELDDESCRIPTORPROTO_TYPE_INT32 12 6364 #define SEL_GOOGLE_PROTOBUF_FIELDDESCRIPTORPROTO_TYPE_NAME_STRING 13 6365 #define SEL_GOOGLE_PROTOBUF_FIELDDESCRIPTORPROTO_TYPE_NAME_STARTSTR 14 6366 #define SEL_GOOGLE_PROTOBUF_FIELDDESCRIPTORPROTO_TYPE_NAME_ENDSTR 15 6367 #define SEL_GOOGLE_PROTOBUF_FIELDDESCRIPTORPROTO_DEFAULT_VALUE_STRING 16 6368 #define SEL_GOOGLE_PROTOBUF_FIELDDESCRIPTORPROTO_DEFAULT_VALUE_STARTSTR 17 6369 #define SEL_GOOGLE_PROTOBUF_FIELDDESCRIPTORPROTO_DEFAULT_VALUE_ENDSTR 18 6372 #define SEL_GOOGLE_PROTOBUF_FIELDOPTIONS_UNINTERPRETED_OPTION_STARTSUBMSG 2 6373 #define SEL_GOOGLE_PROTOBUF_FIELDOPTIONS_UNINTERPRETED_OPTION_STARTSEQ 3 6374 #define SEL_GOOGLE_PROTOBUF_FIELDOPTIONS_UNINTERPRETED_OPTION_ENDSEQ 4 6375 #define SEL_GOOGLE_PROTOBUF_FIELDOPTIONS_UNINTERPRETED_OPTION_ENDSUBMSG 5 6376 #define SEL_GOOGLE_PROTOBUF_FIELDOPTIONS_CTYPE_INT32 6 6377 #define SEL_GOOGLE_PROTOBUF_FIELDOPTIONS_PACKED_BOOL 7 6378 #define SEL_GOOGLE_PROTOBUF_FIELDOPTIONS_DEPRECATED_BOOL 8 6379 #define SEL_GOOGLE_PROTOBUF_FIELDOPTIONS_LAZY_BOOL 9 6380 #define SEL_GOOGLE_PROTOBUF_FIELDOPTIONS_EXPERIMENTAL_MAP_KEY_STRING 10 6381 #define SEL_GOOGLE_PROTOBUF_FIELDOPTIONS_EXPERIMENTAL_MAP_KEY_STARTSTR 11 6382 #define SEL_GOOGLE_PROTOBUF_FIELDOPTIONS_EXPERIMENTAL_MAP_KEY_ENDSTR 12 6383 #define SEL_GOOGLE_PROTOBUF_FIELDOPTIONS_WEAK_BOOL 13 6386 #define SEL_GOOGLE_PROTOBUF_FILEDESCRIPTORPROTO_MESSAGE_TYPE_STARTSUBMSG 2 6387 #define SEL_GOOGLE_PROTOBUF_FILEDESCRIPTORPROTO_ENUM_TYPE_STARTSUBMSG 3 6388 #define SEL_GOOGLE_PROTOBUF_FILEDESCRIPTORPROTO_SERVICE_STARTSUBMSG 4 6389 #define SEL_GOOGLE_PROTOBUF_FILEDESCRIPTORPROTO_EXTENSION_STARTSUBMSG 5 6390 #define SEL_GOOGLE_PROTOBUF_FILEDESCRIPTORPROTO_OPTIONS_STARTSUBMSG 6 6391 #define SEL_GOOGLE_PROTOBUF_FILEDESCRIPTORPROTO_SOURCE_CODE_INFO_STARTSUBMSG 7 6392 #define SEL_GOOGLE_PROTOBUF_FILEDESCRIPTORPROTO_MESSAGE_TYPE_STARTSEQ 8 6393 #define SEL_GOOGLE_PROTOBUF_FILEDESCRIPTORPROTO_MESSAGE_TYPE_ENDSEQ 9 6394 #define SEL_GOOGLE_PROTOBUF_FILEDESCRIPTORPROTO_MESSAGE_TYPE_ENDSUBMSG 10 6395 #define SEL_GOOGLE_PROTOBUF_FILEDESCRIPTORPROTO_ENUM_TYPE_STARTSEQ 11 6396 #define SEL_GOOGLE_PROTOBUF_FILEDESCRIPTORPROTO_ENUM_TYPE_ENDSEQ 12 6397 #define SEL_GOOGLE_PROTOBUF_FILEDESCRIPTORPROTO_ENUM_TYPE_ENDSUBMSG 13 6398 #define SEL_GOOGLE_PROTOBUF_FILEDESCRIPTORPROTO_SERVICE_STARTSEQ 14 6399 #define SEL_GOOGLE_PROTOBUF_FILEDESCRIPTORPROTO_SERVICE_ENDSEQ 15 6400 #define SEL_GOOGLE_PROTOBUF_FILEDESCRIPTORPROTO_SERVICE_ENDSUBMSG 16 6401 #define SEL_GOOGLE_PROTOBUF_FILEDESCRIPTORPROTO_EXTENSION_STARTSEQ 17 6402 #define SEL_GOOGLE_PROTOBUF_FILEDESCRIPTORPROTO_EXTENSION_ENDSEQ 18 6403 #define SEL_GOOGLE_PROTOBUF_FILEDESCRIPTORPROTO_EXTENSION_ENDSUBMSG 19 6404 #define SEL_GOOGLE_PROTOBUF_FILEDESCRIPTORPROTO_OPTIONS_ENDSUBMSG 20 6405 #define SEL_GOOGLE_PROTOBUF_FILEDESCRIPTORPROTO_SOURCE_CODE_INFO_ENDSUBMSG 21 6406 #define SEL_GOOGLE_PROTOBUF_FILEDESCRIPTORPROTO_NAME_STRING 22 6407 #define SEL_GOOGLE_PROTOBUF_FILEDESCRIPTORPROTO_NAME_STARTSTR 23 6408 #define SEL_GOOGLE_PROTOBUF_FILEDESCRIPTORPROTO_NAME_ENDSTR 24 6409 #define SEL_GOOGLE_PROTOBUF_FILEDESCRIPTORPROTO_PACKAGE_STRING 25 6410 #define SEL_GOOGLE_PROTOBUF_FILEDESCRIPTORPROTO_PACKAGE_STARTSTR 26 6411 #define SEL_GOOGLE_PROTOBUF_FILEDESCRIPTORPROTO_PACKAGE_ENDSTR 27 6412 #define SEL_GOOGLE_PROTOBUF_FILEDESCRIPTORPROTO_DEPENDENCY_STARTSEQ 28 6413 #define SEL_GOOGLE_PROTOBUF_FILEDESCRIPTORPROTO_DEPENDENCY_ENDSEQ 29 6414 #define SEL_GOOGLE_PROTOBUF_FILEDESCRIPTORPROTO_DEPENDENCY_STRING 30 6415 #define SEL_GOOGLE_PROTOBUF_FILEDESCRIPTORPROTO_DEPENDENCY_STARTSTR 31 6416 #define SEL_GOOGLE_PROTOBUF_FILEDESCRIPTORPROTO_DEPENDENCY_ENDSTR 32 6417 #define SEL_GOOGLE_PROTOBUF_FILEDESCRIPTORPROTO_PUBLIC_DEPENDENCY_STARTSEQ 33 6418 #define SEL_GOOGLE_PROTOBUF_FILEDESCRIPTORPROTO_PUBLIC_DEPENDENCY_ENDSEQ 34 6419 #define SEL_GOOGLE_PROTOBUF_FILEDESCRIPTORPROTO_PUBLIC_DEPENDENCY_INT32 35 6420 #define SEL_GOOGLE_PROTOBUF_FILEDESCRIPTORPROTO_WEAK_DEPENDENCY_STARTSEQ 36 6421 #define SEL_GOOGLE_PROTOBUF_FILEDESCRIPTORPROTO_WEAK_DEPENDENCY_ENDSEQ 37 6422 #define SEL_GOOGLE_PROTOBUF_FILEDESCRIPTORPROTO_WEAK_DEPENDENCY_INT32 38 6425 #define SEL_GOOGLE_PROTOBUF_FILEDESCRIPTORSET_FILE_STARTSUBMSG 2 6426 #define SEL_GOOGLE_PROTOBUF_FILEDESCRIPTORSET_FILE_STARTSEQ 3 6427 #define SEL_GOOGLE_PROTOBUF_FILEDESCRIPTORSET_FILE_ENDSEQ 4 6428 #define SEL_GOOGLE_PROTOBUF_FILEDESCRIPTORSET_FILE_ENDSUBMSG 5 6431 #define SEL_GOOGLE_PROTOBUF_FILEOPTIONS_UNINTERPRETED_OPTION_STARTSUBMSG 2 6432 #define SEL_GOOGLE_PROTOBUF_FILEOPTIONS_UNINTERPRETED_OPTION_STARTSEQ 3 6433 #define SEL_GOOGLE_PROTOBUF_FILEOPTIONS_UNINTERPRETED_OPTION_ENDSEQ 4 6434 #define SEL_GOOGLE_PROTOBUF_FILEOPTIONS_UNINTERPRETED_OPTION_ENDSUBMSG 5 6435 #define SEL_GOOGLE_PROTOBUF_FILEOPTIONS_JAVA_PACKAGE_STRING 6 6436 #define SEL_GOOGLE_PROTOBUF_FILEOPTIONS_JAVA_PACKAGE_STARTSTR 7 6437 #define SEL_GOOGLE_PROTOBUF_FILEOPTIONS_JAVA_PACKAGE_ENDSTR 8 6438 #define SEL_GOOGLE_PROTOBUF_FILEOPTIONS_JAVA_OUTER_CLASSNAME_STRING 9 6439 #define SEL_GOOGLE_PROTOBUF_FILEOPTIONS_JAVA_OUTER_CLASSNAME_STARTSTR 10 6440 #define SEL_GOOGLE_PROTOBUF_FILEOPTIONS_JAVA_OUTER_CLASSNAME_ENDSTR 11 6441 #define SEL_GOOGLE_PROTOBUF_FILEOPTIONS_OPTIMIZE_FOR_INT32 12 6442 #define SEL_GOOGLE_PROTOBUF_FILEOPTIONS_JAVA_MULTIPLE_FILES_BOOL 13 6443 #define SEL_GOOGLE_PROTOBUF_FILEOPTIONS_GO_PACKAGE_STRING 14 6444 #define SEL_GOOGLE_PROTOBUF_FILEOPTIONS_GO_PACKAGE_STARTSTR 15 6445 #define SEL_GOOGLE_PROTOBUF_FILEOPTIONS_GO_PACKAGE_ENDSTR 16 6446 #define SEL_GOOGLE_PROTOBUF_FILEOPTIONS_CC_GENERIC_SERVICES_BOOL 17 6447 #define SEL_GOOGLE_PROTOBUF_FILEOPTIONS_JAVA_GENERIC_SERVICES_BOOL 18 6448 #define SEL_GOOGLE_PROTOBUF_FILEOPTIONS_PY_GENERIC_SERVICES_BOOL 19 6449 #define SEL_GOOGLE_PROTOBUF_FILEOPTIONS_JAVA_GENERATE_EQUALS_AND_HASH_BOOL 20 6452 #define SEL_GOOGLE_PROTOBUF_MESSAGEOPTIONS_UNINTERPRETED_OPTION_STARTSUBMSG 2 6453 #define SEL_GOOGLE_PROTOBUF_MESSAGEOPTIONS_UNINTERPRETED_OPTION_STARTSEQ 3 6454 #define SEL_GOOGLE_PROTOBUF_MESSAGEOPTIONS_UNINTERPRETED_OPTION_ENDSEQ 4 6455 #define SEL_GOOGLE_PROTOBUF_MESSAGEOPTIONS_UNINTERPRETED_OPTION_ENDSUBMSG 5 6456 #define SEL_GOOGLE_PROTOBUF_MESSAGEOPTIONS_MESSAGE_SET_WIRE_FORMAT_BOOL 6 6457 #define SEL_GOOGLE_PROTOBUF_MESSAGEOPTIONS_NO_STANDARD_DESCRIPTOR_ACCESSOR_BOOL 7 6460 #define SEL_GOOGLE_PROTOBUF_METHODDESCRIPTORPROTO_OPTIONS_STARTSUBMSG 2 6461 #define SEL_GOOGLE_PROTOBUF_METHODDESCRIPTORPROTO_OPTIONS_ENDSUBMSG 3 6462 #define SEL_GOOGLE_PROTOBUF_METHODDESCRIPTORPROTO_NAME_STRING 4 6463 #define SEL_GOOGLE_PROTOBUF_METHODDESCRIPTORPROTO_NAME_STARTSTR 5 6464 #define SEL_GOOGLE_PROTOBUF_METHODDESCRIPTORPROTO_NAME_ENDSTR 6 6465 #define SEL_GOOGLE_PROTOBUF_METHODDESCRIPTORPROTO_INPUT_TYPE_STRING 7 6466 #define SEL_GOOGLE_PROTOBUF_METHODDESCRIPTORPROTO_INPUT_TYPE_STARTSTR 8 6467 #define SEL_GOOGLE_PROTOBUF_METHODDESCRIPTORPROTO_INPUT_TYPE_ENDSTR 9 6468 #define SEL_GOOGLE_PROTOBUF_METHODDESCRIPTORPROTO_OUTPUT_TYPE_STRING 10 6469 #define SEL_GOOGLE_PROTOBUF_METHODDESCRIPTORPROTO_OUTPUT_TYPE_STARTSTR 11 6470 #define SEL_GOOGLE_PROTOBUF_METHODDESCRIPTORPROTO_OUTPUT_TYPE_ENDSTR 12 6473 #define SEL_GOOGLE_PROTOBUF_METHODOPTIONS_UNINTERPRETED_OPTION_STARTSUBMSG 2 6474 #define SEL_GOOGLE_PROTOBUF_METHODOPTIONS_UNINTERPRETED_OPTION_STARTSEQ 3 6475 #define SEL_GOOGLE_PROTOBUF_METHODOPTIONS_UNINTERPRETED_OPTION_ENDSEQ 4 6476 #define SEL_GOOGLE_PROTOBUF_METHODOPTIONS_UNINTERPRETED_OPTION_ENDSUBMSG 5 6479 #define SEL_GOOGLE_PROTOBUF_SERVICEDESCRIPTORPROTO_METHOD_STARTSUBMSG 2 6480 #define SEL_GOOGLE_PROTOBUF_SERVICEDESCRIPTORPROTO_OPTIONS_STARTSUBMSG 3 6481 #define SEL_GOOGLE_PROTOBUF_SERVICEDESCRIPTORPROTO_METHOD_STARTSEQ 4 6482 #define SEL_GOOGLE_PROTOBUF_SERVICEDESCRIPTORPROTO_METHOD_ENDSEQ 5 6483 #define SEL_GOOGLE_PROTOBUF_SERVICEDESCRIPTORPROTO_METHOD_ENDSUBMSG 6 6484 #define SEL_GOOGLE_PROTOBUF_SERVICEDESCRIPTORPROTO_OPTIONS_ENDSUBMSG 7 6485 #define SEL_GOOGLE_PROTOBUF_SERVICEDESCRIPTORPROTO_NAME_STRING 8 6486 #define SEL_GOOGLE_PROTOBUF_SERVICEDESCRIPTORPROTO_NAME_STARTSTR 9 6487 #define SEL_GOOGLE_PROTOBUF_SERVICEDESCRIPTORPROTO_NAME_ENDSTR 10 6490 #define SEL_GOOGLE_PROTOBUF_SERVICEOPTIONS_UNINTERPRETED_OPTION_STARTSUBMSG 2 6491 #define SEL_GOOGLE_PROTOBUF_SERVICEOPTIONS_UNINTERPRETED_OPTION_STARTSEQ 3 6492 #define SEL_GOOGLE_PROTOBUF_SERVICEOPTIONS_UNINTERPRETED_OPTION_ENDSEQ 4 6493 #define SEL_GOOGLE_PROTOBUF_SERVICEOPTIONS_UNINTERPRETED_OPTION_ENDSUBMSG 5 6496 #define SEL_GOOGLE_PROTOBUF_SOURCECODEINFO_LOCATION_STARTSUBMSG 2 6497 #define SEL_GOOGLE_PROTOBUF_SOURCECODEINFO_LOCATION_STARTSEQ 3 6498 #define SEL_GOOGLE_PROTOBUF_SOURCECODEINFO_LOCATION_ENDSEQ 4 6499 #define SEL_GOOGLE_PROTOBUF_SOURCECODEINFO_LOCATION_ENDSUBMSG 5 6502 #define SEL_GOOGLE_PROTOBUF_SOURCECODEINFO_LOCATION_PATH_STARTSEQ 2 6503 #define SEL_GOOGLE_PROTOBUF_SOURCECODEINFO_LOCATION_PATH_ENDSEQ 3 6504 #define SEL_GOOGLE_PROTOBUF_SOURCECODEINFO_LOCATION_PATH_INT32 4 6505 #define SEL_GOOGLE_PROTOBUF_SOURCECODEINFO_LOCATION_SPAN_STARTSEQ 5 6506 #define SEL_GOOGLE_PROTOBUF_SOURCECODEINFO_LOCATION_SPAN_ENDSEQ 6 6507 #define SEL_GOOGLE_PROTOBUF_SOURCECODEINFO_LOCATION_SPAN_INT32 7 6508 #define SEL_GOOGLE_PROTOBUF_SOURCECODEINFO_LOCATION_LEADING_COMMENTS_STRING 8 6509 #define SEL_GOOGLE_PROTOBUF_SOURCECODEINFO_LOCATION_LEADING_COMMENTS_STARTSTR 9 6510 #define SEL_GOOGLE_PROTOBUF_SOURCECODEINFO_LOCATION_LEADING_COMMENTS_ENDSTR 10 6511 #define SEL_GOOGLE_PROTOBUF_SOURCECODEINFO_LOCATION_TRAILING_COMMENTS_STRING 11 6512 #define SEL_GOOGLE_PROTOBUF_SOURCECODEINFO_LOCATION_TRAILING_COMMENTS_STARTSTR 12 6513 #define SEL_GOOGLE_PROTOBUF_SOURCECODEINFO_LOCATION_TRAILING_COMMENTS_ENDSTR 13 6516 #define SEL_GOOGLE_PROTOBUF_UNINTERPRETEDOPTION_NAME_STARTSUBMSG 2 6517 #define SEL_GOOGLE_PROTOBUF_UNINTERPRETEDOPTION_NAME_STARTSEQ 3 6518 #define SEL_GOOGLE_PROTOBUF_UNINTERPRETEDOPTION_NAME_ENDSEQ 4 6519 #define SEL_GOOGLE_PROTOBUF_UNINTERPRETEDOPTION_NAME_ENDSUBMSG 5 6520 #define SEL_GOOGLE_PROTOBUF_UNINTERPRETEDOPTION_IDENTIFIER_VALUE_STRING 6 6521 #define SEL_GOOGLE_PROTOBUF_UNINTERPRETEDOPTION_IDENTIFIER_VALUE_STARTSTR 7 6522 #define SEL_GOOGLE_PROTOBUF_UNINTERPRETEDOPTION_IDENTIFIER_VALUE_ENDSTR 8 6523 #define SEL_GOOGLE_PROTOBUF_UNINTERPRETEDOPTION_POSITIVE_INT_VALUE_UINT64 9 6524 #define SEL_GOOGLE_PROTOBUF_UNINTERPRETEDOPTION_NEGATIVE_INT_VALUE_INT64 10 6525 #define SEL_GOOGLE_PROTOBUF_UNINTERPRETEDOPTION_DOUBLE_VALUE_DOUBLE 11 6526 #define SEL_GOOGLE_PROTOBUF_UNINTERPRETEDOPTION_STRING_VALUE_STRING 12 6527 #define SEL_GOOGLE_PROTOBUF_UNINTERPRETEDOPTION_STRING_VALUE_STARTSTR 13 6528 #define SEL_GOOGLE_PROTOBUF_UNINTERPRETEDOPTION_STRING_VALUE_ENDSTR 14 6529 #define SEL_GOOGLE_PROTOBUF_UNINTERPRETEDOPTION_AGGREGATE_VALUE_STRING 15 6530 #define SEL_GOOGLE_PROTOBUF_UNINTERPRETEDOPTION_AGGREGATE_VALUE_STARTSTR 16 6531 #define SEL_GOOGLE_PROTOBUF_UNINTERPRETEDOPTION_AGGREGATE_VALUE_ENDSTR 17 6534 #define SEL_GOOGLE_PROTOBUF_UNINTERPRETEDOPTION_NAMEPART_NAME_PART_STRING 2 6535 #define SEL_GOOGLE_PROTOBUF_UNINTERPRETEDOPTION_NAMEPART_NAME_PART_STARTSTR 3 6536 #define SEL_GOOGLE_PROTOBUF_UNINTERPRETEDOPTION_NAMEPART_NAME_PART_ENDSTR 4 6537 #define SEL_GOOGLE_PROTOBUF_UNINTERPRETEDOPTION_NAMEPART_IS_EXTENSION_BOOL 5 6756 inline upb::reffed_ptr<const upb::SymbolTable> SymbolTable() {
6758 return upb::reffed_ptr<const upb::SymbolTable>(
s, &
s);
6764 #define RETURN_REFFED(type, func) \ 6765 const type* obj = func(upbdefs::google::protobuf::descriptor::SymbolTable().get()); \ 6766 return upb::reffed_ptr<const type>(obj); 6786 namespace ExtensionRange {
7010 namespace NamePart {
7022 #undef RETURN_REFFED 7030 #ifndef UPB_DECODER_INT_H_ 7031 #define UPB_DECODER_INT_H_ 7048 #ifndef UPB_DECODER_H_ 7049 #define UPB_DECODER_H_ 7057 class DecoderMethod;
7058 class DecoderMethodOptions;
7075 class upb::pb::DecoderMethodOptions {
7079 explicit DecoderMethodOptions(
const Handlers* dest_handlers);
7084 void set_lazy(
bool lazy);
7086 struct upb_pbdecodermethodopts {
7088 const upb_handlers *handlers;
7096 class upb::pb::DecoderMethod {
7104 const Handlers* dest_handlers()
const;
7107 const BytesHandler* input_handler()
const;
7110 bool is_native()
const;
7114 static reffed_ptr<const DecoderMethod> New(
const DecoderMethodOptions& opts);
7126 #define UPB_PB_DECODER_SIZE 4408 7132 class upb::pb::Decoder {
7143 const DecoderMethod* method()
const;
7164 size_t max_nesting()
const;
7165 bool set_max_nesting(
size_t max);
7185 class upb::pb::CodeCache {
7197 bool allow_jit()
const;
7201 bool set_allow_jit(
bool allow);
7211 const DecoderMethod *GetDecoderMethod(
const DecoderMethodOptions& opts);
7230 const upb_pbdecodermethod *
method,
7240 const upb_handlers *h);
7248 const upb_pbdecodermethod *m);
7250 const upb_pbdecodermethod *m);
7253 const upb_pbdecodermethodopts *opts,
const void *owner);
7275 inline const DecoderMethod* Decoder::method()
const {
7281 inline uint64_t Decoder::BytesParsed()
const {
7284 inline size_t Decoder::max_nesting()
const {
7287 inline bool Decoder::set_max_nesting(
size_t max) {
7292 inline DecoderMethodOptions::DecoderMethodOptions(
const Handlers* h) {
7295 inline void DecoderMethodOptions::set_lazy(
bool lazy) {
7299 inline const Handlers* DecoderMethod::dest_handlers()
const {
7302 inline const BytesHandler* DecoderMethod::input_handler()
const {
7305 inline bool DecoderMethod::is_native()
const {
7309 inline reffed_ptr<const DecoderMethod> DecoderMethod::New(
7310 const DecoderMethodOptions &opts) {
7312 return reffed_ptr<const DecoderMethod>(
m, &
m);
7315 inline CodeCache::CodeCache() {
7318 inline CodeCache::~CodeCache() {
7321 inline bool CodeCache::allow_jit()
const {
7324 inline bool CodeCache::set_allow_jit(
bool allow) {
7327 inline const DecoderMethod *CodeCache::GetDecoderMethod(
7328 const DecoderMethodOptions& opts) {
7364 #define T(type) OP_PARSE_ ## type = UPB_DESCRIPTOR_TYPE_ ## type 7365 T(
DOUBLE),
T(FLOAT),
T(INT64),
T(UINT64),
T(INT32),
T(FIXED64),
T(FIXED32),
7366 T(
BOOL),
T(UINT32),
T(SFIXED32),
T(SFIXED64),
T(SINT32),
T(SINT64),
7372 OP_STARTSUBMSG = 14,
7378 OP_PUSHTAGDELIM = 23,
7379 OP_PUSHLENDELIM = 24,
7382 OP_SETBIGGROUPNUM = 27,
7398 OP_SETDISPATCH = 35,
7407 #define OP_MAX OP_HALT 7439 #ifdef UPB_USE_JIT_X64 7457 #define UPB_DECODER_MAX_NESTING 64 7486 struct upb_pbdecodermethod {
7569 #ifdef UPB_USE_JIT_X64 7574 const void *saved_rsp;
7611 #define LABEL_DISPATCH 0 7615 #define DISPATCH_ENDMSG 0 7619 #define NO_WIRE_TYPE 0xff 7636 return (ofs << 16) | (wt2 << 8) | wt1;
7642 *wt2 = (
uint8_t)(dispatch >> 8);
7643 *ofs = dispatch >> 16;
7653 #define DECODE_OK -1 7654 #define DECODE_MISMATCH -2 7655 #define DECODE_ENDGROUP -3 7657 #define CHECK_RETURN(x) { int32_t ret = x; if (ret >= 0) return ret; } 7665 #ifndef UPB_VARINT_DECODER_H_ 7666 #define UPB_VARINT_DECODER_H_ 7686 #define UPB_MAX_WIRE_TYPE 5 7691 #define UPB_PB_VARINT_MAX_LEN 10 7700 return (n >> 1) ^ -(
int32_t)(n & 1);
7703 return (n >> 1) ^ -(
int64_t)(n & 1);
7738 #define UPB_VARINT_DECODER_CHECK2(name, decode_max8_function) \ 7739 UPB_INLINE upb_decoderet upb_vdecode_check2_ ## name(const char *_p) { \ 7740 uint8_t *p = (uint8_t*)_p; \ 7742 if ((*p & 0x80) == 0) { \ 7744 return upb_decoderet_make(_p + 1, *p & 0x7fU); \ 7746 r = upb_decoderet_make(_p + 2, (*p & 0x7fU) | ((*(p + 1) & 0x7fU) << 7)); \ 7747 if ((*(p + 1) & 0x80) == 0) { \ 7752 return decode_max8_function(r); \ 7759 #undef UPB_VARINT_DECODER_CHECK2 7764 if (
sizeof(
long) == 8)
7765 return upb_vdecode_check2_branch64(p);
7767 return upb_vdecode_check2_branch32(p);
7779 int high_bit = 63 - __builtin_clzll(val);
7783 while(tmp >>= 1) high_bit++;
7785 return val == 0 ? 1 : high_bit / 8 + 1;
7794 if (val == 0) { buf[0] = 0;
return 1; }
7799 if (val) byte |= 0x80
U;
7816 memcpy(&ret, buf, bytes);
7817 assert(ret <= 0xffffffffffU);
7837 #ifndef UPB_ENCODER_H_ 7838 #define UPB_ENCODER_H_ 7851 #define UPB_PBENCODER_MAX_NESTING 100 7859 #define UPB_PB_ENCODER_SIZE 768 7863 class upb::pb::Encoder {
7867 static Encoder*
Create(Environment*
env,
const Handlers* handlers,
7874 static reffed_ptr<const Handlers> NewHandlers(
const MessageDef* msg);
7899 BytesSink* output) {
7905 inline reffed_ptr<const Handlers> Encoder::NewHandlers(
7906 const upb::MessageDef *md) {
7908 return reffed_ptr<const Handlers>(
h, &
h);
7939 #include <stdbool.h> 7971 inline bool LoadDescriptorFileIntoSymtab(SymbolTable* s,
const char *fname,
7976 inline bool LoadDescriptorIntoSymtab(SymbolTable* s,
const char* str,
7977 size_t len, Status* status) {
7982 template <
typename T>
7983 bool LoadDescriptorIntoSymtab(SymbolTable* s,
const T&
desc, Status* status) {
8014 class upb::pb::TextPrinter {
8018 static TextPrinter *
Create(Environment *
env,
const upb::Handlers *handlers,
8021 void SetSingleLineMode(
bool single_line);
8027 static reffed_ptr<const Handlers> NewHandlers(
const MessageDef* md);
8050 const upb::Handlers *handlers,
8051 BytesSink *output) {
8054 inline void TextPrinter::SetSingleLineMode(
bool single_line) {
8060 inline reffed_ptr<const Handlers> TextPrinter::NewHandlers(
8061 const MessageDef *md) {
8063 return reffed_ptr<const Handlers>(
h, &
h);
8078 #ifndef UPB_JSON_PARSER_H_ 8079 #define UPB_JSON_PARSER_H_ 8098 #define UPB_JSON_PARSER_SIZE 3704 8104 class upb::json::Parser {
8106 static Parser*
Create(Environment* env, Sink* output);
8146 #ifndef UPB_JSON_TYPED_PRINTER_H_ 8147 #define UPB_JSON_TYPED_PRINTER_H_ 8163 #define UPB_JSON_PRINTER_SIZE 168 8168 class upb::json::Printer {
8170 static Printer*
Create(Environment* env,
const upb::Handlers* handlers,
8177 static reffed_ptr<const Handlers> NewHandlers(
const upb::MessageDef* md);
8202 inline Printer*
Printer::Create(Environment* env,
const upb::Handlers* handlers,
8203 BytesSink* output) {
8207 inline reffed_ptr<const Handlers> Printer::NewHandlers(
8208 const upb::MessageDef *md) {
8210 return reffed_ptr<const Handlers>(
h, &
h);
upb_label_t label_
Definition: upb.h:3073
const upb_strtable * t
Definition: upb.h:988
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_FieldDescriptorProto_type(const upb_symtab *s)
Definition: upb.h:6690
int code_
Definition: upb.h:509
std::integral_constant< std::int32_t, V > int32_t
Definition: Brigand.h:439
UPB_BEGIN_EXTERN_C upb_enumdef * upb_enumdef_new(const void *owner)
Definition: upb.c:395
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_ServiceDescriptorProto_name(const upb_symtab *s)
Definition: upb.h:6730
char dummy
Definition: upb.h:5574
upb_ctype_t ctype
Definition: upb.h:599
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_EnumOptions_allow_alias(const upb_symtab *s)
Definition: upb.h:6678
UPB_INLINE const upb_msgdef * upbdefs_google_protobuf_ServiceDescriptorProto(const upb_symtab *s)
Definition: upb.h:6612
GLboolean GLuint group
Definition: gl2ext.h:780
#define UPB_BEGIN_EXTERN_C
Definition: upb.h:226
bool upb_fielddef_isextension(const upb_fielddef *f)
Definition: upb.c:703
UPB_INLINE const upb_msgdef * upbdefs_google_protobuf_ServiceOptions(const upb_symtab *s)
Definition: upb.h:6617
UPB_INLINE const upb_msgdef * upbdefs_google_protobuf_MethodDescriptorProto(const upb_symtab *s)
Definition: upb.h:6602
UPB_INLINE int32_t upb_zzdec_32(uint32_t n)
Definition: upb.h:7699
UPB_INLINE const upb_msgdef * upbdefs_google_protobuf_EnumDescriptorProto(const upb_symtab *s)
Definition: upb.h:6552
bool came_from_user
Definition: upb.h:3035
const FieldDescriptor containing_oneof
Definition: descriptor.h:1688
upb_refcounted base
Definition: upb.h:3026
bool upb_handlers_setstartstr(upb_handlers *h, const upb_fielddef *f, upb_startstr_handlerfunc *func, upb_handlerattr *attr)
UPB_INLINE void _upb_value_setval(upb_value *v, uint64_t val, upb_ctype_t ctype)
Definition: upb.h:615
void upb_func()
Definition: upb.h:253
const uint32_t * pc
Definition: upb.h:7530
upb_fieldtype_t
Definition: upb.h:1435
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_SourceCodeInfo_Location_span(const upb_symtab *s)
Definition: upb.h:6735
UPB_INLINE const void * upb_handlerattr_handlerdata(const upb_handlerattr *attr)
Definition: upb.h:3830
const upb_oneofdef * oneof
Definition: upb.h:3064
UPB_INLINE const upb_fielddef * upb_msgdef_ntofz(const upb_msgdef *m, const char *name)
Definition: upb.h:2090
const upb_shim_data * upb_shim_getdata(const upb_handlers *h, upb_selector_t s, upb_fieldtype_t *type)
Definition: upb.c:3558
void Reset()
Definition: metrics_default.cc:285
int upb_status_errcode(const upb_status *status)
Definition: upb.c:4938
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_DescriptorProto_enum_type(const upb_symtab *s)
Definition: upb.h:6668
upb_status * status
Definition: upb.h:7567
void upb_inttable_begin(upb_inttable_iter *i, const upb_inttable *t)
Definition: upb.c:4665
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_DescriptorProto_extension(const upb_symtab *s)
Definition: upb.h:6669
uint32_t selector_base
Definition: upb.h:3075
bool upb_double_handlerfunc(void *c, const void *hd, double val)
Definition: upb.h:3807
#define UPB_ASSERT_VAR(var, predicate)
Definition: upb.h:250
uint32_t * bytecode_end
Definition: upb.h:7437
google_protobuf_FieldDescriptorProto_Label
Definition: upb.h:6248
bool upb_msgdef_addoneof(upb_msgdef *m, upb_oneofdef *o, const void *ref_donor, upb_status *s)
Definition: upb.c:1393
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_FileOptions_go_package(const upb_symtab *s)
Definition: upb.h:6712
bool upb_inttable_remove(upb_inttable *t, uintptr_t key, upb_value *val)
Definition: upb.c:4544
Pointer
Definition: SpecialPointer.h:34
upb_symtab_iter
Definition: upb.h:5988
bool upb_int32_handlerfunc(void *c, const void *hd, int32_t val)
Definition: upb.h:3802
int stack[stackrange+1]
Definition: float-mm.c:95
EGLStreamKHR EGLint EGLint EGLint size
Definition: eglext.h:984
unsigned long long uint64_t
Definition: ptypes.h:120
int32_t upb_selector_t
Definition: upb.h:3242
UPB_INLINE upb_decoderet upb_vdecode_fast(const char *p)
Definition: upb.h:7763
void upb_fielddef_setdefaultuint32(upb_fielddef *f, uint32_t val)
Definition: upb.c:1074
void upb_status_seterrmsg(upb_status *status, const char *msg)
Definition: upb.c:4942
void upb_fielddef_settagdelim(upb_fielddef *f, bool tag_delim)
Definition: upb.c:1035
UPB_INLINE const upb_oneofdef * upb_msgdef_ntooz(const upb_msgdef *m, const char *name)
Definition: upb.h:2111
size_t skip
Definition: upb.h:7555
const upb_handlers * upb_textprinter_newhandlers(const upb_msgdef *m, const void *owner)
Definition: upb.c:9482
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_MethodOptions_uninterpreted_option(const upb_symtab *s)
Definition: upb.h:6728
void * future2
Definition: upb.h:5232
bool ok_
Definition: upb.h:5213
uint64_t uint
Definition: upb.h:3049
required HashAlgorithmIdentifier hash
Definition: WebCryptoAPI.idl:276
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_UninterpretedOption_NamePart_is_extension(const upb_symtab *s)
Definition: upb.h:6738
void upb_enum_begin(upb_enum_iter *iter, const upb_enumdef *e)
Definition: upb.c:486
void upb_pbdecodermethodopts_init(upb_pbdecodermethodopts *opts, const upb_handlers *h)
Definition: upb.c:7446
UPB_BEGIN_EXTERN_C typedef bool upb_startmsg_handlerfunc(void *c, const void *)
Definition: gtest_unittest.cc:4771
void upb_msg_field_begin(upb_msg_field_iter *iter, const upb_msgdef *m)
Definition: upb.c:1474
void * upb_startfield_handlerfunc(void *c, const void *hd)
Definition: upb.h:3800
#define UPB_UNUSED(var)
Definition: upb.h:245
Iterator
Definition: six.py:544
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_EnumValueDescriptorProto_number(const upb_symtab *s)
Definition: upb.h:6681
upb_bytessink * upb_pbdecoder_input(upb_pbdecoder *d)
Definition: upb.c:8463
const upb_enumdef * upb_fielddef_enumsubdef(const upb_fielddef *f)
Definition: upb.c:866
std::vector< TraceArg > args
Definition: event_tracer.cc:256
UPB_INLINE const upb_msgdef * upbdefs_google_protobuf_FieldOptions(const upb_symtab *s)
Definition: upb.h:6577
DOMString p
Definition: WebCryptoAPI.idl:116
const FieldDescriptor * field
Definition: parser_unittest.cc:2279
bool upb_fielddef_setenumsubdef(upb_fielddef *f, const upb_enumdef *subdef, upb_status *s)
Definition: upb.c:1173
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_FileOptions_uninterpreted_option(const upb_symtab *s)
Definition: upb.h:6720
google_protobuf_FieldDescriptorProto_Type
Definition: upb.h:6254
UPB_INLINE bool upb_strtable_remove(upb_strtable *t, const char *key, upb_value *v)
Definition: upb.h:897
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_FileOptions_java_multiple_files(const upb_symtab *s)
Definition: upb.h:6715
int32_t upb_fielddef_defaultint32(const upb_fielddef *f)
Definition: upb.c:773
char * mem_ptr
Definition: upb.h:5289
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_FileDescriptorProto_source_code_info(const upb_symtab *s)
Definition: upb.h:6708
upb_def ** upb_load_defs_from_descriptor(const char *str, size_t len, int *n, void *owner, upb_status *status)
Definition: upb.c:9073
void * alloc_ud
Definition: upb.h:5218
upb_descriptortype_t upb_fielddef_descriptortype(const upb_fielddef *f)
Definition: upb.c:969
bool upb_pbdecoder_setmaxnesting(upb_pbdecoder *d, size_t max)
Definition: upb.c:8471
GLint GLint GLint GLsizei GLsizei GLenum format
Definition: gl2.h:403
const void * upb_handlerattr_returnclosuretype(const upb_handlerattr *attr)
Definition: upb.c:2603
const upb_pbdecodermethod * upb_pbdecoder_method(const upb_pbdecoder *d)
Definition: upb.c:8459
int c
Definition: cpp_unittests.cpp:275
upb_inttable cleanup_
Definition: upb.h:3687
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_FileDescriptorProto_message_type(const upb_symtab *s)
Definition: upb.h:6702
int64_t upb_fielddef_defaultint64(const upb_fielddef *f)
Definition: upb.c:768
#define UPB_DISALLOW_POD_OPS(class_name, full_class_name)
Definition: upb.h:153
PyObject * FindOneofByName(PyDescriptorPool *self, PyObject *arg)
Definition: descriptor_pool.cc:291
UPB_INLINE int64_t upb_zzdec_64(uint64_t n)
Definition: upb.h:7702
bool upb_strtable_remove2(upb_strtable *t, const char *key, size_t len, upb_value *val)
Definition: upb.c:4350
bool upb_msgdef_addfield(upb_msgdef *m, upb_fielddef *f, const void *ref_donor, upb_status *s)
Definition: upb.c:1360
DescriptorProto
Definition: descriptor_pb2.py:1637
const upb_json_parsermethod upb_sink * output
Definition: upb.h:8438
UPB_BEGIN_EXTERN_C upb_msgdef * upb_msgdef_new(const void *owner)
Definition: upb.c:1261
UPB_INLINE const upb_msgdef * upbdefs_google_protobuf_DescriptorProto(const upb_symtab *s)
Definition: upb.h:6542
GLuint GLuint end
Definition: gl2ext.h:323
upb_deftype_t
Definition: upb.h:1285
UPB_INLINE const upb_enumdef * upbdefs_google_protobuf_FileOptions_OptimizeMode(const upb_symtab *s)
Definition: upb.h:6660
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_SourceCodeInfo_Location_leading_comments(const upb_symtab *s)
Definition: upb.h:6733
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_FileOptions_py_generic_services(const upb_symtab *s)
Definition: upb.h:6719
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_MethodDescriptorProto_output_type(const upb_symtab *s)
Definition: upb.h:6727
uint32_t number_
Definition: upb.h:3074
void upb_pbdecoder_freejit(mgroup *group)
void * default_alloc_ud
Definition: upb.h:5225
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_ServiceDescriptorProto_options(const upb_symtab *s)
Definition: upb.h:6731
signed int int32_t
Definition: ptypes.h:101
upb_decoderet upb_vdecode_max8_branch64(upb_decoderet r)
Definition: upb.c:9545
FileOptions
Definition: descriptor_pb2.py:1702
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_FileOptions_optimize_for(const upb_symtab *s)
Definition: upb.h:6718
uint32_t submsg_field_count
Definition: upb.h:3096
uint32_t upb_fielddef_index(const upb_fielddef *f)
Definition: upb.c:683
bool upb_refcounted_init(upb_refcounted *r, const struct upb_refcounted_vtbl *vtbl, const void *owner)
Definition: upb.c:3408
long seed
Definition: float-mm.c:84
Definition: type_traits_unittest.cc:146
upb_status status_
Definition: upb.h:3688
rtc::CallSessionFileRotatingLogSink * sink
Definition: peerconnection_jni.cc:2350
bool upb_handlers_setstartsubmsg(upb_handlers *h, const upb_fielddef *f, upb_startfield_handlerfunc *func, upb_handlerattr *attr)
bool upb_int64_handlerfunc(void *c, const void *hd, int64_t val)
Definition: upb.h:3803
bool upb_load_descriptor_into_symtab(upb_symtab *symtab, const char *str, size_t len, upb_status *status)
Definition: upb.c:9110
unsigned int uint32_t
Definition: ptypes.h:105
void upb_fielddef_setpacked(upb_fielddef *f, bool packed)
Definition: upb.c:1018
uint32_t * group
Definition: upb.h:1095
size_t upb_strtable_iter_keylength(upb_strtable_iter *i)
Definition: upb.c:4387
void upb_msg_field_next(upb_msg_field_iter *iter)
Definition: upb.c:1478
#define UPB_PB_VARINT_MAX_LEN
Definition: upb.h:7691
bool is_frozen
Definition: upb.h:1108
upb_oneofdef * upb_oneofdef_dup(const upb_oneofdef *o, const void *owner)
Definition: upb.c:1552
bool upb_pbcodecache_allowjit(const upb_pbcodecache *c)
Definition: upb.c:7417
uint32_t upb_fielddef_number(const upb_fielddef *f)
Definition: upb.c:699
void upb_symtab_freeze(upb_symtab *s)
Definition: upb.c:3608
bool upb_handlers_addcleanup(upb_handlers *h, void *p, upb_handlerfree *hfree)
Definition: upb.c:2378
const char * upb_strtable_iter_key(upb_strtable_iter *i)
Definition: upb.c:4382
upb_sink * upb_json_printer_input(upb_json_printer *p)
Definition: upb.c:11983
upb_sink * upb_descreader_input(upb_descreader *r)
Definition: upb.c:6463
int32_t upb_enum_iter_number(upb_enum_iter *iter)
Definition: upb.c:514
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_FieldDescriptorProto_type_name(const upb_symtab *s)
Definition: upb.h:6691
Definition: udis86_types.h:171
void upb_fielddef_setdescriptortype(upb_fielddef *f, int type)
Definition: upb.c:908
upb_label_t upb_fielddef_label(const upb_fielddef *f)
Definition: upb.c:687
UPB_INLINE int upb_value_size(uint64_t val)
Definition: upb.h:7777
bool upb_symtab_done(const upb_symtab_iter *iter)
Definition: upb.c:4004
bool is_extension_
Definition: upb.h:3067
bool upb_oneof_done(upb_oneof_iter *iter)
Definition: upb.c:1687
upb_inttable iton
Definition: upb.h:3130
UPB_INLINE size_t upb_vencode64(uint64_t val, char *buf)
Definition: upb.h:7792
bool upb_enumdef_freeze(upb_enumdef *e, upb_status *status)
Definition: upb.c:427
OPENSSL_EXPORT const ASN1_OBJECT int const unsigned char * bytes
Definition: x509.h:1053
bool upb_inttable_lookup(const upb_inttable *t, uintptr_t key, upb_value *v)
Definition: upb.c:4530
bool upb_handlerattr_alwaysok(const upb_handlerattr *attr)
Definition: upb.c:2612
int upb_msgdef_numoneofs(const upb_msgdef *m)
Definition: upb.c:1461
UPB_INLINE const upb_msgdef * upbdefs_google_protobuf_MessageOptions(const upb_symtab *s)
Definition: upb.h:6597
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_UninterpretedOption_double_value(const upb_symtab *s)
Definition: upb.h:6741
const char * upb_fielddef_subdefname(const upb_fielddef *f)
Definition: upb.c:875
upb_strtable ntof
Definition: upb.h:3100
bool upb_pbdecodermethod_isnative(const upb_pbdecodermethod *m)
Definition: upb.c:6584
bool upb_refcounted_freeze(upb_refcounted *const *roots, int n, upb_status *s, int maxdepth)
Definition: upb.c:3489
TimeDelta operator*(T a, TimeDelta td)
Definition: timedelta.h:123
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_EnumValueOptions_uninterpreted_option(const upb_symtab *s)
Definition: upb.h:6683
unsigned char uint8_t
Definition: skin_detection.h:18
#define UPB_REFCOUNTED_CMETHODS(type, upcastfunc)
Definition: upb.h:1139
void upb_pbdecoder_seterr(upb_pbdecoder *d, const char *msg)
Definition: upb.c:7554
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_UninterpretedOption_negative_int_value(const upb_symtab *s)
Definition: upb.h:6744
SourceCodeInfo
Definition: descriptor_pb2.py:1766
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_SourceCodeInfo_location(const upb_symtab *s)
Definition: upb.h:6737
UPB_INLINE bool upb_inttable_lookup32(const upb_inttable *t, uint32_t key, upb_value *v)
Definition: upb.h:925
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: gl2ext.h:134
AVCFAssetRef CFArrayRef AVCFAssetLoadValuesCompletionCallback callback
Definition: AVFoundationCFSoftLinking.h:99
bool upb_fielddef_enumhasdefaultstr(const upb_fielddef *f)
Definition: upb.c:1127
bool t
Definition: UpdateContents.py:37
const FieldDescriptor const OneofDescriptor const EnumValueDescriptor service
Definition: descriptor.h:1760
const upb_oneofdef * upb_msgdef_ntoo(const upb_msgdef *m, const char *name, size_t len)
Definition: upb.c:1450
UPB_INLINE upb_decoderet upb_vdecode_max8_fast(upb_decoderet r)
Definition: upb.h:7770
upb_handlers_tabent table[1]
Definition: upb.h:3689
bool upb_refcounted_isfrozen(const upb_refcounted *r)
Definition: upb.c:3438
path
Definition: generate.py:74
const Descriptor * descriptor
Definition: descriptor.cc:271
UPB_BEGIN_EXTERN_C void upb_seededalloc_init(upb_seededalloc *a, void *mem, size_t len)
Definition: upb.c:1939
UPB_INLINE upb_value _upb_value_val(uint64_t val, upb_ctype_t ctype)
Definition: upb.h:621
UPB_INLINE bool upb_sink_startmsg(upb_sink *s)
Definition: upb.h:5688
UPB_INLINE void upb_bufhandle_init(upb_bufhandle *h)
Definition: upb.h:3974
const void * top_closure_type
Definition: upb.h:3686
upb_alloc_func * alloc
Definition: upb.h:5217
void * default_alloc_ud
Definition: upb.h:5285
bool upb_oneofdef_addfield(upb_oneofdef *o, upb_fielddef *f, const void *ref_donor, upb_status *s)
Definition: upb.c:1591
int32_t upb_pbdecoder_decode_f64(upb_pbdecoder *d, uint64_t *u64)
Definition: upb.c:7911
const upb_fielddef * upb_oneofdef_itof(const upb_oneofdef *o, uint32_t num)
Definition: upb.c:1673
const char * upb_fielddef_fullname(const upb_fielddef *f)
Definition: upb.c:606
bool upb_symtab_add(upb_symtab *s, upb_def *const *defs, int n, void *ref_donor, upb_status *status)
Definition: upb.c:3776
double U(int64_t x, double alpha)
Definition: metric_recorder.cc:414
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_FieldOptions_ctype(const upb_symtab *s)
Definition: upb.h:6692
bool upb_fielddef_isprimitive(const upb_fielddef *f)
Definition: upb.c:1206
UPB_BEGIN_EXTERN_C const upb_handlers * upb_pb_encoder_newhandlers(const upb_msgdef *m, const void *owner)
Definition: upb.c:9023
upb_tabkey key
Definition: upb.h:767
char * upb_strdup(const char *s)
Definition: upb.c:4044
bool upb_strtable_done(const upb_strtable_iter *i)
Definition: upb.c:4377
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_FileDescriptorProto_dependency(const upb_symtab *s)
Definition: upb.h:6699
UPB_INLINE bool upb_sink_endsubmsg(upb_sink *s, upb_selector_t sel)
Definition: upb.h:5787
UPB_INLINE const upb_msgdef * upbdefs_google_protobuf_EnumValueDescriptorProto(const upb_symtab *s)
Definition: upb.h:6562
upb_sink * upb_pb_encoder_input(upb_pb_encoder *p)
Definition: upb.c:9066
upb_alloc_func * upb_seededalloc_getallocfunc(upb_seededalloc *a)
Definition: upb.c:1966
void upb_fielddef_setdefaultdouble(upb_fielddef *f, double val)
Definition: upb.c:1089
UPB_INLINE const char * upb_bufhandle_buf(const upb_bufhandle *h)
Definition: upb.h:3999
upb_strtable ntof
Definition: upb.h:3143
UPB_INLINE size_t upb_varint_size(uint64_t val)
Definition: upb.h:7805
const upb_handlers ** sub
Definition: upb.h:3685
size_t bytes_allocated
Definition: upb.h:5214
upb_def base
Definition: upb.h:3093
bool ok_
Definition: upb.h:506
const upb_tabval * array
Definition: upb.h:804
void upb_fielddef_setdefaultuint64(upb_fielddef *f, uint64_t val)
Definition: upb.c:1069
const upb_fielddef * upb_oneofdef_ntof(const upb_oneofdef *o, const char *name, size_t length)
Definition: upb.c:1666
int32_t upb_pbdecoder_resume(upb_pbdecoder *d, void *p, const char *buf, size_t size, const upb_bufhandle *handle)
Definition: upb.c:7664
const GLfloat * m
Definition: gl2ext.h:850
bool upb_inttable_init(upb_inttable *table, upb_ctype_t ctype)
Definition: upb.c:4481
uint32_t upb_fielddef_defaultuint32(const upb_fielddef *f)
Definition: upb.c:790
bool upb_bool_handlerfunc(void *c, const void *hd, bool val)
Definition: upb.h:3808
bool upb_endfield_handlerfunc(void *c, const void *hd)
Definition: upb.h:3801
size_t upb_bufhandle_objofs(const upb_bufhandle *h)
Definition: upb.c:2618
google_protobuf_FieldOptions_CType
Definition: upb.h:6275
#define UPB_ENDSTR_SELECTOR
Definition: upb.h:3274
UPB_INLINE const upb_msgdef * upbdefs_google_protobuf_FileOptions(const upb_symtab *s)
Definition: upb.h:6592
uint8_t size_lg2
Definition: upb.h:781
int upb_oneofdef_numfields(const upb_oneofdef *o)
Definition: upb.c:1587
upb_def base
Definition: upb.h:3141
JavaScriptCore arg3
Definition: jsc-trace-profiler-events.d:41
typedef(object or DOMString) AlgorithmIdentifier
upb_inttable dispatch
Definition: upb.h:7517
upb_func * func
Definition: upb.h:3327
Definition: RenderStyleConstants.h:245
bool default_is_string
Definition: upb.h:3065
const char * upb_msgdef_fullname(const upb_msgdef *m)
Definition: upb.c:1322
const upb_def * def
Definition: upb.h:3059
void upb_strtable_next(upb_strtable_iter *i)
Definition: upb.c:4373
upb_handlertype_t upb_handlers_getprimitivehandlertype(const upb_fielddef *f)
Definition: upb.c:2475
UPB_BEGIN_EXTERN_C upb_textprinter * upb_textprinter_create(upb_env *env, const upb_handlers *h, upb_bytessink *output)
Definition: upb.c:9470
signed long long int64_t
Definition: ptypes.h:112
std::integral_constant< std::int64_t, V > int64_t
Definition: Brigand.h:443
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_DescriptorProto_ExtensionRange_end(const upb_symtab *s)
Definition: upb.h:6666
char * mem_base
Definition: upb.h:5288
#define UPB_DECLARE_DERIVED_TYPE(cppname, cppbase, cname, cbase)
Definition: upb.h:232
const upb_msgdef * parent
Definition: upb.h:3145
UPB_INLINE uintptr_t upb_intkey(uintptr_t key)
Definition: upb.h:832
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_FieldDescriptorProto_default_value(const upb_symtab *s)
Definition: upb.h:6684
UPB_INLINE const void * upb_bufhandle_objtype(const upb_bufhandle *h)
Definition: upb.h:3996
uint32_t index_
Definition: upb.h:3076
EGLenum EGLObjectKHR EGLLabelKHR label
Definition: eglext.h:121
upb_pbdecoder_frame * top
Definition: upb.h:7563
std::integral_constant< std::size_t, V > size_t
Definition: Brigand.h:447
const char * ptr
Definition: upb.h:7533
PyObject * FindFieldByName(PyDescriptorPool *self, PyObject *arg)
Definition: descriptor_pool.cc:239
UPB_INLINE opcode getop(uint32_t instr)
Definition: upb.h:7409
void upb_fielddef_settype(upb_fielddef *f, upb_fieldtype_t type)
Definition: upb.c:899
bool upb_handlers_getselector(const upb_fielddef *f, upb_handlertype_t type, upb_selector_t *s)
Definition: upb.c:2489
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_FileDescriptorProto_service(const upb_symtab *s)
Definition: upb.h:6707
OPENSSL_EXPORT const ASN1_OBJECT * obj
Definition: x509.h:1053
const char * upb_enumdef_fullname(const upb_enumdef *e)
Definition: upb.c:432
Definition: type_traits_unittest.cc:148
UPB_INLINE void upb_bufhandle_uninit(upb_bufhandle *h)
Definition: upb.h:3980
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_DescriptorProto_nested_type(const upb_symtab *s)
Definition: upb.h:6673
const char * upb_pbdecoder_getopname(unsigned int op)
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_MethodDescriptorProto_name(const upb_symtab *s)
Definition: upb.h:6725
bool upb_handlers_setstartmsg(upb_handlers *h, upb_startmsg_handlerfunc *func, upb_handlerattr *attr)
Definition: upb.c:2329
bool upb_handlers_setint32(upb_handlers *h, const upb_fielddef *f, upb_int32_handlerfunc *func, upb_handlerattr *attr)
size_t upb_pbdecoder_maxnesting(const upb_pbdecoder *d)
Definition: upb.c:8467
std::integral_constant< std::uint64_t, V > uint64_t
Definition: Brigand.h:445
size_t call_len
Definition: upb.h:7529
if(!isset( $GET[ 'random_id']))
Definition: cacheable-random-text.php:7
upb_error_func * err
Definition: upb.h:5221
#define UPB_REFCOUNTED_CPPMETHODS
Definition: upb.h:1156
UPB_INLINE const upb_enumdef * upbdefs_google_protobuf_FieldOptions_CType(const upb_symtab *s)
Definition: upb.h:6655
bool subdef_is_symbolic
Definition: upb.h:3062
const upb_enumdef * upb_symtab_lookupenum(const upb_symtab *s, const char *sym)
Definition: upb.c:3635
UPB_INLINE void upb_pbdecoder_unpackdispatch(uint64_t dispatch, uint64_t *ofs, uint8_t *wt1, uint8_t *wt2)
Definition: upb.h:7639
UPB_INLINE const upb_enumdef * upbdefs_google_protobuf_FieldDescriptorProto_Type(const upb_symtab *s)
Definition: upb.h:6650
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_FileDescriptorProto_public_dependency(const upb_symtab *s)
Definition: upb.h:6706
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_FileOptions_java_package(const upb_symtab *s)
Definition: upb.h:6717
char * upb_readfile(const char *filename, size_t *len)
Definition: upb.c:9121
void upb_enum_next(upb_enum_iter *iter)
Definition: upb.c:491
bool upb_handlers_setendstr(upb_handlers *h, const upb_fielddef *f, upb_endfield_handlerfunc *func, upb_handlerattr *attr)
const char * upb_fielddef_containingtypename(upb_fielddef *f)
Definition: upb.c:731
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_ServiceOptions_uninterpreted_option(const upb_symtab *s)
Definition: upb.h:6732
zend_class_entry * descriptor_type
USVString filename
Definition: ErrorEvent.idl:46
bool upb_inttable_insert(upb_inttable *t, uintptr_t key, upb_value val)
Definition: upb.c:4490
upb_handlers * upb_handlers_new(const upb_msgdef *m, const void *owner)
Definition: upb.c:2243
bool upb_fielddef_typeisset(const upb_fielddef *f)
Definition: upb.c:674
bool upb_fielddef_enumhasdefaultint32(const upb_fielddef *f)
Definition: upb.c:1121
#define UPB_END_EXTERN_C
Definition: upb.h:227
#define UPB_ENDMSG_SELECTOR
Definition: upb.h:3268
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_DescriptorProto_options(const upb_symtab *s)
Definition: upb.h:6674
const upb_handlers * upb_json_printer_newhandlers(const upb_msgdef *md, const void *owner)
Definition: upb.c:11987
upb_inttable methods
Definition: upb.h:7430
const UChar space
Definition: CharacterNames.h:87
bool upb_pbcodecache_setallowjit(upb_pbcodecache *c, bool allow)
Definition: upb.c:7421
UPB_BEGIN_EXTERN_C bool upb_shim_set(upb_handlers *h, const upb_fielddef *f, size_t offset, int32_t hasbit)
Definition: upb.c:3521
void upb_msg_oneof_next(upb_msg_oneof_iter *iter)
Definition: upb.c:1496
bool upb_fielddef_setname(upb_fielddef *f, const char *name, upb_status *s)
Definition: upb.c:754
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_EnumDescriptorProto_value(const upb_symtab *s)
Definition: upb.h:6677
bool upb_fielddef_issubmsg(const upb_fielddef *f)
Definition: upb.c:1193
ServiceOptions
Definition: descriptor_pb2.py:1737
FieldDescriptorProto
Definition: descriptor_pb2.py:1660
void upb_msg_oneof_iter_setdone(upb_msg_oneof_iter *iter)
Definition: upb.c:1506
bool operator!=(const Handle< T > &a, const Handle< U > &b)
Definition: Handle.h:159
const upb_bufhandle * handle
Definition: upb.h:7560
#define desc
Definition: extension_set.h:320
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_EnumDescriptorProto_name(const upb_symtab *s)
Definition: upb.h:6675
float flt
Definition: upb.h:3051
bool upb_byteshandler_setendstr(upb_byteshandler *h, upb_endfield_handlerfunc *func, void *d)
Definition: upb.c:2647
upb_ctype_t ctype
Definition: upb.h:780
UPB_INLINE const upb_msgdef * upbdefs_google_protobuf_SourceCodeInfo_Location(const upb_symtab *s)
Definition: upb.h:6627
FieldOptions
Definition: descriptor_pb2.py:1716
bool upb_fielddef_lazy(const upb_fielddef *f)
Definition: upb.c:707
UPB_INLINE bool upb_sink_endmsg(upb_sink *s, upb_status *status)
Definition: upb.h:5700
float upb_fielddef_defaultfloat(const upb_fielddef *f)
Definition: upb.c:800
uint32_t static_refcount
Definition: upb.c:2707
char _upb_noclosure
Definition: upb.c:1983
bool upb_byteshandler_setstartstr(upb_byteshandler *h, upb_startstr_handlerfunc *func, void *d)
Definition: upb.c:2633
void upb_msg_oneof_begin(upb_msg_oneof_iter *iter, const upb_msgdef *m)
Definition: upb.c:1492
void upb_symtab_begin(upb_symtab_iter *iter, const upb_symtab *s, upb_deftype_t type)
Definition: upb.c:3992
UPB_INLINE upb_fielddef * upb_msgdef_itof_mutable(upb_msgdef *m, uint32_t i)
Definition: upb.h:2095
void upb_fielddef_setdefaultfloat(upb_fielddef *f, float val)
Definition: upb.c:1084
uintptr_t upb_tabkey
Definition: upb.h:673
const upb_handlers * upb_handlers_getsubhandlers_sel(const upb_handlers *h, upb_selector_t sel)
Definition: upb.c:2370
bool upb_inttable_insertptr(upb_inttable *t, const void *key, upb_value val)
Definition: upb.c:4578
void upb_seededalloc_uninit(upb_seededalloc *a)
Definition: upb.c:1952
bool upb_handlers_setuint32(upb_handlers *h, const upb_fielddef *f, upb_uint32_handlerfunc *func, upb_handlerattr *attr)
void * upb_env_malloc(upb_env *e, size_t size)
Definition: upb.c:1869
WEBCORE_EXPORT Node * last(const ContainerNode &)
Definition: NodeTraversal.cpp:106
UPB_INLINE uint64_t upb_vencode32(uint32_t val)
Definition: upb.h:7811
double upb_fielddef_defaultdouble(const upb_fielddef *f)
Definition: upb.c:805
upb_intfmt_t intfmt
Definition: upb.h:3070
UPB_INLINE bool upb_arrhas(upb_tabval key)
Definition: upb.h:844
GLint location
Definition: gl2.h:455
GLuint start
Definition: gl2ext.h:323
upb_table t
Definition: upb.h:793
const uint8_t upb_pb_native_wire_types[]
Definition: upb.c:9495
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_EnumValueDescriptorProto_options(const upb_symtab *s)
Definition: upb.h:6682
upb_def base
Definition: upb.h:3045
UPB_INLINE const upb_msgdef * upbdefs_google_protobuf_UninterpretedOption_NamePart(const upb_symtab *s)
Definition: upb.h:6637
uint64_t uint64
Definition: angle_config.h:30
upb_bytessink input_
Definition: upb.h:7524
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_MessageOptions_uninterpreted_option(const upb_symtab *s)
Definition: upb.h:6723
const char * upb_oneofdef_name(const upb_oneofdef *o)
Definition: upb.c:1570
upb_errorspace * upb_status_errspace(const upb_status *status)
Definition: upb.c:4934
int64_t int64
Definition: angle_config.h:29
Clear
Definition: python_message.py:1326
bool msg_is_symbolic
Definition: upb.h:3063
void * upb_env_realloc(upb_env *e, void *ptr, size_t oldsize, size_t size)
Definition: upb.c:1880
void
Definition: AVFoundationCFSoftLinking.h:81
bool upb_def_freeze(upb_def *const *defs, int n, upb_status *s)
Definition: upb.c:319
UPB_END_EXTERN_C typedef upb_inttable_iter upb_oneof_iter
Definition: upb.h:2289
void * upb_alloc_func(void *ud, void *ptr, size_t oldsize, size_t size)
Definition: upb.h:5132
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_FileDescriptorProto_options(const upb_symtab *s)
Definition: upb.h:6704
opcode
Definition: upb.h:7405
char * mem_limit
Definition: upb.h:5290
EGLStreamKHR EGLint n
Definition: eglext.h:984
VoEFile * file
Definition: voe_cmd_test.cc:59
void upb_symtab_next(upb_symtab_iter *iter)
Definition: upb.c:3999
upb_strtable_iter upb_msg_oneof_iter
Definition: upb.h:1828
bool upb_msg_field_done(const upb_msg_field_iter *iter)
Definition: upb.c:1480
UPB_INLINE upb_fielddef * upb_msgdef_ntof_mutable(upb_msgdef *m, const char *name, size_t len)
Definition: upb.h:2099
void upb_textprinter_setsingleline(upb_textprinter *p, bool single_line)
Definition: upb.c:9489
const upb_def * upb_symtab_iter_def(const upb_symtab_iter *iter)
Definition: upb.c:4008
#define R2(a, b, c, d, k, s, t)
Definition: md4.c:129
upb_value upb_inttable_pop(upb_inttable *t)
Definition: upb.c:4571
bool returned_allocfunc
Definition: upb.h:5282
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_FieldDescriptorProto_number(const upb_symtab *s)
Definition: upb.h:6688
EGLSetBlobFuncANDROID EGLGetBlobFuncANDROID get
Definition: eglext.h:426
EGLStreamKHR EGLint EGLint offset
Definition: eglext.h:984
const char * upb_fielddef_defaultstr(const upb_fielddef *f, size_t *len)
Definition: upb.c:810
UPB_INLINE bool upb_sink_endseq(upb_sink *s, upb_selector_t sel)
Definition: upb.h:5728
UPB_INLINE bool upb_bytessink_start(upb_bytessink *s, size_t size_hint, void **subc)
Definition: upb.h:5588
UPB_INLINE bool upb_strtable_insert(upb_strtable *t, const char *key, upb_value val)
Definition: upb.h:873
bool upb_uint64_handlerfunc(void *c, const void *hd, uint64_t val)
Definition: upb.h:3805
UPB_BEGIN_EXTERN_C upb_symtab * upb_symtab_new(const void *owner)
Definition: upb.c:3600
upb_def base
Definition: upb.h:3127
const upb_pbdecodermethod * method_
Definition: upb.h:7527
#define UPB_JSON_PRINTER_SIZE
Definition: upb.h:8163
void upb_pbdecoder_reset(upb_pbdecoder *d)
Definition: upb.c:8410
bool packed_
Definition: upb.h:3069
bool upb_error_func(void *ud, const upb_status *status)
Definition: upb.h:5134
void * closure
Definition: upb.h:5521
#define UPB_BREAK
Definition: upb.h:3234
const upb_handlers * dest_handlers_
Definition: upb.h:7512
int32_t defaultval
Definition: upb.h:3131
const uint32_t ** callstack
Definition: upb.h:7564
void upb_refcounted_ref2(const upb_refcounted *r, upb_refcounted *from)
Definition: upb.c:3456
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_FieldOptions_deprecated(const upb_symtab *s)
Definition: upb.h:6693
void upb_handlerfree(void *d)
Definition: upb.h:3276
void upb_status_seterrcode(upb_status *status, upb_errorspace *space, int code)
Definition: upb.c:4963
UPB_BEGIN_EXTERN_C upb_pbdecoder * upb_pbdecoder_create(upb_env *e, const upb_pbdecodermethod *method, upb_sink *output)
Definition: upb.c:8419
OPENSSL_EXPORT const ASN1_OBJECT int const unsigned char int len
Definition: x509.h:1053
const upb_inttable * t
Definition: upb.h:1015
UPB_INLINE const void * upb_bufhandle_obj(const upb_bufhandle *h)
Definition: upb.h:3993
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_EnumDescriptorProto_options(const upb_symtab *s)
Definition: upb.h:6676
int ret
Definition: test_unit_dft.c:69
upb_fieldtype_t type_
Definition: upb.h:3072
void upb_oneof_iter_setdone(upb_oneof_iter *iter)
Definition: upb.c:1695
TestSubObjConstructor T
Definition: TestTypedefs.idl:84
UPB_INLINE const upb_msgdef * upbdefs_google_protobuf_DescriptorProto_ExtensionRange(const upb_symtab *s)
Definition: upb.h:6547
FileDescriptorProto
Definition: descriptor_pb2.py:1630
FloatingPoint< float > Float
Definition: gtest-internal.h:481
const void * closure_type_
Definition: upb.h:3319
FloatingPoint< double > Double
Definition: gtest-internal.h:482
bool need_cleanup
Definition: upb.h:5281
const upb_byteshandler * upb_pbdecodermethod_inputhandler(const upb_pbdecodermethod *m)
Definition: upb.c:6579
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_FileOptions_cc_generic_services(const upb_symtab *s)
Definition: upb.h:6711
UPB_INLINE const upb_msgdef * upbdefs_google_protobuf_FieldDescriptorProto(const upb_symtab *s)
Definition: upb.h:6572
UPB_INLINE size_t upb_table_size(const upb_table *t)
Definition: upb.h:817
const upb_refcounted * group
Definition: upb.h:7503
upb_decoderet upb_vdecode_max8_branch32(upb_decoderet r)
Definition: upb.c:9521
_W64 unsigned int uintptr_t
Definition: stdint.h:161
bool upb_pbdecoder_end(void *closure, const void *handler_data)
Definition: upb.c:8340
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_FileOptions_java_generate_equals_and_hash(const upb_symtab *s)
Definition: upb.h:6713
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_MessageOptions_message_set_wire_format(const upb_symtab *s)
Definition: upb.h:6721
size_t count
Definition: upb.h:778
const upb_oneofdef * upb_fielddef_containingoneof(const upb_fielddef *f)
Definition: upb.c:723
void upb_pbcodecache_uninit(upb_pbcodecache *c)
Definition: upb.c:7407
const upb_handlers * upb_pbdecodermethod_desthandlers(const upb_pbdecodermethod *m)
Definition: upb.c:6574
size_t upb_string_handlerfunc(void *c, const void *hd, const char *buf, size_t n, const upb_bufhandle *handle)
Definition: upb.h:3811
bool upb_enum_done(upb_enum_iter *iter)
Definition: upb.c:492
upb_value upb_strtable_iter_value(const upb_strtable_iter *i)
Definition: upb.c:4394
uintptr_t val1
Definition: upb.h:731
upb_fielddef * upb_msg_iter_field(const upb_msg_field_iter *iter)
Definition: upb.c:1484
uint64_t end_ofs
Definition: upb.h:7476
void upb_handlers_clearerr(upb_handlers *h)
Definition: upb.c:2300
UPB_INLINE bool upb_sink_startsubmsg(upb_sink *s, upb_selector_t sel, upb_sink *sub)
Definition: upb.h:5768
UPB_INLINE size_t upb_sink_putstring(upb_sink *s, upb_selector_t sel, const char *buf, size_t n, const upb_bufhandle *handle)
Definition: upb.h:5674
upb_strtable symtab
Definition: upb.h:3157
UPB_INLINE uint32_t upb_zzenc_32(int32_t n)
Definition: upb.h:7705
double dbl
Definition: upb.h:3050
size_t upb_inttable_count(const upb_inttable *t)
Definition: upb.c:4441
int32_t upb_pbdecoder_decode_f32(upb_pbdecoder *d, uint32_t *u32)
Definition: upb.c:7907
#define UPB_PRIVATE_FOR_CPP
Definition: upb.h:228
int32_t hasbit
Definition: upb.h:5910
uint64_t val
Definition: upb.h:595
bool upb_byteshandler_setstring(upb_byteshandler *h, upb_string_handlerfunc *func, void *d)
Definition: upb.c:2640
const char * upb_status_errmsg(const upb_status *status)
Definition: upb.c:4940
GLuint index
Definition: gl2.h:383
UPB_BEGIN_EXTERN_C upb_oneofdef * upb_oneofdef_new(const void *owner)
Definition: upb.c:1533
void upb_handlerattr_init(upb_handlerattr *attr)
Definition: upb.c:2574
UPB_INLINE const upb_msgdef * upbdefs_google_protobuf_MethodOptions(const upb_symtab *s)
Definition: upb.h:6607
UPB_INLINE const upb_msgdef * upbdefs_google_protobuf_FileDescriptorSet(const upb_symtab *s)
Definition: upb.h:6587
bool upb_strtable_iter_isequal(const upb_strtable_iter *i1, const upb_strtable_iter *i2)
Definition: upb.c:4403
void upb_status_seterrf(upb_status *status, const char *fmt,...)
Definition: upb.c:4949
void upb_fielddef_setlazy(upb_fielddef *f, bool lazy)
Definition: upb.c:1013
OPENSSL_EXPORT X509_ATTRIBUTE * attr
Definition: x509.h:1051
bool upb_enumdef_ntoi(const upb_enumdef *e, const char *name, size_t len, int32_t *num)
Definition: upb.c:494
#define UPB_PB_DECODER_SIZE
Definition: upb.h:7126
EGLAttrib * value
Definition: eglext.h:120
size_t upb_pbdecoder_suspend(upb_pbdecoder *d)
Definition: upb.c:7705
bool upb_fielddef_packed(const upb_fielddef *f)
Definition: upb.c:711
unsigned char uint8_t
Definition: ptypes.h:89
bool allow_jit_
Definition: upb.h:7221
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_DescriptorProto_name(const upb_symtab *s)
Definition: upb.h:6672
UPB_INLINE upb_decoderet upb_decoderet_make(const char *p, uint64_t val)
Definition: upb.h:7716
bool upb_env_reporterror(upb_env *e, const upb_status *status)
Definition: upb.c:1852
GLenum func
Definition: gl2.h:481
void upb_msgdef_setmapentry(upb_msgdef *m, bool map_entry)
Definition: upb.c:1465
bool upb_handlers_freeze(upb_handlers *const *handlers, int n, upb_status *s)
Definition: upb.c:2391
UPB_INLINE bool upb_sink_endstr(upb_sink *s, upb_selector_t sel)
Definition: upb.h:5756
const char * kPbDecoderSubmessageTooLong
Definition: upb.c:7481
const upb_fielddef * upb_msgdef_ntof(const upb_msgdef *m, const char *name, size_t len)
Definition: upb.c:1443
#define F(b, c, d)
Definition: md4.c:111
Definition: gtest_pred_impl_unittest.cc:56
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_FileDescriptorProto_weak_dependency(const upb_symtab *s)
Definition: upb.h:6709
const struct _upb_tabent * next
Definition: upb.h:774
bool upb_strtable_init(upb_strtable *table, upb_ctype_t ctype)
Definition: upb.c:4292
UPB_INLINE upb_selector_t upb_handlers_getendselector(upb_selector_t start)
Definition: upb.h:3951
uint32_t MurmurHash2(const void *key, size_t len, uint32_t seed)
Definition: upb.c:4784
#define UPB_VARINT_DECODER_CHECK2(name, decode_max8_function)
Definition: upb.h:7738
upb_inttable itof
Definition: upb.h:3144
const upb_def * upb_fielddef_subdef(const upb_fielddef *f)
Definition: upb.c:857
const char * upb_fielddef_name(const upb_fielddef *f)
Definition: upb.c:715
int32_t groupnum
Definition: upb.h:7482
void upb_fielddef_setdefaultbool(upb_fielddef *f, bool val)
Definition: upb.c:1079
upb_refcounted base
Definition: upb.h:3155
upb_strtable ntoo
Definition: upb.h:3103
bool upb_handlers_setsubhandlers(upb_handlers *h, const upb_fielddef *f, const upb_handlers *sub)
Definition: upb.c:2342
void upb_status_copy(upb_status *to, const upb_status *from)
Definition: upb.c:4972
upb_intfmt_t upb_fielddef_intfmt(const upb_fielddef *f)
Definition: upb.c:691
void upb_inttable_iter_setdone(upb_inttable_iter *i)
Definition: upb.c:4709
upb_wiretype_t
Definition: upb.h:7677
enum_type
Definition: descriptor_pb2.py:1573
void * future2
Definition: upb.h:5294
UPB_INLINE bool upb_sink_startstr(upb_sink *s, upb_selector_t sel, size_t size_hint, upb_sink *sub)
Definition: upb.h:5740
upb_table t
Definition: upb.h:803
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_DescriptorProto_field(const upb_symtab *s)
Definition: upb.h:6671
bool upb_env_addcleanup(upb_env *e, upb_cleanup_func *func, void *ud)
Definition: upb.c:1857
upb_refcounted base
Definition: upb.h:3682
bool upb_enumdef_addval(upb_enumdef *e, const char *name, int32_t num, upb_status *status)
Definition: upb.c:441
upb_inttable itof
Definition: upb.h:3099
const upb_pbdecodermethod * upb_pbdecodermethod_new(const upb_pbdecodermethodopts *opts, const void *owner)
Definition: upb.c:6588
upb_label_t
Definition: upb.h:1450
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_FieldDescriptorProto_name(const upb_symtab *s)
Definition: upb.h:6687
size_t upb_pbdecoder_decode(void *closure, const void *hd, const char *buf, size_t size, const upb_bufhandle *handle)
Definition: upb.c:8397
uint64_t bufstart_ofs
Definition: upb.h:7542
upb_fielddef * upb_oneof_iter_field(const upb_oneof_iter *iter)
Definition: upb.c:1691
UPB_INLINE bool upb_enumdef_ntoiz(const upb_enumdef *e, const char *name, int32_t *num)
Definition: upb.h:2268
EGLImageKHR EGLint * name
Definition: eglext.h:851
const upb_msgdef * upb_handlers_msgdef(const upb_handlers *h)
Definition: upb.c:2376
void upb_oneof_begin(upb_oneof_iter *iter, const upb_oneofdef *o)
Definition: upb.c:1679
bool upb_handlers_setendseq(upb_handlers *h, const upb_fielddef *f, upb_endfield_handlerfunc *func, upb_handlerattr *attr)
bool map_entry
Definition: upb.h:3108
size_t stack_size
Definition: upb.h:7565
UPB_INLINE const void * upb_handlers_gethandlerdata(const upb_handlers *h, upb_selector_t s)
Definition: upb.h:3911
size_t index
Definition: upb.h:989
void upb_status_vseterrf(upb_status *status, const char *fmt, va_list args)
Definition: upb.c:4956
size_t mask
Definition: upb.h:779
upb_sink sink
Definition: upb.h:7466
UPB_BEGIN_EXTERN_C const void * UPB_UNTRACKED_REF
Definition: upb.c:2677
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_FieldOptions_lazy(const upb_symtab *s)
Definition: upb.h:6695
upb_decoderet upb_vdecode_max8_wright(upb_decoderet r)
Definition: upb.c:9597
bool upb_fielddef_setcontainingtypename(upb_fielddef *f, const char *name, upb_status *s)
Definition: upb.c:739
bool is_native_
Definition: upb.h:7506
unrestricted float DOUBLE
Definition: TestTypedefs.idl:71
#define FUNCS(name, membername, type_t, converter, proto_type)
Definition: upb.h:635
bool upb_handlerattr_setreturnclosuretype(upb_handlerattr *attr, const void *type)
Definition: upb.c:2597
void upb_cleanup_func(void *ud)
Definition: upb.h:5133
Definition: __init__.py:1
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_FileDescriptorSet_file(const upb_symtab *s)
Definition: upb.h:6710
def sub(pattern, replacement, s)
Definition: common.py:63
void upb_refcounted_checkref(const upb_refcounted *r, const void *owner)
Definition: upb.c:3485
bool upb_fielddef_setsubdefname(upb_fielddef *f, const char *name, upb_status *s)
Definition: upb.c:1178
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_EnumOptions_uninterpreted_option(const upb_symtab *s)
Definition: upb.h:6679
bool upb_env_ok(const upb_env *e)
Definition: upb.c:1848
void upb_byteshandler_init(upb_byteshandler *h)
Definition: upb.c:2624
UPB_BEGIN_EXTERN_C upb_descreader * upb_descreader_create(upb_env *e, const upb_handlers *h)
Definition: upb.c:6442
UPB_BEGIN_EXTERN_C upb_json_printer * upb_json_printer_create(upb_env *e, const upb_handlers *h, upb_bytessink *output)
Definition: upb.c:11965
void upb_strtable_iter_setdone(upb_strtable_iter *i)
Definition: upb.c:4399
GLboolean GLboolean GLboolean GLboolean a
Definition: gl2ext.h:306
bool upb_fielddef_isstring(const upb_fielddef *f)
Definition: upb.c:1197
UPB_INLINE bool upb_tabent_isempty(const upb_tabent *e)
Definition: upb.h:825
const void * obj_
Definition: upb.h:3389
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_MethodDescriptorProto_input_type(const upb_symtab *s)
Definition: upb.h:6724
#define true
Definition: float-mm.c:6
GenericReader< UTF8<>, UTF8<> > Reader
Reader with UTF8 encoding and default allocator.
Definition: reader.h:1432
void upb_inttable_uninit(upb_inttable *table)
Definition: upb.c:4485
const upb_def * upb_symtab_resolve(const upb_symtab *s, const char *base, const char *sym)
Definition: upb.c:3661
#define UPB_STATUS_MAX_MESSAGE
Definition: upb.h:449
bool upb_fielddef_ismap(const upb_fielddef *f)
Definition: upb.c:1210
bool upb_fielddef_isseq(const upb_fielddef *f)
Definition: upb.c:1202
bool upb_strtable_resize(upb_strtable *t, size_t size_lg2)
Definition: upb.c:4303
void upb_inttable_compact(upb_inttable *t)
Definition: upb.c:4591
char * residual_end
Definition: upb.h:7549
void upb_refcounted_unref2(const upb_refcounted *r, upb_refcounted *from)
Definition: upb.c:3466
UPB_BEGIN_EXTERN_C upb_def * upb_def_dup(const upb_def *def, const void *owner)
Definition: upb.c:82
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_FileDescriptorProto_enum_type(const upb_symtab *s)
Definition: upb.h:6700
uint32_t individual_count
Definition: upb.h:1106
bool upb_fielddef_setfullname(upb_fielddef *f, const char *fullname, upb_status *s)
bool upb_handlers_setstring(upb_handlers *h, const upb_fielddef *f, upb_string_handlerfunc *func, upb_handlerattr *attr)
MethodDescriptorProto
Definition: descriptor_pb2.py:1695
GLfloat f
Definition: gl2.h:417
const upb_status * upb_handlers_status(upb_handlers *h)
Definition: upb.c:2295
const char * name
Definition: upb.h:461
bool upb_msg_oneof_done(const upb_msg_oneof_iter *iter)
Definition: upb.c:1498
bool upb_handlers_setint64(upb_handlers *h, const upb_fielddef *f, upb_int64_handlerfunc *func, upb_handlerattr *attr)
upb_ctype_t
Definition: upb.h:582
void * future1
Definition: upb.h:5293
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_SourceCodeInfo_Location_path(const upb_symtab *s)
Definition: upb.h:6734
bool IsMap(const google::protobuf::Field &field, const google::protobuf::Type &type)
Definition: utility.cc:312
const GLfloat * v
Definition: gl2.h:514
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_FieldOptions_packed(const upb_symtab *s)
Definition: upb.h:6696
string expected
Definition: buildtests.py:33
upb_decoderet upb_vdecode_max8_massimino(upb_decoderet r)
Definition: upb.c:9576
bool upb_enumdef_setfullname(upb_enumdef *e, const char *fullname, upb_status *s)
Definition: upb.c:436
void upb_refcounted_unref(const upb_refcounted *r, const void *owner)
Definition: upb.c:3449
DOMString code
Definition: KeyboardEvent.idl:61
UPB_INLINE bool upb_sink_startseq(upb_sink *s, upb_selector_t sel, upb_sink *sub)
Definition: upb.h:5712
bool upb_fielddef_setdefaultstr(upb_fielddef *f, const void *str, size_t len, upb_status *s)
Definition: upb.c:1094
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_FieldOptions_experimental_map_key(const upb_symtab *s)
Definition: upb.h:6694
#define UPB_STRING_SELECTOR
Definition: upb.h:3273
void upb_strtable_uninit(upb_strtable *table)
Definition: upb.c:4296
bool upb_load_descriptor_file_into_symtab(upb_symtab *symtab, const char *fname, upb_status *status)
Definition: upb.c:9141
bool operator==(const Handle< T > &a, const Handle< U > &b)
Definition: Handle.h:144
void * future1
Definition: upb.h:5231
Definition: safe_conversions.h:16
const upb_msgdef * upb_fielddef_msgsubdef(const upb_fielddef *f)
Definition: upb.c:861
void upb_seededalloc_setfallbackalloc(upb_seededalloc *a, upb_alloc_func *func, void *ud)
Definition: upb.c:1958
EGLenum type
Definition: eglext.h:63
void upb_env_uninit(upb_env *e)
Definition: upb.c:1816
UPB_INLINE upb_oneofdef * upb_msgdef_ntoo_mutable(upb_msgdef *m, const char *name, size_t len)
Definition: upb.h:2116
const upb_symtab * upbdefs_google_protobuf_descriptor(const void *owner)
Definition: upb.c:5599
UPB_INLINE size_t upb_bytessink_putbuf(upb_bytessink *s, void *subc, const char *buf, size_t size, const upb_bufhandle *handle)
Definition: upb.h:5603
bool upb_handlerattr_setalwaysok(upb_handlerattr *attr, bool alwaysok)
Definition: upb.c:2607
const void * handler_data_
Definition: upb.h:3318
EGLStreamKHR EGLint EGLint EGLint const void * data
Definition: eglext.h:984
void upb_fielddef_setlabel(upb_fielddef *f, upb_label_t label)
Definition: upb.c:1023
UPB_INLINE bool upb_bufsrc_putbuf(const char *buf, size_t len, upb_bytessink *sink)
Definition: upb.h:5629
str
Definition: make-dist.py:305
bool upb_enumdef_setdefault(upb_enumdef *e, int32_t val, upb_status *s)
Definition: upb.c:472
upb_intfmt_t
Definition: upb.h:1458
GLsizei const GLchar *const * string
Definition: gl2.h:479
void * err_ud
Definition: upb.h:5222
uint32_t upb_handlers_selectorbaseoffset(const upb_fielddef *f)
Definition: upb.c:2552
rtc::scoped_refptr< PeerConnectionInterface > pc(f->CreatePeerConnection(rtc_config, nullptr, nullptr, observer))
SAX-style JSON parser. Use Reader for UTF8 encoding and default allocator.
Definition: reader.h:380
BigEndianULong UInt32
Definition: OpenTypeTypes.h:64
#define UPB_INLINE
Definition: upb.h:88
const upb_handlers * upb_handlers_getsubhandlers(const upb_handlers *h, const upb_fielddef *f)
Definition: upb.c:2356
UPB_INLINE const upb_msgdef * upbdefs_google_protobuf_EnumOptions(const upb_symtab *s)
Definition: upb.h:6557
bool upb_handlerattr_sethandlerdata(upb_handlerattr *attr, const void *hd)
Definition: upb.c:2583
#define buffer
Definition: xmlparse.c:622
upb_strtable ntoi
Definition: upb.h:3129
EnumValueOptions
Definition: descriptor_pb2.py:1730
const upb_def * upb_symtab_lookup(const upb_symtab *s, const char *sym)
Definition: upb.c:3621
bool upb_inttable_replace(upb_inttable *t, uintptr_t key, upb_value val)
Definition: upb.c:4537
UPB_INLINE void upb_sink_reset(upb_sink *s, const upb_handlers *h, void *c)
Definition: upb.h:5669
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_FileDescriptorProto_package(const upb_symtab *s)
Definition: upb.h:6705
double max
Definition: DeviceProximityEvent.idl:32
const upb_pbdecodermethod * upb_pbcodecache_getdecodermethod(upb_pbcodecache *c, const upb_pbdecodermethodopts *opts)
Definition: upb.c:7428
bool alwaysok_
Definition: upb.h:3321
uint32_t upb_handlers_selectorcount(const upb_fielddef *f)
Definition: upb.c:2556
bool upb_handlerattr_setclosuretype(upb_handlerattr *attr, const void *type)
Definition: upb.c:2588
GLfloat GLfloat GLfloat GLfloat h
Definition: gl2ext.h:3060
bool lazy_
Definition: upb.h:3068
bool upb_handlers_setendmsg(upb_handlers *h, upb_endmsg_handlerfunc *func, upb_handlerattr *attr)
Definition: upb.c:2335
UPB_INLINE void upb_bufhandle_setobj(upb_bufhandle *h, const void *obj, const void *type)
Definition: upb.h:3983
MethodOptions
Definition: descriptor_pb2.py:1744
upb_value upb_inttable_iter_value(const upb_inttable_iter *i)
Definition: upb.c:4702
const upb_byteshandler * handler
Definition: upb.h:5545
bool upb_strtable_insert2(upb_strtable *t, const char *key, size_t len, upb_value val)
Definition: upb.c:4322
EnumDescriptorProto
Definition: descriptor_pb2.py:1674
UPB_INLINE const upb_enumdef * upbdefs_google_protobuf_FieldDescriptorProto_Label(const upb_symtab *s)
Definition: upb.h:6645
uint32_t ofs
Definition: upb.h:7492
UPB_INLINE const upb_msgdef * upbdefs_google_protobuf_FileDescriptorProto(const upb_symtab *s)
Definition: upb.h:6582
void upb_fielddef_setintfmt(upb_fielddef *f, upb_intfmt_t fmt)
Definition: upb.c:1029
void upb_pbcodecache_init(upb_pbcodecache *c)
Definition: upb.c:7402
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_FieldOptions_weak(const upb_symtab *s)
Definition: upb.h:6698
bool upb_handlers_setendsubmsg(upb_handlers *h, const upb_fielddef *f, upb_endfield_handlerfunc *func, upb_handlerattr *attr)
upb_fielddef * upb_fielddef_dup(const upb_fielddef *f, const void *owner)
Definition: upb.c:638
bool type_is_set_
Definition: upb.h:3066
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_UninterpretedOption_NamePart_name_part(const upb_symtab *s)
Definition: upb.h:6739
void upb_pbdecodermethodopts_setlazy(upb_pbdecodermethodopts *opts, bool lazy)
Definition: upb.c:7452
void * cleanup_head
Definition: upb.h:5228
char * name
Definition: upb.h:3056
for i
Definition: complexityMeasures.m:24
#define H(b, c, d)
Definition: md4.c:113
UPB_INLINE uint32_t upb_inthash(uintptr_t key)
Definition: upb.h:836
char type
Definition: upb.h:3029
size_t array_count
Definition: upb.h:806
const void * return_closure_type_
Definition: upb.h:3320
int32_t upb_enumdef_default(const upb_enumdef *e)
Definition: upb.c:467
bool upb_fielddef_checkdescriptortype(int32_t type)
Definition: upb.c:1227
upb_byteshandler input_handler_
Definition: upb.h:7509
Definition: type_traits_unittest.cc:77
size_t upb_env_bytesallocated(const upb_env *e)
Definition: upb.c:1894
const char * upb_enum_iter_name(upb_enum_iter *iter)
Definition: upb.c:510
UPB_INLINE bool upb_bytessink_end(upb_bytessink *s)
Definition: upb.h:5617
UPB_INLINE const upb_msgdef * upbdefs_google_protobuf_UninterpretedOption(const upb_symtab *s)
Definition: upb.h:6632
#define UPB_DISALLOW_COPY_AND_ASSIGN(class_name)
Definition: upb.h:150
UPB_INLINE uint64_t upb_zzenc_64(int64_t n)
Definition: upb.h:7706
bool upb_handlers_setdouble(upb_handlers *h, const upb_fielddef *f, upb_double_handlerfunc *func, upb_handlerattr *attr)
bool upb_inttable_lookupptr(const upb_inttable *t, const void *key, upb_value *val)
Definition: upb.c:4582
const upb_handlers * upb_descreader_newhandlers(const void *owner)
Definition: upb.c:6467
void upb_handlers_callback(const void *closure, upb_handlers *h)
Definition: upb.h:3836
uintptr_t val2
Definition: upb.h:732
upb_errorspace * error_space_
Definition: upb.h:510
bool upb_inttable_removeptr(upb_inttable *t, const void *key, upb_value *val)
Definition: upb.c:4587
bool upb_ok(const upb_status *status)
Definition: upb.c:4932
bool upb_fielddef_setsubdef(upb_fielddef *f, const upb_def *subdef, upb_status *s)
Definition: upb.c:1156
uintptr_t upb_inttable_iter_key(const upb_inttable_iter *i)
Definition: upb.c:4697
upb_enumdef * upb_enumdef_dup(const upb_enumdef *e, const void *owner)
Definition: upb.c:412
void upb_status_clear(upb_status *status)
Definition: upb.c:4925
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_FieldDescriptorProto_label(const upb_symtab *s)
Definition: upb.h:6686
int64_t sint
Definition: upb.h:3048
upb_refcounted base
Definition: upb.h:7426
size_t objofs_
Definition: upb.h:3391
size_t selector_count
Definition: upb.h:3095
struct _upb_tabent upb_tabent
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_MethodDescriptorProto_options(const upb_symtab *s)
Definition: upb.h:6726
UPB_INLINE const upb_msgdef * upbdefs_google_protobuf_SourceCodeInfo(const upb_symtab *s)
Definition: upb.h:6622
upb_refcounted base
Definition: upb.h:7487
int upb_msgdef_numfields(const upb_msgdef *m)
Definition: upb.c:1457
upb_env * env
Definition: upb.h:7521
uint64_t val
Definition: upb.h:737
const
Definition: upload.py:398
#define NULL
Definition: common_types.h:41
void upb_strtable_begin(upb_strtable_iter *i, const upb_strtable *t)
Definition: upb.c:4368
const upb_msgdef * upb_oneofdef_containingtype(const upb_oneofdef *o)
Definition: upb.c:1583
containing_type
Definition: descriptor_pb2.py:1563
DOMString e
Definition: WebCryptoAPI.idl:115
upb_pb_encoder * upb_pb_encoder_create(upb_env *e, const upb_handlers *h, upb_bytessink *output)
Definition: upb.c:9028
bool upb_handlers_setbool(upb_handlers *h, const upb_fielddef *f, upb_bool_handlerfunc *func, upb_handlerattr *attr)
const char * kPbDecoderStackOverflow
Definition: upb.c:7480
BigEndianLong Int32
Definition: OpenTypeTypes.h:63
bool tagdelim
Definition: upb.h:3071
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_FieldDescriptorProto_options(const upb_symtab *s)
Definition: upb.h:6689
UPB_END_EXTERN_C typedef upb_strtable_iter upb_enum_iter
Definition: upb.h:2162
upb_sink * upb_textprinter_input(upb_textprinter *p)
Definition: upb.c:9487
JavaScriptCore arg4
Definition: jsc-trace-profiler-events.d:41
const upb_json_parsermethod * m
Definition: upb.h:8438
void upb_env_seterrorfunc(upb_env *e, upb_error_func *func, void *ud)
Definition: upb.c:1837
Definition: Location.idl:44
TypeWithSize< 8 >::UInt UInt64
Definition: gtest-port.h:1493
bool upb_strtable_lookup2(const upb_strtable *t, const char *key, size_t len, upb_value *v)
Definition: upb.c:4344
upb_oneofdef * upb_msg_iter_oneof(const upb_msg_oneof_iter *iter)
Definition: upb.c:1502
const uint32_t * base
Definition: upb.h:7477
bool upb_fielddef_checktype(int32_t type)
Definition: upb.c:1224
upb_msgdef * upb_msgdef_dup(const upb_msgdef *m, const void *owner)
Definition: upb.c:1282
char * upb_strdup2(const char *s, size_t len)
Definition: upb.c:4048
upb_handlers_tabent table[3]
Definition: upb.h:3930
#define UPB_STARTSTR_SELECTOR
Definition: upb.h:3272
const upb_handlers * upb_handlers_newfrozen(const upb_msgdef *m, const void *owner, upb_handlers_callback *callback, const void *closure)
Definition: upb.c:2270
upb_bytessink * upb_json_parser_input(upb_json_parser *p)
Definition: upb.c:11199
Definition: RenderStyleConstants.h:245
void * upb_startstr_handlerfunc(void *c, const void *hd, size_t size_hint)
Definition: upb.h:3809
UPB_BEGIN_EXTERN_C UPB_INLINE void upb_bytessink_reset(upb_bytessink *s, const upb_byteshandler *h, void *closure)
Definition: upb.h:5582
bool upb_float_handlerfunc(void *c, const void *hd, float val)
Definition: upb.h:3806
void upb_fielddef_setisextension(upb_fielddef *f, bool is_extension)
Definition: upb.c:1008
bool upb_handlers_getattr(const upb_handlers *h, upb_selector_t s, upb_handlerattr *attr)
Definition: upb.c:2362
const upb_msgdef * upb_symtab_lookupmsg(const upb_symtab *s, const char *sym)
Definition: upb.c:3628
bool upb_handlers_setfloat(upb_handlers *h, const upb_fielddef *f, upb_float_handlerfunc *func, upb_handlerattr *attr)
uint32_t uint32
Definition: angle_config.h:28
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_MessageOptions_no_standard_descriptor_accessor(const upb_symtab *s)
Definition: upb.h:6722
UPB_INLINE bool upb_strtable_lookup(const upb_strtable *t, const char *key, upb_value *v)
Definition: upb.h:885
uint64_t upb_fielddef_defaultuint64(const upb_fielddef *f)
Definition: upb.c:785
bool upb_msgdef_setfullname(upb_msgdef *m, const char *fullname, upb_status *s)
Definition: upb.c:1326
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_EnumValueDescriptorProto_name(const upb_symtab *s)
Definition: upb.h:6680
upb_alloc_func * alloc
Definition: upb.h:5278
UninterpretedOption
Definition: descriptor_pb2.py:1751
Definition: __init__.py:1
bool upb_fielddef_defaultbool(const upb_fielddef *f)
Definition: upb.c:795
void upb_oneof_next(upb_oneof_iter *iter)
Definition: upb.c:1683
Definition: gflags_completions.h:115
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_UninterpretedOption_name(const upb_symtab *s)
Definition: upb.h:6743
upb_cleanup_func * alloc_cleanup
Definition: upb.h:5279
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_FieldOptions_uninterpreted_option(const upb_symtab *s)
Definition: upb.h:6697
Definition: XMLHttpRequest.idl:38
const upb_handlers * handlers
Definition: upb.h:5520
const char * fullname
Definition: upb.h:3028
size_t index
Definition: upb.h:1016
int32_t upb_pbdecoder_decode_varint_slow(upb_pbdecoder *d, uint64_t *u64)
Definition: upb.c:7832
UPB_INLINE size_t upb_strtable_count(const upb_strtable *t)
Definition: upb.h:857
UPB_BEGIN_EXTERN_C upb_fielddef * upb_fielddef_new(const void *owner)
Definition: upb.c:604
#define I(b, c, d)
Definition: md5.c:128
upb_fieldtype_t upb_fielddef_type(const upb_fielddef *f)
Definition: upb.c:678
void * upb_pbdecoder_startjit(void *closure, const void *hd, size_t size_hint)
Definition: upb.c:8329
MessageOptions
Definition: descriptor_pb2.py:1709
string input
Definition: tokenizer_unittest.cc:198
FieldDescriptorProto * AddField(DescriptorProto *parent, const string &name, int number, FieldDescriptorProto::Label label, FieldDescriptorProto::Type type)
Definition: descriptor_unittest.cc:101
UPB_BEGIN_EXTERN_C upb_json_parser * upb_json_parser_create(upb_env *e, upb_sink *output)
Definition: upb.c:11173
bool upb_uint32_handlerfunc(void *c, const void *hd, uint32_t val)
Definition: upb.h:3804
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_UninterpretedOption_aggregate_value(const upb_symtab *s)
Definition: upb.h:6740
UPB_BEGIN_EXTERN_C UPB_INLINE upb_func * upb_handlers_gethandler(const upb_handlers *h, upb_selector_t s)
Definition: upb.h:3903
void * alloc_ud
Definition: upb.h:5280
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_FileOptions_java_outer_classname(const upb_symtab *s)
Definition: upb.h:6716
void upb_refcounted_ref(const upb_refcounted *r, const void *owner)
Definition: upb.c:3442
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_DescriptorProto_extension_range(const upb_symtab *s)
Definition: upb.h:6670
void upb_fielddef_setdefaultint32(upb_fielddef *f, int32_t val)
Definition: upb.c:1061
#define PUTVAL(type, ctype)
Definition: upb.h:5647
FileDescriptorSet
Definition: descriptor_pb2.py:1623
void swap(JSRetainPtr< T > &a, JSRetainPtr< T > &b)
Definition: JSRetainPtr.h:179
void upb_handlerattr_uninit(upb_handlerattr *attr)
Definition: upb.c:2579
upb_inttable * dispatch
Definition: upb.h:7483
#define free
Definition: mbmalloc.h:50
TypeWithSize< 8 >::Int Int64
Definition: gtest-port.h:1492
To down_cast(From *f)
Definition: casts.h:81
const char * p
Definition: upb.h:7712
const char * extension
Definition: MIMETypeRegistry.cpp:58
const upb_oneofdef * upb_msgdef_findoneof(const upb_msgdef *m, const char *name)
bool upb_fielddef_setnumber(upb_fielddef *f, uint32_t number, upb_status *s)
Definition: upb.c:885
size_t size_param
Definition: upb.h:7559
uint64_t val
Definition: upb.h:7713
#define R(x)
Definition: mangle.cgi.c:21
ServiceDescriptorProto
Definition: descriptor_pb2.py:1688
bool upb_endmsg_handlerfunc(void *c, const void *, upb_status *status)
Definition: upb.h:3799
UPB_END_EXTERN_C typedef upb_inttable_iter upb_msg_field_iter
Definition: upb.h:1827
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_FileDescriptorProto_extension(const upb_symtab *s)
Definition: upb.h:6701
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_FileOptions_java_generic_services(const upb_symtab *s)
Definition: upb.h:6714
const upb_tabent * entries
Definition: upb.h:789
bool upb_fielddef_checkintfmt(int32_t fmt)
Definition: upb.c:1225
bool array_part
Definition: upb.h:1017
const upb_msgdef * msg
Definition: upb.h:3684
int32_t upb_pbdecoder_checktag_slow(upb_pbdecoder *d, uint64_t expected)
Definition: upb.c:7952
bool upb_errcb_t(void *closure, const upb_status *status)
Definition: upb.h:454
#define UPB_STARTMSG_SELECTOR
Definition: upb.h:3267
upb_refcounted * next
Definition: upb.h:1098
uint32_t * bytecode
Definition: upb.h:7436
void upb_msg_field_iter_setdone(upb_msg_field_iter *iter)
Definition: upb.c:1488
void * closure
Definition: upb.h:5546
EnumValueDescriptorProto
Definition: descriptor_pb2.py:1681
EGLImageKHR EGLint EGLint * handle
Definition: eglext.h:851
void upb_refcounted_visit(const upb_refcounted *r, const upb_refcounted *subobj, void *closure)
Definition: upb.h:1175
const void * upb_handlerattr_closuretype(const upb_handlerattr *attr)
Definition: upb.c:2593
Type
Type of JSON value.
Definition: rapidjson.h:616
CFArrayRef CFTypeRef key
Definition: AVFoundationCFSoftLinking.h:129
bool upb_fielddef_hassubdef(const upb_fielddef *f)
Definition: upb.c:1215
bool upb_inttable_done(const upb_inttable_iter *i)
Definition: upb.c:4687
SubsamplingLevel & operator++(SubsamplingLevel &subsamplingLevel)
Definition: ImageFrame.h:51
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_UninterpretedOption_positive_int_value(const upb_symtab *s)
Definition: upb.h:6745
Definition: WebKitWebViewSessionState.cpp:89
const char * data_end
Definition: upb.h:7539
void upb_refcounted_donateref(const upb_refcounted *r, const void *from, const void *to)
Definition: upb.c:3476
int upb_enumdef_numvals(const upb_enumdef *e)
Definition: upb.c:482
void upb_pbdecoder_jit(mgroup *group)
UPB_INLINE const upb_msgdef * upbdefs_google_protobuf_EnumValueOptions(const upb_symtab *s)
Definition: upb.h:6567
const upb_fielddef * upb_msgdef_itof(const upb_msgdef *m, uint32_t i)
Definition: upb.c:1437
constexpr __visitor_return_type< _Visitor, _Types... >::__type visit(_Visitor &&__visitor, Variant< _Types... > &__v)
Definition: Variant.h:1881
UPB_INLINE uint64_t upb_pbdecoder_packdispatch(uint64_t ofs, uint8_t wt1, uint8_t wt2)
Definition: upb.h:7634
bool upb_msgdef_mapentry(const upb_msgdef *m)
Definition: upb.c:1470
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_UninterpretedOption_identifier_value(const upb_symtab *s)
Definition: upb.h:6742
bool upb_fielddef_setmsgsubdef(upb_fielddef *f, const upb_msgdef *subdef, upb_status *s)
Definition: upb.c:1168
void(* visit)(const upb_refcounted *r, upb_refcounted_visit *visit, void *c)
Definition: upb.h:1182
UPB_INLINE char * upb_tabstr(upb_tabkey key, uint32_t *len)
Definition: upb.h:690
#define UPB_PB_ENCODER_SIZE
Definition: upb.h:7859
const void * objtype_
Definition: upb.h:3390
size_t offset
Definition: upb.h:5909
bool upb_inttable_iter_isequal(const upb_inttable_iter *i1, const upb_inttable_iter *i2)
Definition: upb.c:4714
upb_descriptortype_t
Definition: upb.h:1465
GLuint GLsizei GLsizei GLfloat * val
Definition: gl2ext.h:3301
void swap(optional< T > &x, optional< T > &y) __NOEXCEPT_(__NOEXCEPT_(x.swap(y)))
Definition: Optional.h:1047
#define SET_TYPE(dest, val)
Definition: upb.h:606
void upb_fielddef_setdefaultcstr(upb_fielddef *f, const char *str, upb_status *s)
Definition: upb.c:1115
bool upb_handlers_setstartseq(upb_handlers *h, const upb_fielddef *f, upb_startfield_handlerfunc *func, upb_handlerattr *attr)
bool upb_def_setfullname(upb_def *def, const char *fullname, upb_status *s)
Definition: upb.c:74
const struct upb_refcounted_vtbl * vtbl
Definition: upb.h:1101
void * bytes
Definition: upb.h:3052
uint64_t upb_pbdecoder_bytesparsed(const upb_pbdecoder *d)
Definition: upb.c:8455
#define d
Definition: float-mm.c:30
bool upb_msgdef_freeze(upb_msgdef *m, upb_status *status)
Definition: upb.c:1317
upb_inttable groups
Definition: upb.h:7224
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_UninterpretedOption_string_value(const upb_symtab *s)
Definition: upb.h:6746
upb_deftype_t upb_def_type(const upb_def *d)
Definition: upb.c:70
bool upb_inttable_push(upb_inttable *t, upb_value val)
Definition: upb.c:4567
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_DescriptorProto_ExtensionRange_start(const upb_symtab *s)
Definition: upb.h:6667
bool upb_fielddef_istagdelim(const upb_fielddef *f)
Definition: upb.c:695
bool upb_handlers_setuint64(upb_handlers *h, const upb_fielddef *f, upb_uint64_handlerfunc *func, upb_handlerattr *attr)
size_t array_size
Definition: upb.h:805
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_ServiceDescriptorProto_method(const upb_symtab *s)
Definition: upb.h:6729
int32_t upb_pbdecoder_skipunknown(upb_pbdecoder *d, int32_t fieldnum, uint8_t wire_type)
Definition: upb.c:7969
upb_handlerattr attr
Definition: upb.h:3339
GLuint GLsizei GLsizei * length
Definition: gl2.h:435
UPB_INLINE void upb_bufhandle_setbuf(upb_bufhandle *h, const char *buf, size_t ofs)
Definition: upb.h:3988
const char * delim_end
Definition: upb.h:7536
UPB_BEGIN_EXTERN_C void upb_env_init(upb_env *e)
Definition: upb.c:1803
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_FieldDescriptorProto_extendee(const upb_symtab *s)
Definition: upb.h:6685
Definition: type_traits_unittest.cc:129
const char * buf_
Definition: upb.h:3388
void upb_inttable_next(upb_inttable_iter *i)
Definition: upb.c:4672
upb_msgdef * upb_fielddef_containingtype_mutable(upb_fielddef *f)
Definition: upb.c:727
bool upb_oneofdef_setname(upb_oneofdef *o, const char *name, upb_status *s)
Definition: upb.c:1574
EnumOptions
Definition: descriptor_pb2.py:1723
int32_t int32
Definition: angle_config.h:27
const char * upb_enumdef_iton(const upb_enumdef *e, int32_t num)
Definition: upb.c:504
CVPixelBufferRef CVOptionFlags lockFlags CFAllocatorRef allocator
Definition: CoreVideoSoftLink.cpp:56
void upb_env_setallocfunc(upb_env *e, upb_alloc_func *func, void *ud)
Definition: upb.c:1831
void upb_env_reporterrorsto(upb_env *e, upb_status *status)
Definition: upb.c:1843
bool upb_fielddef_checklabel(int32_t label)
Definition: upb.c:1223
message_type
Definition: descriptor_pb2.py:1556
UPB_INLINE const upb_fielddef * upb_oneofdef_ntofz(const upb_oneofdef *o, const char *name)
Definition: upb.h:2423
void * upb_pbdecoder_startbc(void *closure, const void *pc, size_t size_hint)
Definition: upb.c:8317
upb_def ** upb_descreader_getdefs(upb_descreader *r, void *owner, int *n)
Definition: upb.c:6457
#define UPB_DECLARE_TYPE(cppname, cname)
Definition: upb.h:229
GLboolean r
Definition: gl2ext.h:306
upb_tabval val
Definition: upb.h:768
const char * upb_def_fullname(const upb_def *d)
Definition: upb.c:72
#define UPB_DECLARE_DEF_TYPE(cppname, lower, upper)
Definition: upb.h:1415
const char * buf_param
Definition: upb.h:7558
const upb_msgdef * def
Definition: upb.h:3055
void upb_fielddef_setdefaultint64(upb_fielddef *f, int64_t val)
Definition: upb.c:1056
const upb_msgdef * upb_fielddef_containingtype(const upb_fielddef *f)
Definition: upb.c:719
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_SourceCodeInfo_Location_trailing_comments(const upb_symtab *s)
Definition: upb.h:6736
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_FileDescriptorProto_name(const upb_symtab *s)
Definition: upb.h:6703
unsigned long Add(unsigned long a, unsigned long b)
Definition: mod_ops.h:22
google_protobuf_FileOptions_OptimizeMode
Definition: upb.h:6281
upb_handlertype_t
Definition: upb.h:3230
void * ptr
Definition: upb.h:7493