diff options
author | Joshua Haberman <jhaberman@gmail.com> | 2019-01-09 22:40:50 -0800 |
---|---|---|
committer | Joshua Haberman <jhaberman@gmail.com> | 2019-01-09 22:40:50 -0800 |
commit | 0553eff64a87eceff0de3b6260b4f2d45b61703a (patch) | |
tree | 5b051740c041786655d1794a5034ccf20928e8ee /upb/handlers-inl.h | |
parent | 31e0997c1abaa531505d28e36473f1c972ca0849 (diff) |
upb_refcounted is gone! Some tests still to fix.
Diffstat (limited to 'upb/handlers-inl.h')
-rw-r--r-- | upb/handlers-inl.h | 34 |
1 files changed, 11 insertions, 23 deletions
diff --git a/upb/handlers-inl.h b/upb/handlers-inl.h index afc1382..eb9a0fa 100644 --- a/upb/handlers-inl.h +++ b/upb/handlers-inl.h @@ -997,32 +997,12 @@ const T* BufferHandle::GetAttachedObject() const { : NULL; } -inline reffed_ptr<Handlers> Handlers::New(const MessageDef *m) { - upb_handlers *h = upb_handlers_new(m, &h); - return reffed_ptr<Handlers>(h, &h); -} -inline reffed_ptr<const Handlers> Handlers::NewFrozen( - const MessageDef *m, upb_handlers_callback *callback, - const void *closure) { - const upb_handlers *h = upb_handlers_newfrozen(m, &h, callback, closure); - return reffed_ptr<const Handlers>(h, &h); -} inline const Status* Handlers::status() { return upb_handlers_status(this); } inline void Handlers::ClearError() { return upb_handlers_clearerr(this); } -inline bool Handlers::Freeze(Status *s) { - upb::Handlers* h = this; - return upb_handlers_freeze(&h, 1, s); -} -inline bool Handlers::Freeze(Handlers *const *handlers, int n, Status *s) { - return upb_handlers_freeze(handlers, n, s); -} -inline bool Handlers::Freeze(const std::vector<Handlers*>& h, Status* status) { - return upb_handlers_freeze((Handlers* const*)&h[0], h.size(), status); -} inline const MessageDef *Handlers::message_def() const { return upb_handlers_msgdef(this); } @@ -1092,9 +1072,6 @@ inline bool Handlers::SetEndSequenceHandler(const FieldDef *f, handler.AddCleanup(this); return upb_handlers_setendseq(this, f, handler.handler_, &handler.attr_); } -inline bool Handlers::SetSubHandlers(const FieldDef *f, const Handlers *sub) { - return upb_handlers_setsubhandlers(this, f, sub); -} inline const Handlers *Handlers::GetSubHandlers(const FieldDef *f) const { return upb_handlers_getsubhandlers(this, f); } @@ -1116,6 +1093,17 @@ inline const void *Handlers::GetHandlerData(Handlers::Selector selector) { return upb_handlers_gethandlerdata(this, selector); } +inline HandlerCache *HandlerCache::New(upb_handlers_callback *callback, + const void *closure) { + return upb_handlercache_new(callback, closure); +} +inline void HandlerCache::Free(HandlerCache* cache) { + return upb_handlercache_free(cache); +} +const Handlers* HandlerCache::Get(const MessageDef* md) { + return upb_handlercache_get(this, md); +} + inline BytesHandler::BytesHandler() { upb_byteshandler_init(this); } |