Lines Matching defs:handlers
3557 ** parsing or visiting a stream of data. This is similar to how handlers work
3560 ** The handlers have no idea where the data is coming from, so a single set of
3561 ** handlers could be used with two completely different data sources (for
3594 /* All the different types of handlers that can be registered.
3822 * handlers->SetInt32Handler(f1, UpbBind(OnValue1, new MyHandlerData(...)));
3823 * handlers->SetInt32Handler(f2, UpbMakeHandler(OnValue2));
3824 * handlers->SetInt32Handler(f1, UpbMakeHandler(OnValue3));
3825 * handlers->SetInt32Handler(f2, UpbMakeHandler(&MyClosure::OnValue));
3837 * used to register all handlers. Users can Make() these directly but it's
3863 /* A upb::Handlers object represents the set of handlers associated with a
3868 * Any handlers that are not set behave as if they had successfully consumed
3869 * the value. Any unset Start* handlers will propagate their closure to the
3911 /* Returns the msgdef associated with this handlers object. */
3917 * will be run when these handlers are freed. If this pointer has previously
4013 /* Sets handlers for a string field, which are defined as follows:
4144 * function (with optional closure) that can build handlers for a given
4145 * message on-demand, and the cache maintains a map of msgdef->handlers. */
4199 * If/when the size and locality of handlers is an issue, we can optimize this
4225 /* Caller must ensure that "d" outlives the handlers. */
4241 /** Message handlers ******************************************************************/
4247 /* These are the handlers used internally by upb_msgfactory_getmergehandlers().
4278 ** Inline definitions for handlers.h, which are particularly long and a bit
4492 * is non-const so we can free it when the handlers are destroyed. */
4787 * 1. void* for start handlers. If the closure parameter has a different type
4789 * 2. size_t for string buffer handlers.
5161 * This is all nonsense for non START* handlers, but it doesn't matter because
5235 const upb_handlers *handlers;
5245 if (!s.handlers) return true; \
5246 func = (functype *)upb_handlers_gethandler(s.handlers, sel, &hd); \
5261 s->handlers = h;
5271 if (!s.handlers) return n;
5272 handler = (func *)upb_handlers_gethandler(s.handlers, sel, &hd);
5282 if (!s.handlers) return true;
5284 (func *)upb_handlers_gethandler(s.handlers, UPB_UNKNOWN_SELECTOR, &hd);
5294 if (!s.handlers) return true;
5296 (func *)upb_handlers_gethandler(s.handlers, UPB_STARTMSG_SELECTOR, &hd);
5306 if (!s.handlers) return true;
5308 (func *)upb_handlers_gethandler(s.handlers, UPB_ENDMSG_SELECTOR, &hd);
5320 sub->handlers = s.handlers;
5321 if (!s.handlers) return true;
5322 startseq = (func*)upb_handlers_gethandler(s.handlers, sel, &hd);
5333 if (!s.handlers) return true;
5334 endseq = (func*)upb_handlers_gethandler(s.handlers, sel, &hd);
5346 sub->handlers = s.handlers;
5347 if (!s.handlers) return true;
5348 startstr = (func*)upb_handlers_gethandler(s.handlers, sel, &hd);
5359 if (!s.handlers) return true;
5360 endstr = (func*)upb_handlers_gethandler(s.handlers, sel, &hd);
5372 if (!s.handlers) {
5373 sub->handlers = NULL;
5376 sub->handlers = upb_handlers_getsubhandlers_sel(s.handlers, sel);
5377 startsubmsg = (func*)upb_handlers_gethandler(s.handlers, sel, &hd);
5389 if (!s.handlers) return true;
5390 endsubmsg = (func*)upb_handlers_gethandler(s.handlers, sel, &hd);
5414 * pointer for any handler with handlers->GetHandler(selector), without having
5421 * that *could* be registered, without knowing anything about what handlers
5451 /* Constructs a new sink for the given frozen handlers and closure.
5455 template <class T> Sink(const upb_handlers* handlers, T* closure) {
5456 Reset(handlers, closure);
5462 template <class T> void Reset(const upb_handlers* handlers, T* closure) {
5463 upb_sink_reset(&sink_, handlers, closure);
5479 * These may not be called from within one of the same sink's handlers (in
5480 * other words, handlers are not re-entrant). */
5550 * "sub." The sub-sink must be used for any/all handlers called within the
5567 * "sub." The sub-sink must be used for any/all handlers called within the
5660 /* Constructs a new sink for the given frozen handlers and closure.
5783 /* The destination handlers that are statically bound to this method.
5785 * handlers. */
5790 /* The input handlers for this decoder method. */
5894 * handlers. The destination handlercache must outlive this object. */
5941 /* Should the decoder push submessages to lazy handlers for fields that have
5942 * them? The caller should set this iff the lazy handlers expect data that is
5946 /* Returns a DecoderMethod that can push data to the given handlers.
6100 /* The destination handlers this method is bound to. We own a ref. */
6156 /* Decoder entry points; used as handlers. */
6439 /* Lazily builds and caches handlers that will push encoded data to a bytessink.
6454 static EncoderPtr Create(Arena* arena, const Handlers* handlers,
6457 upb_pb_encoder_create(arena->ptr(), handlers, output.sink()));
6463 /* Creates a new set of handlers for this MessageDef. */
6518 /* The given handlers must have come from NewHandlers(). It must outlive the
6520 static TextPrinterPtr Create(Arena *arena, upb::HandlersPtr *handlers,
6523 upb_textprinter_create(arena->ptr(), handlers->ptr(), output.sink()));
6650 * handlers. The upb_symtab object(s) must outlive this object. */
6671 /* Returns a DecoderMethod that can push data to the given handlers.
6721 /* Lazily builds and caches handlers that will push encoded data to a bytessink.
6733 static PrinterPtr Create(Arena *arena, const upb::Handlers *handlers,
6736 upb_json_printer_create(arena->ptr(), handlers, output.sink()));