summaryrefslogtreecommitdiff
path: root/upb/shim/shim.h
diff options
context:
space:
mode:
authorJosh Haberman <jhaberman@gmail.com>2013-10-24 12:43:19 -0700
committerJosh Haberman <jhaberman@gmail.com>2013-10-24 12:43:19 -0700
commit26d98ca94f2f049e8767b4a9a33d185a3d7ea0fd (patch)
tree340bcf495f06ed05c9f3fb423f210caf4edce2b1 /upb/shim/shim.h
parent61109fca1f967771c21dc7184aee35f3b439c577 (diff)
Merge from Google-internal development:
- rewritten decoder; interpreted decoder is bytecode-based, JIT decoder no longer falls back to the interpreter. - C++ improvements: C++11-compatible iterators, upb::reffed_ptr for RAII refcounting, better upcast/downcast support. - removed the gross upb_value abstraction from public upb.h.
Diffstat (limited to 'upb/shim/shim.h')
-rw-r--r--upb/shim/shim.h16
1 files changed, 9 insertions, 7 deletions
diff --git a/upb/shim/shim.h b/upb/shim/shim.h
index 98310d7..bc47bbb 100644
--- a/upb/shim/shim.h
+++ b/upb/shim/shim.h
@@ -37,9 +37,10 @@ struct Shim {
// true if the handler was set successfully.
static bool Set(Handlers *h, const FieldDef *f, size_t ofs, int32_t hasbit);
- // If this handler is a shim, returns the corresponding upb::Shim::Data.
- // Otherwise returns NULL.
- static const Data* GetData(const Handlers* h, Handlers::Selector s);
+ // If this handler is a shim, returns the corresponding upb::Shim::Data and
+ // stores the type in "type". Otherwise returns NULL.
+ static const Data* GetData(const Handlers* h, Handlers::Selector s,
+ FieldDef::Type* type);
};
} // namespace upb
@@ -50,7 +51,8 @@ extern "C" {
// C API.
bool upb_shim_set(upb_handlers *h, const upb_fielddef *f, size_t offset,
int32_t hasbit);
-const upb_shim_data *upb_shim_getdata(const upb_handlers *h, upb_selector_t s);
+const upb_shim_data *upb_shim_getdata(const upb_handlers *h, upb_selector_t s,
+ upb_fieldtype_t *type);
#ifdef __cplusplus
} // extern "C"
@@ -62,9 +64,9 @@ inline bool Shim::Set(Handlers* h, const FieldDef* f, size_t ofs,
int32_t hasbit) {
return upb_shim_set(h, f, ofs, hasbit);
}
-inline const Shim::Data* Shim::GetData(const Handlers* h,
- Handlers::Selector s) {
- return upb_shim_getdata(h, s);
+inline const Shim::Data* Shim::GetData(const Handlers* h, Handlers::Selector s,
+ FieldDef::Type* type) {
+ return upb_shim_getdata(h, s, type);
}
} // namespace
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback